Live data from Hacker News

How terrible code gets written by sane people

chrismm.com

21–30 of 151 posts

Re: How terrible code gets written by sane people

#21
post #17
post #12

Earlier quoted context omitted.

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 stup…

>is the stupidest thing rationalists ever cooked up.

Oh, you don't like bonuses then? Unsolicited, forced code review doesn't have much value that I've found, unless your team is fairly junior. Senior guys know what good code looks like, even in a crunch. If you hold forced, unsolicited code reviews with senior developers, you are really just throwing away money and aggravating people.

It's just another half thought out process. A better incentive, in my opinion is: if you release a complete codebase with 0 medium and above defects by X date, you get a free week off, or something of significant value. A free, company branded desk clock doesn't cut it. (that's happened to me before).

If a company is trying to save money by hiring the cheapest offshore developers they can, they are still really just throwing away money and aggravating people. lol. That is a perfect example of a poor incentive: cut costs without any regard to the resulting cuts in quality. Anyone can make a turd cheaply, but that's rarely what businesses really want.

Re: How terrible code gets written by sane people

#22
I work on a lot of projects like this. The non-techies running the project are usually clueless and programmers are out of touch with modern best practices. The funny thing is that it makes me look slow for not finishing tasks. People in charge want to see features banged out. The guys who write hundred-line if-defs or copy/paste code from one file to another, get to go home at 5pm and live their life. Someone else picks up the tab later. When they need some info from the db, they just add an ajax call and some php function to fetch that and use jQuery to change it on page. I don't even try to refactor this stuff, just breaks everything, so I go along. I won't even say anything about cleaning it up, because it will be assigned to me, while the other guys pile on spaghetti code like there is no tomorrow, good luck merging that.

Re: How terrible code gets written by sane people

#23
post #17
post #12

Earlier quoted context omitted.

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 stup…

That's what I had to do. My manager told me of this metric (set by the higher ups in a contract with the offshore company) along with "there's nothing we can do." I essentially became the code repository sheriff. Eventually I was spending too much of my time refactoring their code and not enough on my own. Then deadline creep set in for me and I had to just let it go.

Re: How terrible code gets written by sane people

#25
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…

Basically the same idea as http://www.duperrin.com/english/2014/06/23/quote-tell-how-yo...

Re: How terrible code gets written by sane people

#26
post #22

I work on a lot of projects like this. The non-techies running the project are usually clueless and programmers are out of touch with modern best practices. The funny thing is that it makes me look slow for not finishing tasks. People in charge want to see features banged out. The guys who write hundred-line if-defs or copy/paste code from one file to another, get to go home at 5pm and live their life. Someone else p…

I sympathize with this, but perhaps it is really more economical to write software like this in your company's case (?)

Re: How terrible code gets written by sane people

#27

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…

> The best code is the code that is easiest to manipulate and modify this great (IMO) article comes to mind: http://programmingisterrible.com/post/139222674273/write-cod... : "Write code that is easy to delete, not easy to extend"

Excellent article, thanks.

Re: How terrible code gets written by sane people

#28
post #26
post #22

I work on a lot of projects like this. The non-techies running the project are usually clueless and programmers are out of touch with modern best practices. The funny thing is that it makes me look slow for not finishing tasks. People in charge want to see features banged out. The guys who write hundred-line if-defs or copy/paste code from one file to another, get to go home at 5pm and live their life. Someone else p…

I sympathize with this, but perhaps it is really more economical to write software like this in your company's case (?)

It appears that way short term, but long term, having a bad codebase can retard a company's growth through lack of scalability and maintainability (read easily add/remove/change features). Companies spend a hell of a lot of money for growth. If they don't know how to manage software development, then the software will nullify all that cost spend on growing, because the system can't handle it.

I am truly amazed at how bad many US businesses are at managing their software systems. It's as if they are considered an afterthought rather than the department on which every other department depends. It's simply old fashioned thinking. CEOs are typically older, and the current crop were trained before computers really proliferated business.

Post reply on HN