Hacker News new | ask | show | jobs
by gopher 6436 days ago
Basically, Wordpress is written in PHP and this is the root of all evil.

Let's look at the roots of PHP: it was never designed as a programming language, it was a tiny script language used to create Rasmus Lerdorf's website. Thus, it has a lot of oddities like the === operaor.

Do you know why it it is there? Because they wrote a broken instr() wrapper and messed up the error handling. And instead of doing one thing right, they added another obfuscation layer. Great design.

Then, PHP was traditionally used by webdesigners, not programmers. This lead to tons of bad code and bad practices. It is not that you cannot write elegant code in PHP, but there is so much more bad code around that it is hard to find the good code.

So, why do wonder about this?

3 comments

Can we stop this argument already?

Real hackers can appreciate every damn language out there. If it weren't for Basic in the early 80s, I wouldn't be programming now.

PHP is a wonderful gateway language for a generation of web programmers. It is installed on every webserver and is always ready to rock-n-roll. No other language has achieved that level of ubiquity.

No. We can have a productive discussion about whether a language and its frameworks are conducive to secure coding without it devolving into a language war. We're adults here, and there are more than just stylistic differences between PHP and its competitors.
Don't get me wrong, I like using Python. But I prefer small compromises addressing prior mistakes, allowing for backwards compatibility, over a full rewrite.

I think we're a few years past the arguments you make against PHP. If you want to be trendy, you should rail against the people running Internals (namespace separator).

Waiting a few years doesn't make his arguments wrong.
By "past" I meant that they've been adequately addressed.
Despite the qualms I have with PHP, you can't blame the language for design flaws in the software.
Sure you can. People do it all the time with C.
Hah! Fair enough, but my point was that those claims aren't legitimate. Especially those claims about C