5 ms·
I personally don't think PHP is that bad of a language either. I mean all languages have caveats, there is no such thing as a perfect language. I think PHP gets
by DigitalSea 12y ago
I personally don't think PHP is that bad of a language either. I mean all languages have caveats, there is no such thing as a perfect language. I think PHP gets a bad rep because there is a lot of bad code out there and people blame the language for the bad code, which is like blaming car manufacturers for drunk drivers. But some of the criticism is legitimate and we would all be very naive regardless of our stance to not at least admit that PHP has some design issues.
The biggest issue I have always personally had with PHP is parameter consistency. A few might laugh and think this is a pretty small thing compared to other issues that PHP has, I agree, but it is annoying nonetheless. Some inbuilt methods want the needle first, others want the haystack first. Array functions tend to prefer needle first then haystack, string functions tend to prefer haystack first then needle.
The problem is PHP is a culmination of years upon years worth of backwards compatibility. The quirks around the order of parameters on inbuilt methods will probably never be addressed, it is something we just have to deal with. There are other quirks I won't bother detailing, but I still like the language. However I do acknowledge that parts of the language are a series of hacks. While PHP is not a perfect language, it works. And we also have to acknowledge not too long ago, Javascript was a pretty horrid language with a tonne of quirks to work around as well and will continue to be until we can support great ES6 features without polyfills.
I won't pretend to be a code elitist. I use whatever gets the job done. When a client has a limited budget of $2000 and wants a new website they can manage themselves, nothing beats Wordpress and Wordpress is built on PHP. No other language has a CMS that rivals the power of Wordpress (trust me, I have looked as well). I would argue many people that still use PHP are using it solely because of Wordpress.
Not to mention PHP just works out-of-the-box with almost every hosting provider on the planet with minimal configuration (if any) and can easily be tweaked for great performance (caching and compilation). I still think that PHP has a future ahead of it. It seems there are efforts underway to make it better, Facebook have contributed greatly to the language especially. We might one day see something like ECMAScript 6 happen for PHP where some of the biggest complaints are addressed (who knows).
- pconner 12y ago> I think PHP gets a bad rep because there is a lot of bad code out there and people blame the language for the bad code I think in 5-10 years, in a post "everyone should learn to code" world, people will say some of the same things about Node.js or Rails that have been said about PHP for the last decade. Beginners are going to make mistakes, and PHP was appealing to novice programmers (for a lot of the reasons listed in the article).
- imanaccount247 12y ago>people will say some of the same things about Node.js or Rails that have been said about PHP for the last decade. Really? Please tell me which of these things: http://webonastick.com/php.html http://webonastick.com/php.html applies to ruby. People have been complaining about javascript being shitty for just as long as javascript has existed.
- pconner 12y agoI don't know enough about Ruby to make any specific criticisms of the language. I just know that Ruby/Rails is being recommend to beginners (through Code Academy). I guess I could have said Python instead, but I don't think Python's web frameworks (Django, Flask, etc) have the market share that Rails does.
- imanaccount247 12y agoSo, you have no basis to support your claim, and admit you do not have the understanding required to make such a claim. Then why did you make it?
- pconner 12y agoI never said people would criticize Ruby because of the language itself. I said that it could POSSIBLY (note that this is pure speculation) get the same stigma as PHP because it draws in a lot of beginners.
- imanaccount247 12y agoAnd my point was that PHP does not get stigma because it attracts beginners. It gets valid criticism because it is horribly broken. That's why I showed you one of the many sites making those criticisms.
- Aldo_MX 12y ago> I think PHP gets a bad rep because there is a lot of bad code out there and people blame the language for the bad code, which is like blaming car manufacturers for drunk drivers. This a thousand times, and it's not just PHP, but every mainstream language (like people blaming C just for the sake of blaming C). Languages are tools, and they should be used when they make sense, you are not going to use C to build a website, and you are not going to use PHP to write a firmware.
- Shish2k 12y ago> I think PHP gets a bad rep because there is a lot of bad code out there and people blame the language for the bad code Where do you get the idea that people judge a language based on other people's code in it, and not on their own experience of using it? My experience is quite the opposite -- I can't remember the last time I looked at anybody else's PHP code, my hatred of it comes entirely from using it myself, and comparing it to other languages which I've also used myself.