Jump to content


Photo
- - - - -

Will you learn PHP in 2017? Or is it considered to be the bad language ?

php

  • Please log in to reply
31 replies to this topic

#1 Saquib Rizwan

Saquib Rizwan

    Forum Newcomer

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 29 April 2017 - 08:37 AM

I am a newly graduate developer and I really like to work on PHP. I have a good concept of core PHP and OOP in PHP. I was going to learn the framework now but the thing which make me hesitate about it is that I have seen many developers around the world are opposing PHP and saying that it is a bad language. So my question is should I learn PHP and if yes which framework should I learn first. 



#2 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 29 April 2017 - 09:47 AM

I would recommend learning JavaScript over PHP, knowing JavaScript well will enable you to build apps across the stack as it can run both on the client, server and many embedded systems are also running JavaScript.

You will also pick up things like functional programming which is a different paradigm to OOP and is rapidly growing in popularity.  There are many other languages too and while PHP is popular it's not the best paid because of how common PHP devs are and developers in languages such as JavaScript are becoming increasingly sought after.

 

All this said whats more important than learning individual languages is learning programming fundamentals, data structures and how to write clean code.  These skills are transferrable to any language.

If you want to give JavaScript a go I recommend you begin here https://github.com/g...ster/preface.md


Edited by rbrtsmith, 29 April 2017 - 09:48 AM.


#3 hugmax

hugmax

    Forum Newcomer

  • Members
  • Pip
  • 9 posts

Posted 19 May 2017 - 07:04 PM

GO ahead and learn Laravel, one of the most powerfull frameworks.

 



#4 BrowserBugs

BrowserBugs

    Unhinged

  • Privileged
  • PipPipPipPipPip
  • 2,063 posts
  • Gender:Male
  • Location:Surrey, UK
  • Experience:Intermediate
  • Area of Expertise:I'm Learning

Posted 20 May 2017 - 07:25 AM

GO ahead and learn Laravel, one of the most powerfull frameworks.

 

 

"Laravel is a free, open-source PHP web framework" - Is this not PHP?

 

Back to the OP if like to work with PHP then go for it, good PHP developers are the reason things like Laravel and WordPress exist. Learning foundation PHP IMO is much better than learning a framework, just like in the JS world a Javascript developer is better than one who only knows jQuery, sure know both but understanding the actual foundation language is what will make you stand out from the crowd.


Edited by BrowserBugs, 20 May 2017 - 07:30 AM.


#5 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 844 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 20 May 2017 - 12:41 PM

 

"Laravel is a free, open-source PHP web framework" - Is this not PHP?

 

Back to the OP if like to work with PHP then go for it, good PHP developers are the reason things like Laravel and WordPress exist. Learning foundation PHP IMO is much better than learning a framework, just like in the JS world a Javascript developer is better than one who only knows jQuery, sure know both but understanding the actual foundation language is what will make you stand out from the crowd.

 

While it is important to learn the fundamentals of the language, I wouldn't recommend doing much serious development in pure PHP. Frameworks like Zend, Symfony and Laravel are high quality and will strip away a lot of boiler plate that you would otherwise have to write yourself. Generally speaking you'll find these frameworks have lots of very well written modules that can be reused all over the place, and because they're maintained by teams and used by thousands of people the world over, they tend to be much more secure and stable than code you would likely write yourself.

 

They save a tonne of time, teach good strong OOP practices and are generally of such high quality that using them and learning how they all work will turn you into a better developer. For almost anything in PHP I would use a framework of one kind or another. 



#6 BrowserBugs

BrowserBugs

    Unhinged

  • Privileged
  • PipPipPipPipPip
  • 2,063 posts
  • Gender:Male
  • Location:Surrey, UK
  • Experience:Intermediate
  • Area of Expertise:I'm Learning

Posted 20 May 2017 - 01:36 PM

 

While it is important to learn the fundamentals of the language, I wouldn't recommend doing much serious development in pure PHP. Frameworks like Zend, Symfony and Laravel are high quality and will strip away a lot of boiler plate that you would otherwise have to write yourself. Generally speaking you'll find these frameworks have lots of very well written modules that can be reused all over the place, and because they're maintained by teams and used by thousands of people the world over, they tend to be much more secure and stable than code you would likely write yourself.

 

They save a tonne of time, teach good strong OOP practices and are generally of such high quality that using them and learning how they all work will turn you into a better developer. For almost anything in PHP I would use a framework of one kind or another. 

 

I'm not discounting the frameworks, just pointing out that understanding the foundation of what these modules do would be beneficial, at the end of the day some people write these frameworks, unless they use frameworks in frameworks?

 

I'm having trouble finding a real auto electrician at the moment, simply because unless they can plug in my car for a diagnostics code they are clueless, but a real auto electrician can diagnose with resistance etc and not simply rely on software telling them which unit might be at fault. Similar to WP devs lol.



#7 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 844 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 20 May 2017 - 01:49 PM

 

I'm not discounting the frameworks, just pointing out that understanding the foundation of what these modules do would be beneficial, at the end of the day some people write these frameworks, unless they use frameworks in frameworks?

 

I'm having trouble finding a real auto electrician at the moment, simply because unless they can plug in my car for a diagnostics code they are clueless, but a real auto electrician can diagnose with resistance etc and not simply rely on software telling them which unit might be at fault. Similar to WP devs lol.

 

Yes, you obviously need to understand the language in order to use them properly. But in my experience, code bases built using raw php are much harder to maintain than those that use a high quality framework.

 

About the only time I would use raw php would be if I were doing a site that was so simple it's almost static.

 

In order to use these frameworks you usually need to have a strong understanding of OOP for example, so actually you can't really use them until you comfortable with the language itself. Most amateur/new php programmers would struggle to even use them. They're not tools for amateurs - kinda the opposite...



#8 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 20 May 2017 - 02:24 PM

At the end of the day our jobs are to write software with as few bugs as possible.  While it's important to learn low level to gain a stronger understanding these frameworks abstract away a lot of boilerplate and greatly reduce the amount of code you have to write - in turn reducing the probability of bugs.  Also means you have fewer tests to write.

 

These frameworks are merely tools.

When you employ somebody to perform a task you expect them to use the best tools for the job.  Raw PHP or RAW Node is very rarely the best tool for the job.  The strongest engineers will know when to use what tool, I work with some of the strongest developers in the industry - Paul can attest to that - they use frameworks and libraries very regularly.  They could very easily build from scratch but that is not what they get paid to do.


Edited by rbrtsmith, 20 May 2017 - 02:25 PM.


#9 BrowserBugs

BrowserBugs

    Unhinged

  • Privileged
  • PipPipPipPipPip
  • 2,063 posts
  • Gender:Male
  • Location:Surrey, UK
  • Experience:Intermediate
  • Area of Expertise:I'm Learning

Posted 20 May 2017 - 02:37 PM

In order to use these frameworks you usually need to have a strong understanding of OOP for example, so actually you can't really use them until you comfortable with the language itself. Most amateur/new php programmers would struggle to even use them. They're not tools for amateurs - kinda the opposite...

 

They could very easily build from scratch but that is not what they get paid to do.

 

This was my point, in both cases the foundation knowledge is there. I understand the use of frameworks, can see the benefit of them, however the main bee in my bonnet is because the majority of questions on here is stuff like "why doesn't this work' when they are using something like bootstrap yet they don't even understand the principle of float. Do we learn Bootstrap over css?

 

So back to the OP, is php a 'bad' language?



#10 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 844 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 20 May 2017 - 02:37 PM

At the end of the day our jobs are to write software with as few bugs as possible.  While it's important to learn low level to gain a stronger understanding these frameworks abstract away a lot of boilerplate and greatly reduce the amount of code you have to write - in turn reducing the probability of bugs.  Also means you have fewer tests to write.

 

These frameworks are merely tools.

When you employ somebody to perform a task you expect them to use the best tools for the job.  Raw PHP or RAW Node is very rarely the best tool for the job.  The strongest engineers will know when to use what tool, I work with some of the strongest developers in the industry - Paul can attest to that - they use frameworks and libraries very regularly.  They could very easily build from scratch but that is not what they get paid to do.

 

Yep. I wouldn't build anything on any scale without using a framework these days. React is great, and there are great PHP frameworks out there, but in each instance you have to have an understanding of either Javascript or PHP respectively in order to be able to use those frameworks in the first place.

 

The first time I tried to use Zend I didn't have a great deal of OOP experience, so actually found it quite hard to get up and running. I had to go away and read up on proper object oriented design and things like that. After a while though the code I was writing started looking more and more like the way Zend itself was written - it made me a better programmer and I learned loads from that.



#11 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 844 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 20 May 2017 - 03:05 PM

 

 

This was my point, in both cases the foundation knowledge is there. I understand the use of frameworks, can see the benefit of them, however the main bee in my bonnet is because the majority of questions on here is stuff like "why doesn't this work' when they are using something like bootstrap yet they don't even understand the principle of float. Do we learn Bootstrap over css?

 

So back to the OP, is php a 'bad' language?

 

PHP isn't necessarily a bad language, and I don't think deserves much of the flack it gets. You can write perfectly good PHP code and there are plenty of well written PHP apps out there in the wild.

 

However, in my experience, the vast majority of PHP code in most projects is absolutely awful. I suspect a lot of that has to do with the history of the language itself - for example not even properly supporting objects until PHP 5, but the reality is that most of the time when I have to pick up PHP code I feel a sense of dread at the looming godawfulness I'm about to experience.

 

But the language itself can be used in perfectly nice ways, and my understanding is that it's been improving a lot recently.

 

I do however prefer nodejs for virtually everything now. I've come to really enjoy the development experience with node, and as Robert has alluded to above, there's a bit of a push towards functional programming in the JS world now which is quite exciting. I'm no expert with FP, but every time I've tried to stick to a FP form of development, I've found it pleasant to come back to my code.

 

So I guess my answer to the actual question is - no, it's not a bad language, but the day to day reality of working in it is unpleasant because lots of bad code is written in it, and I'm personally more a fan of node and JS these days.


Edited by citypaul, 20 May 2017 - 03:07 PM.


#12 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 20 May 2017 - 03:41 PM

 

 

This was my point, in both cases the foundation knowledge is there. I understand the use of frameworks, can see the benefit of them, however the main bee in my bonnet is because the majority of questions on here is stuff like "why doesn't this work' when they are using something like bootstrap yet they don't even understand the principle of float. Do we learn Bootstrap over css?

I completely agree  A developer absolutely should learn CSS - I wouldn't even bother with Bootstrap, My own Nebula, or BBC's Grandstand are far better.  Think of Bootstrap as an all bells and whistles product like WordPress.  Nebula is more like Laravel - It's a true framework and makes no upfront design decisions about what your application is or how it looks.  It's just architecture.

As for JavaScript I heavily use React. But I would never instruct a beginner to begin with it.  They should first learn JavaScript and do so to a high standard, then look to a framework like React.  However in production you should always use the best tools at your disposal for a given task :)



#13 webdesigner93

webdesigner93

    Web Guru

  • Moderators
  • PipPipPipPipPip
  • 2,877 posts
  • Gender:Male
  • Experience:Web Guru
  • Area of Expertise:Web Developer

Posted 21 May 2017 - 02:10 PM

I completely agree  A developer absolutely should learn CSS - I wouldn't even bother with Bootstrap, My own Nebula, or BBC's Grandstand are far better.  Think of Bootstrap as an all bells and whistles product like WordPress.  Nebula is more like Laravel - It's a true framework and makes no upfront design decisions about what your application is or how it looks.  It's just architecture.

As for JavaScript I heavily use React. But I would never instruct a beginner to begin with it.  They should first learn JavaScript and do so to a high standard, then look to a framework like React.  However in production you should always use the best tools at your disposal for a given task :)

 

But i think some of the good things about bootstrap is you can do things like class="btn btn-sm btn-primary" to create a button etc.. as from what i'm understanding if i used your framework I would have to write the css to actually create a button instead of using classes that are already built in for this task. Is that correct? If that is indeed the case um why would i wanna write the css for my own buttons and use your framework then to just use bootstrap. Doesn't seem to time saving to me. But then again i've never used yours so I could be off base in my assumptions.


Edited by webdesigner93, 21 May 2017 - 02:11 PM.


#14 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 21 May 2017 - 02:23 PM

 

But i think some of the good things about bootstrap is you can do things like class="btn btn-sm btn-primary" to create a button etc.. as from what i'm understanding if i used your framework I would have to write the css to actually create a button instead of using classes that are already built in for this task. Is that correct? If that is indeed the case um why would i wanna write the css for my own buttons and use your framework then to just use bootstrap. Doesn't seem to time saving to me. But then again i've never used yours so I could be off base in my assumptions.

 

The problem is that button and many other elements in Bootstrap are cosmetically themed based on their designers decisions.  Unless your design decisions match theirs you are going to be overriding and undoing styles which leads to an unmaintainable mess.  You shouldn't be modifying a framework, you should only extend them (Open closed principal).
And in reality making a button is extremely straightforward.  The difficult part of CSS - the architecture is what frameworks like Nebula and Grandstand abstract away leaving developers and designers to focus on the cosmetics.

I get what BrowserBugs says, that a lot of Bootstrap consumers claim they are front-end developers but can barely code their way out of a paper bag when it comes to CSS.  Like JavaScript, CSS should be properly learnt by developers working on the UI.  Bootstrap is convenient to these developers because they can have a UI out of the box but that comes with very real limitations as I've explained above.
IMO Bootstrap is useful when you just need a quick, presentable UI and you don't care about any branding or theming - spiking our some API or building an interface to a private API.
 

.btn {
  display: inline-block;
  padding: .5rem 2rem;
  border-radius: 3px;
  text-align: center;
  color: white;
  background-color: grey;
}

.btn--sm {
  padding: .25rem 1rem;
}

.btn--lg {
  padding: 1rem 4rem;
}

.btn--success {
  background-color: green;
}

.btn--error {
  background-color: red;
}

The button module above took literally a minute to write.  Another benefit of Nebula and Grandstand is that they are built on ITCSS and BEM which when used properly allow a Sass/CSS architecture to scale to huge levels with multiple contributors without the typical maintenance issues.

Your initial timesaving doesn't account for the time wasted dealing with specificity issues down the line.  This time is an investment.

Paul talks about TDD a lot on here and one thing that often comes up is that it takes time to write tests.  Yes it does, but it also means that you have confidence that your code works, or the code that a contributor has issued a pull request for works.  You might need to re-factor this code or add a new feature.  With tests you can be sure that you have not broken anything - like through a side-effect.  These are all investments in time that have been proven to save money and time in the long term.
When getting paid to write software you're not being paid to do it quickly, you are being paid to do it right.


Edited by rbrtsmith, 21 May 2017 - 02:32 PM.


#15 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 844 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 21 May 2017 - 03:18 PM

 

The problem is that button and many other elements in Bootstrap are cosmetically themed based on their designers decisions.  Unless your design decisions match theirs you are going to be overriding and undoing styles which leads to an unmaintainable mess.  You shouldn't be modifying a framework, you should only extend them (Open closed principal).
And in reality making a button is extremely straightforward.  The difficult part of CSS - the architecture is what frameworks like Nebula and Grandstand abstract away leaving developers and designers to focus on the cosmetics.

I get what BrowserBugs says, that a lot of Bootstrap consumers claim they are front-end developers but can barely code their way out of a paper bag when it comes to CSS.  Like JavaScript, CSS should be properly learnt by developers working on the UI.  Bootstrap is convenient to these developers because they can have a UI out of the box but that comes with very real limitations as I've explained above.
IMO Bootstrap is useful when you just need a quick, presentable UI and you don't care about any branding or theming - spiking our some API or building an interface to a private API.
 

.btn {
  display: inline-block;
  padding: .5rem 2rem;
  border-radius: 3px;
  text-align: center;
  color: white;
  background-color: grey;
}

.btn--sm {
  padding: .25rem 1rem;
}

.btn--lg {
  padding: 1rem 4rem;
}

.btn--success {
  background-color: green;
}

.btn--error {
  background-color: red;
}

The button module above took literally a minute to write.  Another benefit of Nebula and Grandstand is that they are built on ITCSS and BEM which when used properly allow a Sass/CSS architecture to scale to huge levels with multiple contributors without the typical maintenance issues.

Your initial timesaving doesn't account for the time wasted dealing with specificity issues down the line.  This time is an investment.

Paul talks about TDD a lot on here and one thing that often comes up is that it takes time to write tests.  Yes it does, but it also means that you have confidence that your code works, or the code that a contributor has issued a pull request for works.  You might need to re-factor this code or add a new feature.  With tests you can be sure that you have not broken anything - like through a side-effect.  These are all investments in time that have been proven to save money and time in the long term.
When getting paid to write software you're not being paid to do it quickly, you are being paid to do it right.

 

I agree with Rob. I would use bootstrap for exactly the reasons he stated - if I'm doing some proof of concept or something that I don't really care about the look of, but just want to look generically quite nice. For anything bespoke or serious I'm gonna want to use something that makes life easier for me but doesn't lock me down into any design decisions. Bootstrap is just not made for that use case.

 

>When getting paid to write software you're not being paid to do it quickly, you are being paid to do it right.

 

Boom. That statement basically sums up my entire philosophy on web dev.



#16 ssraj

ssraj

    Forum Newcomer

  • Members
  • Pip
  • 10 posts

Posted 14 June 2017 - 09:33 AM

Though JavaScript does not need a server to run but still the frameworks of PHP like laravel and Magento 2 are responsive and easy to understand. You can also go with the Wordpress which is a PHP framework. In today's time, more than 30% websites are made using WordPress. So it is also a convenient option. Javascript is interesting as well, JQuery is a library of the Javascript which has a huge number of classes and very easy to code. The frameworks like Angular JS and node.js are in the discussion for quite a few time. It is stated that node.js is the most preferred language for the coding side of IOT.


Edited by ssraj, 14 June 2017 - 09:35 AM.


#17 NOCK

NOCK

    Chief Troll Hunter

  • Privileged
  • PipPipPipPipPip
  • 1,588 posts
  • Gender:Male
  • Location:Eastbourne, East Sussex
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 15 June 2017 - 03:00 PM

PHP is definitely worth learning. I like JS, Angular, React etc. HOWEVER, try breaking a PHP application by turning JS off in the browser.

 

Yes, I know React can run server-side and all that but if it worked that well then I think we'd see Facebook doing that and they don't. I read over and over again that React is the way forwards and see lots of arguments for why it is awesome, but PHP still has it's advantages and I won't be turning my back on it any-time soon I don't think.

 

As Paul mentioned above, there's lots of rubbish PHP out there. There's also a lot of rubbish JS for much the same reasons really.

 

In summary, PHP is worth learning, properly. JS is good and you're also going to need it for the pretty stuff if nothing else. So learn both.



#18 Jack

Jack

    NaN

  • Moderators
  • PipPipPipPipPip
  • 3,150 posts
  • Gender:Male
  • Location:Jersey Channel Islands
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 15 June 2017 - 03:44 PM

PHP is definitely worth learning. I like JS, Angular, React etc. HOWEVER, try breaking a PHP application by turning JS off in the browser.

 

Yes, I know React can run server-side and all that but if it worked that well then I think we'd see Facebook doing that and they don't. I read over and over again that React is the way forwards and see lots of arguments for why it is awesome, but PHP still has it's advantages and I won't be turning my back on it any-time soon I don't think.

 

As Paul mentioned above, there's lots of rubbish PHP out there. There's also a lot of rubbish JS for much the same reasons really.

 

In summary, PHP is worth learning, properly. JS is good and you're also going to need it for the pretty stuff if nothing else. So learn both.

 

You can pair React with PHP, Facebook do this at the moment. React DOM is only really concerned with the frontend, the benefit of server-side rendering is for performance mainly, and SEO.

 

The reason why Facebook use PHP is historical, they had difficulties scaling it, at one point they converted PHP to C++ code or something, before creating a new re-implementation of PHP called Hack. Parts of the stack definitely run on Node, just like parts use Erlang, they use a language where it makes the most sense. If they started from scratch I have no idea what they would choose, I'm not even sure if they would go with Node.

 

I get what you're saying, PHP has come a long way, just like JS has, both have pros and cons. I like the modern PHP ecosystem, frameworks like Laravel are extremely powerful. Node seems to suit those that want more fine grained control over their architecture, whereas PHP is more convention over configuration. I think ultimately it comes down to preference, just work in what you enjoy the most, otherwise you'll always struggle to progress if you don't enjoy it.



#19 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 844 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 15 June 2017 - 03:57 PM

You can pair React with PHP, Facebook do this at the moment. React DOM is only really concerned with the frontend, the benefit of server-side rendering is for performance mainly, and SEO.
 
The reason why Facebook use PHP is historical, they had difficulties scaling it, at one point they converted PHP to C++ code or something, before creating a new re-implementation of PHP called Hack. Parts of the stack definitely run on Node, just like parts use Erlang, they use a language where it makes the most sense. If they started from scratch I have no idea what they would choose, I'm not even sure if they would go with Node.
 
I get what you're saying, PHP has come a long way, just like JS has, both have pros and cons. I like the modern PHP ecosystem, frameworks like Laravel are extremely powerful. Node seems to suit those that want more fine grained control over their architecture, whereas PHP is more convention over configuration. I think ultimately it comes down to preference, just work in what you enjoy the most, otherwise you'll always struggle to progress if you don't enjoy it.


Spot on...


#20 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 16 June 2017 - 08:53 AM

The reason why Facebook use PHP is historical, they had difficulties scaling it, at one point they converted PHP to C++ code or something, before creating a new re-implementation of PHP called Hack. Parts of the stack definitely run on Node, just like parts use Erlang, they use a language where it makes the most sense. If they started from scratch I have no idea what they would choose, I'm not even sure if they would go with Node.

I would imagine (Probably already well on their way already) they would use a microservice approach which would potentially involve many languages.  I would suspect Node for handling a lot of the async stuff (That's what it is very good at) and others for more computationally heavy things (Python, Go etc)

I'm not sure there's much of a need for PHP in large greenfield projects as there's better options out there, but one important factor is the skillset of the team - PHP devs are definitely more plentiful and so easier to find and hire so thats a reason why PHP might still be used.

I think with the popularity of frameworks like WordPress it will still continue to be heavily for brochure type sites, it's pretty good at serving those.

I've recently completed the Wes Bos Node course and that highlights what can be done with Node, especially with the enormous amount of packages on NPM it's just a joy to work with.


Edited by rbrtsmith, 16 June 2017 - 08:58 AM.


#21 Jack

Jack

    NaN

  • Moderators
  • PipPipPipPipPip
  • 3,150 posts
  • Gender:Male
  • Location:Jersey Channel Islands
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 16 June 2017 - 09:24 AM

I've recently completed the Wes Bos Node course and that highlights what can be done with Node, especially with the enormous amount of packages on NPM it's just a joy to work with.


I haven't started it yet, what are your thoughts on it?



#22 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 844 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 16 June 2017 - 10:33 AM

I haven't started it yet, what are your thoughts on it?

I started on it but gave up half way through. It was ok to a point I thought, but I wasn't learning all that much so decided to stop. There still may be some sections I may go back to in the future, like the mongo side of things.

 

TBH I don't agree that PHP is such a bad choice. PHP has made lots of great improvements over the years, and it's perfectly possible to write excellent code that will scale nicely in PHP. It's still not a bad choice in my opinion, but I do generally prefer node these days, mostly because I've been using it a lot in work, and I've found that the general day to day experience is a pleasant one. Having said that, it's true that the JS world is kinda crazy these days - I agree with a lot of the comments about JS fatigue. My friend who mostly uses Ruby started a React project fairly recently, and in his words "Getting up and running nearly broke me". JS is by no means perfect and PHP remains a good option. 

 

There does seem to be a lot of traction in the JS world these days though, so if I were learning from scratch I'd recommend JS more than PHP. Just be prepared to spend a lot of time learning - PHP is a lot easier to get up and running in my opinion, and it's also a much more stable language than JS these days I'd say.



#23 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 16 June 2017 - 11:55 AM

I haven't started it yet, what are your thoughts on it?


I think it's a really good introduction to Mongo/Mongoose which I hadn't used before beyond the most trivial of instances.  He makes good use of Async/Await for consuming promises.  I like how he introduces MVC architecture.

He does the templating on the server-side though.  I think the more modern way of doing this is to make the backend API just send JSON responses out rather than rendering templates.  The front-end service itself can still render server side with React/Vue and just query the API to get the responses back.

But I felt like I've learnt a lot from doing this.  I guess it depends how much prior Node / Express experience you already have, at least in terms of building a real application.  Would be much better if he introduced some unit testing...



#24 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 16 June 2017 - 11:58 AM

I started on it but gave up half way through. It was ok to a point I thought, but I wasn't learning all that much so decided to stop. There still may be some sections I may go back to in the future, like the mongo side of things.

 

TBH I don't agree that PHP is such a bad choice. PHP has made lots of great improvements over the years, and it's perfectly possible to write excellent code that will scale nicely in PHP. It's still not a bad choice in my opinion, but I do generally prefer node these days, mostly because I've been using it a lot in work, and I've found that the general day to day experience is a pleasant one. Having said that, it's true that the JS world is kinda crazy these days - I agree with a lot of the comments about JS fatigue. My friend who mostly uses Ruby started a React project fairly recently, and in his words "Getting up and running nearly broke me". JS is by no means perfect and PHP remains a good option. 

 

There does seem to be a lot of traction in the JS world these days though, so if I were learning from scratch I'd recommend JS more than PHP. Just be prepared to spend a lot of time learning - PHP is a lot easier to get up and running in my opinion, and it's also a much more stable language than JS these days I'd say.

Did you not introduce you mate to create-react-app?  It's a great package for somebody who just wants to get a React dev environment up and running quickly.

BTW I wasn't saying PHP is a bad language. I just think when going with a microservice approach you pick the language most suited to that service.  I can't think of any instances where PHP would be the best choice for a service.  Only that your team might already be skilled in PHP, and in that case then it's definitely a viable option.



#25 citypaul

citypaul

    Privileged

  • Privileged
  • PipPipPipPip
  • 844 posts
  • Gender:Male
  • Location:Manchester
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 16 June 2017 - 11:59 AM

Did you not introduce you mate to create-react-app?  It's a great package for somebody who just wants to get a React dev environment up and running quickly.

BTW I wasn't saying PHP is a bad language. I just think when going with a microservice approach you pick the language most suited to that service.  I can't think of any instances where PHP would be the best choice for a service.  Only that your team might already be skilled in PHP, and in that case then it's definitely a viable option.

Yeah, the issue with create-react-app though, while it's a great package, is that it does so much for you under the hood. For someone who wants to understand what's going on, it's all a bit much.

 

I do enjoy Node as you know, as well as React, but the learning curve for this stuff is certainly very high.



#26 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 16 June 2017 - 12:04 PM

Yeah, the issue with create-react-app though, while it's a great package, is that it does so much for you under the hood. For someone who wants to understand what's going on, it's all a bit much.

 

I do enjoy Node as you know, as well as React, but the learning curve for this stuff is certainly very high.

I agree it's high, but it is helping to solve some very difficult problems on the frontend, especially now with the complexity that consumers are becoming accustomed to.
To try and solve things like module bundling, transpilation, code splitting, client routing along with all the DOM stuff that React abstracts would be much, much harder to do manually.  Redux helps solve shared state, especially over time.  Relay looks to be solving shared state between the client and API but I've not really looked into that much.  But it stands that these are really complex problems.
Frontend has also always been really hard to test, and I think React has helped massively there too.

 

I think that the fact a lot of these problems have only recently been solved or are in the process of being results in a lot of flux and change in best practices.  I'm confident over the next few years or so things will slow down a bit as best practice emerge - although there's always gonna be innovation and flux when working with bleeding edge technologies.


Edited by rbrtsmith, 16 June 2017 - 12:09 PM.


#27 Jack

Jack

    NaN

  • Moderators
  • PipPipPipPipPip
  • 3,150 posts
  • Gender:Male
  • Location:Jersey Channel Islands
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 16 June 2017 - 12:27 PM

The JS ecosystem, is one of, if not the best out there IMO, but I can't help but think it will cause issues in a few years that we're not seeing now. A lot of the solutions and packages out there are still treated as side projects and have no guarantee of being around for the long term, a lot of amazing ideas and libraries are abandonware already after a year or so. It's great that now developers have so much choice when it comes to adding packages, you can choose your own method of auth, caching etc, but I think developers will find themselves ripping a lot of code out and having to replace it if they aren't careful. Micro Services are not a silver bullet, they require a lot of careful planning, otherwise you simply lose the benefit that the architecture provides.

 

I think this is why companies like Netflix and Facebook tend to write the essential parts themselves, and only use projects that have significant resources behind them, or proven long-term backing. React Router is an example that you don't typically see in communities like PHP and Ruby, the code has been totally re-written 4 times in 2 years. I'm not dissing RR, V4 is really nice to work with and a massive improvement, but I can sympathise with developers having the burden of upgrading a third time when they have other things to be doing. If you multiply this across potentially hundreds of packages it starts to become a nightmare to work on.

 

I can see why something like Laravel or Rails would appeal to developers for this reason, usually all of the essential parts of the app first-party, at a cost of having to do things 'the Rails away'. It's not like these solutions stagnate either, if the community is starting to do real-time work, the framework authors will work out a way of providing a first-party solution. It's a tradeoff like most things, but I definitely see why a consistent architecture, same method of writing code, same method of testing, and easier upgrade path would appeal to the masses. It's also a good solution for start-ups because you can spend more time on writing code than playing around with the architecture. Rails helped Twitter get to 250mil users (not well, though) before the Scala re-build, as well as helping other companies like Shopify and AirBNB get to where they are today. As far as I know, Node doesn't have a Rails-like framework with any major backing, which still makes Rails and PHP frameworks a fair option.



#28 Jack

Jack

    NaN

  • Moderators
  • PipPipPipPipPip
  • 3,150 posts
  • Gender:Male
  • Location:Jersey Channel Islands
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 16 June 2017 - 12:44 PM

Yeah, the issue with create-react-app though, while it's a great package, is that it does so much for you under the hood. For someone who wants to understand what's going on, it's all a bit much.

 

I do enjoy Node as you know, as well as React, but the learning curve for this stuff is certainly very high.

 

There's an issue on Github I saw recently where people weren't aware that CRA turns your code into a progressive web app automatically. Obviously this can introduce buggy behaviour and confusion, as well as apps being unknowingly cached indefinitely if you screw it up. I think I would prefer a name change to react-cli and have templates like vue-cli, where you can choose a build process for the type of app you're building https://github.com/vuejs/vue-cli. It seems like a nice approach.



#29 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 16 June 2017 - 01:06 PM

We've been doing the same at work, only consume projects with significant backing for live projects.  We're in the process of open sourcing a React Timeline package https://github.com/J...react-timelines Still lots of work to do around documentation and producing a demo but we've been very careful not to have a large dependency tree.  In fact we only have devDependencies and peerDependencies having manually built out various utilities and so on.

As for RR4 there's no real reason for consumers to upgrade from v3 as the RR team have pledge to continually support, develop and accept contributions for v3.  But I still understand the pain developers have to go though - but this is kind of indicative of working at the bleeding edge in an area thats receiving a huge amount of innovation.

 

One just has to make smart decisions on what packages they consume on live projects - looking at gh-stars, contribution history, company backing.  React is very safe to use for example as it's backed by Facebook and they have additional vested interest in that they actually consume it really heavily on their flagship application.


Edited by rbrtsmith, 16 June 2017 - 01:10 PM.


#30 Jack

Jack

    NaN

  • Moderators
  • PipPipPipPipPip
  • 3,150 posts
  • Gender:Male
  • Location:Jersey Channel Islands
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 16 June 2017 - 02:20 PM

I think we can all agree that learning COBOL is in everyone's best interest.



#31 Jack

Jack

    NaN

  • Moderators
  • PipPipPipPipPip
  • 3,150 posts
  • Gender:Male
  • Location:Jersey Channel Islands
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 16 June 2017 - 03:22 PM

He does the templating on the server-side though.  I think the more modern way of doing this is to make the backend API just send JSON responses out rather than rendering templates.  The front-end service itself can still render server side with React/Vue and just query the API to get the responses back.


I remember thinking the first thing I would do when it came to that section is to install something like Nunjucks instead of Pug. I can't stand the syntax Pug uses. Nunjucks is the same as Twig in PHP, which is used in Craft, so I don't have to learn anything new, and yeah I would probably prefer the API route anyway.



#32 rbrtsmith

rbrtsmith

    ReferenceError

  • Privileged
  • PipPipPipPipPip
  • 3,995 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 16 June 2017 - 09:35 PM

I remember thinking the first thing I would do when it came to that section is to install something like Nunjucks instead of Pug. I can't stand the syntax Pug uses. Nunjucks is the same as Twig in PHP, which is used in Craft, so I don't have to learn anything new, and yeah I would probably prefer the API route anyway.

I didn't mind the Pug syntax too much but I just don't think the API should really be concerned with getting request and sending back the relevant data (JSON) and let the frontend deal with how that is represented.  

That all said I've still learnt a lot from the course and I'll be doing it again to help cement that knowledge :)


Edited by rbrtsmith, 16 June 2017 - 09:36 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users