3 ms·
To be honest I don't like PHP for exactly the reasons I don't like javascript. It's easy to write in a way which is stupid. You can write good php and you can
by shadowmint 14y ago
To be honest I don't like PHP for exactly the reasons I don't like javascript.
It's easy to write in a way which is stupid.
You can write good php and you can write cool stuff with it. It is easy to non-technical folk to pickup and write a little bit of.
It's also amazingly easy to:
1) Write code which is broken and stupid (woops, left error_reporting(E_ALL) on! silly me. dumped all the passwords out into the website. woops. stabs designer)
2) Write code which is clever, but different from the coding style of every other piece of code in the project (>_> look, my js is so clever, its using closures for everything and events and... oh, you guys weren't doing that? um... ok. Well, now we have some piece of code that only one person knows how to understand stabs self important javascript ninja with spoon).
3) Introduce bugs.
Managing your developers is really the key. If you can keep your php programmers in line, and keep bad code out of your project, php isn't that bad.
...but its that much harder to do when twice as many people are working on the code, and some of them belong to another team.
- Produce 14y ago1) Use a framework like Symfony2. 2) Yes, I agree, PHP encourages you to write esoteric code. Oh wait, what the fuck am I smoking? Better yet, what are you smoking? You can do this in every language I know. 3) Use unit and functional testing. You do use automated testing, don't you?
- j_baker 14y agoI think you missed the nuance in #2. Yes, you can write esoteric code in any language, but few languages actively encourage it like PHP.
- elliotanderson 14y agoRead the Symfony source, it's a template for how good PHP should be written.