Hacker News new | ask | show | jobs
by ddbb 5999 days ago
The reason they write poor code is because they are beginners and beginners always make mistakes, use functions incorrectly, etc. In any language they code, not just PHP.

PHP is often more visible because it is more used and easier to write... But if PHP wasn't that popular, we would see the same issue with Perl, Python, etc.

2 comments

I could have been clearer with what I meant there, and I agree with you: it's not a problem specific to PHP, and in some ways it's unfair to label beginners' mistakes as problems in the first place.

The point I wanted to emphasize is that by reading lists like these new users might think that this is a good way to write PHP, whereas I strongly disagree with this list existing in the first place.

There's also the slightly selfish point of view of not wanting to have to clean up code like this should I come across it in future ;)

I agree with you. But beginners need to learn from somewhere and most advanced programmers are busy at work and not writing articles :)

Plus, did you ever read a PHP book? Most of them give bad examples and bad code practices too... I just read one that said to disable all apache logging (including error logging) for performance reasons.

PHP encourages shitty code because it is already shitty code in a shitty language. It's the broken windows effect. All you need to know is from Rasmus himself

"There are people who actually like programming. I don't understand why they like programming."

see also his other gems http://en.wikiquote.org/wiki/Rasmus_Lerdorf

The broken window effect? Really?

PHP is far from my favorite language but "language wars" and comments like yours that lead to them are 100% brain dead. Void of original thought.

I see a little irony in people like you cursing PHP as unnecessary and ugly when you are spending your time spewing comments with those same traits.

I was a professional programmer in PHP for just under 10 years so I'm not just bandwagon jumping. I don't get paid by yahoo to post here so I'm free to be as sloppy as I like.