Lets talk PHP
The HN community is clearly (in general) anti-PHP. If HN was all you read, one would get the impression that PHP is a dying language with no jobs available for developers. This seems to be the opposite of what I have seen (as a mid-level dev with .NET & PHP experience). My 12 year old nephew is starting out his coding career with Javascript and I want to get him some experience with server side languages too where he can immediately get hacking on some real world examples (and not just 'hello world')
Lets see...the most popular (and best) CMS - Wordpress is PHP, most of the popular open-source e-commerce platforms are PHP (Woocommerce, Magento, etc), the biggest social network is PHP (Facebook), the best open source Dropbox competitor is PHP (OwnCloud), then we have Wikipedia, Moodle, Limesurvey...it seems the best competitor for commercial incumbants is an open source PHP projects every time...
So can someone illuminate me why the HN community is so anti-PHP, and why my nephew might not get a job when he finishes school (in 5 years) if all he knows is PHP & Javascript?
7 comments
[ 3.6 ms ] story [ 10.0 ms ] threadThe market for PHP developers isn't going to go away, but if you work somewhere that is using PHP there is a good chance you won't be working somewhere with a strong engineering focus. So you probably won't have great people to learn from and you will limit your growth as a software engineer.
In addition eCommerce and Content Management System tools and ecosystems are still by far the most popular out there. After years of Node.js hype there is still nothing that rivals WordPress in terms of flexibility and ease of use. Same goes for Magento on the eCommerce end. Not that WP or Magento are good examples of high quality codebases.
All that said, there are no longer arguments why you would use PHP specifically. In that sense it has lost it's edge and you can use any number of languages for developing CRUD apps for the web. But if you need to get shit done, there is nothing wrong with PHP and your customers couldn't care less.
Like what?
>The libraries available for PHP tend to be buggy or poorly designed.
Which? In what era? Compared to what? The mountains of crap (alongside quality stuff) on npm?
Not everybody is. Mostly newbs who think it makes them look smarter if they bash what's unfashionable (though for people who code in JS, to badmouth PHP as a bad language is rich), and holier-than-thou types, who value purity over pragmatism, and have never created anything substantial anyway.
People who code in C or C++ for example, have produced working products, and know all the bad areas and deficiencies of their languages but appreciate them for the results and pragmatism they allow, would think twice before bashing PHP for not being some perfect language.
- I did not like relying on web server software to handle routing in my applications
- There was no nice way to handle dependencies (I've heard there is now composer but then there was not).
- Redundant and useless modules. For example, several that handle XML, 2 that do Mysql, etc.
- Inconsistency. Can't recall the specific instance of this but two similar functions would work identically but accept arguments in different order.
- Messing with php.ini was disgusting.
I still know a webdev who works in PHP (Laravel specifically) and he tells me the language has improved a lot. I'm happy for him, but I have no desire to return.
Since then, I've worked with Node.js, python, ruby and elixir and am really glad I've had that experience.
Some people stopped using PHP years ago and either aren't aware, or don't care, that it like other languages has evolved and improved over time.
Some people don't like its inconsistent syntax and weird edge cases and... yeah, fair enough. Some people want a cathedral and find PHP a bit too bazaar.
My opinion - use PHP if you want to, don't use it if you don't, but being emotionally invested in negativity towards a programming language is silly either way.
Best of a bad bunch is not "best".... remember that and you will do well.
Also remember, just because you can, doesn't mean you should.
Also remember, always use the right tool for the job at hand (which is seldom wordpress)