Hacker News new | ask | show | jobs
by Joeri 4641 days ago
That's a very unfavorable reading of that slide. Who are you to say they are wrong when they talk about their own anecdotal experience?

Speaking anecdotally, I got exposed to PHP before I did to Python. I tried Python after hearing how much more amazing than PHP it was. I understand why people say that now, because Python has a "flavor" that I suspect most programmers find more pleasing. I also learned another thing: I am not more productive in Python than PHP.

PHP, like JavaScript, is a language constructed out of good parts and bad parts. They both suffer from the same ailments. It is painfully easy to construct code examples of their horribleness, there are mountains of bad code floating around the internet, they lack essential facilities like strict typing, many facilities that they do provide should be carefully avoided, and the overall flavor of the language is just plain weird. However, PHP, like JavaScript, allows you to be remarkably productive.

JavaScript got out of the doghouse when Douglas Crockford wrote his book and converted the JS community to the jslint style of programming. JavaScript didn't change, but the perception and practice of it did. I think PHP needs a similar champion who is willing to say: PHP can be a good and proper language, provided you use it correctly, and btw here is a tool that tells you whether you're doing that in your code.

I am a PHP programmer, and to your high and mighty attitude I say: screw that. There's nothing wrong with being a PHP programmer.

1 comments

Sorry. I got bitter there at the end, it was uncalled for. I spent 3+ years as a PHP programmer, there's certainly nothing wrong with being a PHP programmer, but it's hard to argue that in 2013 it is still a good and productive platform to learn. It pains me to see newcomers starting out by learning PHP, they are essentially shooting themselves in the foot for at least a year of their life (if they are going to be a professional web dev). I was pretty productive at PHP, but only because I cut my teeth for years writing shitty cgi-style PHP scripts, learning the abortion they call their stdlib, then using PHP's OOP crap and finally using frameworks like CI. Imagine if I had spent that time writing ruby. By the time you get the whole way through, you realize that your "high-level language" should do work for you, not the other way around. I think what it comes down to is that PHP does not mandate good design patterns because it cannot even decide on one itself. Once I understood this, the language was forever tainted.

I think the only reason PHP is still relevant is because it's so damn accessible (kinda like w3schools), every shared hosting provider under the sun gives you apache+php, and when you're starting learning web programming shared providing is the way to go.

Why do you say php and Javascript suffer from the same ailments? They suffer from a few of the same ailments, like a crappy/confusing stdlib (although you don't see mysql_real_escape_string in javascript's API) and funky invisible type coercions. Lack of true OOP in javascript, though confusing to beginners, is a design feature as far as I'm concerned, prototyping gives you the tools to implement OOP however you like. But javascript has had a known design pattern from the beginning, which is very powerful and useful once you learn it. I strongly doubt a (another?) phplint at this point would change anything.

As for the "anecdotally" slide, I read the last statement as a conclusion of the previous stats, which didn't make any sense to me. Either I am completely misreading it or you are taking the phrase "anecdotally" far too literally.