Hacker News new | ask | show | jobs
by ForHackernews 4001 days ago
To be fair, PHP is kinda dangerous, especially in the hands of novices. Honestly, a world with fewer people-who've-never-written-code writing PHP doesn't sound like a bad start to me.

Don't get me wrong, it's possible to write great code in PHP, it's just a language that makes it easy for you to shoot yourself in the foot.

1 comments

You hear the same argument for C / C++ but you don't see people putting it down as much as PHP.
That's probably because C/++ don't have good drop in alternatives. If I want to write a website, there are at least half a dozen equally mature languages to choose from. If I want to write any kind of embedded systems code, C is almost always going to be far and away the easiest way to go.
Not as much, but an awful lot, and in similar ways.

There's a difference in that PHP originated as a low-quality templating language, and that C/C++ are historical monuments of computing that most of the infrastructure of the world and most of the interpreted languages of the world run on.

There's not much of a difference in people calling both old, only used by dinosaurs, essentially unsafe, and the root cause of all bugs being choosing to use them in the first place.

The dangerous features of C/C++ gives you something useful in return -- low level control of memory. The dangerous features of PHP don't provide any benefits. It's dangerous because of poor design.
The beginner's C / C++ programs don't usually get put on the Internet (or even on a local network).
There is no such thing as a bad program. If it works, it's fine. Really...
It's bad if it's susceptible to running an attacker's arbitrary code.
The difference is that PHP is far more accessible to the average beginner than C/C++.
Sure I do, just not in the web dev community because they're generally seeing more PHP to warn about than C / C++ to warn about.