Hacker News new | ask | show | jobs
by redcat7 2319 days ago
PHP community is here a funny example. Basically an example what happens when you bully coders that their languages sucks. They went for fullblown corporate style clean code rules (slow), for a language used in places where speed is crucial. This language currently is completly suboptimal for business if you apply clean code rules.

I've worked in 2 companies that used PHP, where php programmers formed a "clean code religion". One company died, another lost a lot of money. It was directly connected to the clean code rules - they went over the deadline, by a lot, they created overbloted code(but ok with the rules) that was pain in the ass to work on. "Code is documentation" was repeated like a mantra, which is a pile of bullshit by the way and is not making stuff easier (and I ended up with my own docs anyway). Clean code rules are cool if you don't know what you're doing and you want to hide it. It's a way to say "its not my fault, look I followed clean code rules, my work if flawless".

And coders in those companies didn't even noticed that there is something wrong. I've noticed when it was too late. In the second company, on my last day (half the company was sacked cause client got pissed and cut the money), we where in a restaurant eating and talking about programming stuff. Guys (who weren't sacked) where discussing a new web page they where working on. The main frontend guy, said he spend 2 weeks perfecting a dynamic menu cause he had some problems with loading time. The guy was rendering the menu in JS, on frontend, record by record. I asked him "if making dynamic menu is such a problem, why don't you have it prerendered in a text format, and then load that text when page loads, you won't need to render anything?" He replied that this would be against the rules and the code would have to use hack or something. I don't know any fucking rule that wouldn't allow me to do such a thing. I recognize eyes of a fanatic when I see them, so I've shut up. They solved the problem of menu by displaying users a loading gif when the code waited for menu to be rendered

After that day I decided I wont do any PHP gigs anymore. Nor work with something similar in syntax to PHP.

3 comments

It's not just clean code, it's also things like microservice migrations or complete rewrites (preferably in a trendy framework or language) that makes programmers think they finally have the solution to all their problems (not those of the business, mind you), so they spend a bunch of time infrastructuring themselves down a hole they'll never escape, and bring the company down with them because they're "doing the right thing" or "fighting tech debt" or "breaking up the monolith".

Programmers should not have the responsibility to decide these things on their own; it should come from the companys risk assessments and help with the goal of the company, not the goal of the programmers (which is to put neat things on their CV.)

This is spoken as a programmer, by the way.

I haven't had that problem, but I do see a tendency for devs who enter the mid-level hump start to get big for their boots and want to clamp down on those below/around them doing things the "wrong way" (the way that isn't the way they like).

Normally you need a senior dev with a sense of pragmatism above them all to smack down any attempts to straitjacket the coding below/around them.

I use PHP a lot, simply because there's so much of it out there (lots of work), and one of the firsts thing I often do when taking on a project from another vendor is rip out any "no space at the end of the line" linting garbage and the like. As always in life, it's not about swinging for one side (vomitcode) or the other (anal styleguides), but achieving balance.

As someone who came after the whole php craze, could you describe what some of these practices were?