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
14 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,861 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
  • 7 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,010 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
  • 805 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,010 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
  • 805 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,861 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,010 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
  • 805 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
  • 805 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,861 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,867 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,861 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
  • 805 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.







2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users