Hacker News new | ask | show | jobs
by Rust 5214 days ago
I am both a PHP and Java dev, and have found that PHP is far faster, leaner and more maintainable for websites than Java is.

The last hard-core (ie. expensive) Java dev we had working on one of our back-end projects turned in code that was so abstracted and made such heavy use of dependency injection, it was not only difficult to read through, but took over 30ms to respond to requests. Maintainability was a nightmare, mainly because by abstracting things so thoroughly he effectively (and inadvertently) made the platform so tightly coupled that changing low-level code became very difficult.

Our current hard-core (ie. affordable) PHP dev spent almost exactly the same number of hours re-implementing the Java system, retained the extensibility requirements, and the framework returns responses in about 1ms. We have extendable objects for everything (models, controller, extensions, etc.), but without the 5 to 10 layers of abstraction.

As an added benefit, with PHP we don't have to worry about recompiling every time a change is made (during development, at least), we aren't running any memory-hog VMs, and it's far easier to find good devs when we need them.

That said, PHP takes a lot of crap because of its low barriers to entry. It's easy to learn the basics, it's very easy to learn bad habits, and it's too easy to write insecure code. A good PHP dev knows how to write fast, secure code, but it is hard to figure out who is a "good" PHP dev and who is a "copy/paste" PHP dev.

1 comments

It should be noted that the Java dev obviously over-designed the system, and that a different dev may have delivered something much more "keepable".

However, my experience over the last 20 years has shown me that this is pretty much the way of things - expert Java devs love making things complex by layering more complexity over things in order to make them simpler. Expert PHP devs tend to remove complexity and turn in far more intelligently organized code.

I've seen exceptions to both generalizations, but not very damn many. It's depressing.