Live data from Hacker News

How terrible code gets written by sane people

chrismm.com

11–20 of 151 posts

Re: How terrible code gets written by sane people

#11

This is a fucking arrogant article. I would love to see this blogger try to maintain a large codebase after several development cycles in the real world. To come into someone else's codebase that has umpteen number of iterations and tough business realities like trying to make money, and proclaiming that it's terrible code and how he would fix it, is delusional and self-aggrandizing. Most production code needs to be…

> This is a fucking arrogant article.

Please don't. Even if you're right, it steers discussion in a ranty direction.

Re: How terrible code gets written by sane people

#12
post #7

Focusing on poor metrics such as “issues closed” or “commits per day” I once worked at a company that used an offshore company to work on certain modules of a large project. They would commit code that my team would have to then code review. We'd see things like large IF-ELSE blocks with minor differences among the conditions (sometimes just one char). I know everyone hates this. Turns out their internal metric was l…

There's an old quote I read and I keep it with me. It was for CEOs and it says, "You get what you incentivize." The hardest part of managing a group of people is incentivizing exactly what you want, yet so many people don't spend an ounce of thought tuning that properly. There's other people who believe process will fix everything, yet don't bother tuning their process.

Many companies have fallen because the CEOs incentivize net without incintivizing quality, i.e. gut the company, get your bonus and get out.

Re: How terrible code gets written by sane people

#13
post #4

All good examples (such as excessive importance to deadlines, a big no-no). My question: can they be truly good programmers of they write bad code? Isn't the essential product of a programmer SLOC and functionality via software? And if they do that in a manner inferior to another dev, isn't that objectively a measure of inferiority in their craft? I've met far too many 'good' programmers who were a net detriment to a…

Yes and no. Crazy, made up deadlines will throw even the best developer off. They want to, fist and foremost get it done. If everything else is irrelevant, then that's what you will get. Of course that ends up being bad for everybody, but many businesses still don't have a clue on how to operate their most important department. Sometimes you have a hard deadline that you just can't help like a mission critical bug, or the VP of sales promised your most important client an impossible date and there are fines involved.

I'm a firm believer of setting aside time for refactoring every X number of releases. That solves a lot of this.

Re: How terrible code gets written by sane people

#14
post #4

All good examples (such as excessive importance to deadlines, a big no-no). My question: can they be truly good programmers of they write bad code? Isn't the essential product of a programmer SLOC and functionality via software? And if they do that in a manner inferior to another dev, isn't that objectively a measure of inferiority in their craft? I've met far too many 'good' programmers who were a net detriment to a…

So true. A 'good' programmer who commits terrible code is a bad programmer. In other words, one trait of a senior developer is knowing to pick your battles.

If you can't do good work, you have to get out.

Re: How terrible code gets written by sane people

#15
post #13
post #4

All good examples (such as excessive importance to deadlines, a big no-no). My question: can they be truly good programmers of they write bad code? Isn't the essential product of a programmer SLOC and functionality via software? And if they do that in a manner inferior to another dev, isn't that objectively a measure of inferiority in their craft? I've met far too many 'good' programmers who were a net detriment to a…

Yes and no. Crazy, made up deadlines will throw even the best developer off. They want to, fist and foremost get it done. If everything else is irrelevant, then that's what you will get. Of course that ends up being bad for everybody, but many businesses still don't have a clue on how to operate their most important department. Sometimes you have a hard deadline that you just can't help like a mission critical bug, o…

You know, it depends...

Impossible and strict deadlines simply because of cost control is shooting yourself in the foot.

Impossible deadlines because of a really important deal worth actual money, is probably worth sweating over,at the risk of code quality. If all projects tend to be the latter case, it's probably actually the first case packaged as the second...

Re: How terrible code gets written by sane people

#16
post #15
post #13

Earlier quoted context omitted.

Yes and no. Crazy, made up deadlines will throw even the best developer off. They want to, fist and foremost get it done. If everything else is irrelevant, then that's what you will get. Of course that ends up being bad for everybody, but many businesses still don't have a clue on how to operate their most important department. Sometimes you have a hard deadline that you just can't help like a mission critical bug, o…

You know, it depends... Impossible and strict deadlines simply because of cost control is shooting yourself in the foot. Impossible deadlines because of a really important deal worth actual money, is probably worth sweating over,at the risk of code quality. If all projects tend to be the latter case, it's probably actually the first case packaged as the second...

Sure, sometimes it's just a matter of survival. Get this code released by this date or we sink. That's an unfortunate place to be in, requires a lot of focus under stress and is rarely rewarded. It's gratifying for me to be successful in those circumstances, but too many of them and I have to find a saner place to work. Management starts to take miracles as the norm by planning them (if they even do) and it leads to burnout.

Re: How terrible code gets written by sane people

#17
post #12
post #7

Focusing on poor metrics such as “issues closed” or “commits per day” I once worked at a company that used an offshore company to work on certain modules of a large project. They would commit code that my team would have to then code review. We'd see things like large IF-ELSE blocks with minor differences among the conditions (sometimes just one char). I know everyone hates this. Turns out their internal metric was l…

There's an old quote I read and I keep it with me. It was for CEOs and it says, "You get what you incentivize." The hardest part of managing a group of people is incentivizing exactly what you want, yet so many people don't spend an ounce of thought tuning that properly. There's other people who believe process will fix everything, yet don't bother tuning their process. Many companies have fallen because the CEOs inc…

Code should be reviewed, preferably by a different group of people who wrote the code, metrics are only useful for people to manage themselves. Upon review there should be immediate feedback to people who wrote it and if they continue to make the same errors, then you should eventually get rid of the person who wrote it. Making up stupid systems of control to "incentivize" people as a method of management is the stupidest thing rationalists ever cooked up. It destroys internal motivation and discipline.

Re: How terrible code gets written by sane people

#18
post #14
post #4

All good examples (such as excessive importance to deadlines, a big no-no). My question: can they be truly good programmers of they write bad code? Isn't the essential product of a programmer SLOC and functionality via software? And if they do that in a manner inferior to another dev, isn't that objectively a measure of inferiority in their craft? I've met far too many 'good' programmers who were a net detriment to a…

So true. A 'good' programmer who commits terrible code is a bad programmer. In other words, one trait of a senior developer is knowing to pick your battles. If you can't do good work, you have to get out.

I think is is true at the earlier stages of one's career. One you get older and have to start feeding a family, the idealism wears off and you start finding yourself compromising your morals and coding shit to make a deadline. But the company you work for pays you so well, coupled with the expert domain knowledge that makes you nearly irreplaceable, you become complacent. You are a fixed cog in the system. At this point "get out" is not in your best interests.

Re: How terrible code gets written by sane people

#19
post #4

All good examples (such as excessive importance to deadlines, a big no-no). My question: can they be truly good programmers of they write bad code? Isn't the essential product of a programmer SLOC and functionality via software? And if they do that in a manner inferior to another dev, isn't that objectively a measure of inferiority in their craft? I've met far too many 'good' programmers who were a net detriment to a…

Under insufficient time constraints, a good developer will either produce bad code or no code at all (he will resign from the company). This is extremely common. The stuff the author said about too much emphasis on deadlines is spot-on. Some developers who code really fast might appear like they're being extremely productive but behind the scenes, you end up having a whole team of developers who are just fixing that…

> Some developers who code really fast might appear like they're being extremely productive but behind the scenes, you end up having a whole team of developers who are just fixing that developer's bugs.

This is very prevalent at my job. There are a couple of developers who have a reputation of being really fast. "Wow, he closed 25 tickets the last hour!". In reality he mainly rejected them or made quick fixes which didn't work or created new bugs. A not insignificant amount of time in a recent project I had was focused on rewriting code said developer had written.

Post reply on HN