Live data from Hacker News

How terrible code gets written by sane people

chrismm.com

141–150 of 151 posts

Re: How terrible code gets written by sane people

#141
post #103

Earlier quoted context omitted.

I wrote two mails yesterday which basically "push back against upper management", for a very good reason. At least that's what I think. Now I'm totally terrified about what will happen tomorrow. I have 4 kids and almost no money in the bank.

Don't 'push back'. That is the wrong terminology, and it's inherently confrontational. Explain to your managers the range of outcomes and give them the power to make the decision with the best information you can provide them. i.e. 'if we skip this bit, then quality will likely suffer, with these kinds of expected outcomes'. Don't be dramatic or emotional, just try to give the best information you can. Also have symp…

I think you're laying out what is absolutely the best approach.

If you're an employee it's sometimes hard to separate the company's interests from your own, so I sometimes do a mental exercise I call "playing consultant" - where it's purely my job to "consult".

I try to honestly describe the options, give my best recommendation and then whatever they choose is on them.

Re: How terrible code gets written by sane people

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

How do you check up on that reviewer? In you system, he has power to fire people, decide all standards+code style+architecture by himself and force that upon everyone else. All that with no accountability nor responsibility.

Re: How terrible code gets written by sane people

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

How do you check up on that reviewer? In you system, he has power to fire people, decide all standards+code style+architecture by himself and force that upon everyone else. All that with no accountability nor responsibility.

Re: How terrible code gets written by sane people

#144
* Giving excessive importance to estimates

Seen this one. It was used as a excuse not to do code reviews because they cause to miss estimates. "Look, the feature is done, but because of the code review requirement I cannot mark it 'done' in the project plan." Solution: abolish code reviews.

* Assuming that good process fixes bad people

This one is a big one. It's everywhere. Especially in big software development companies, such as Microsoft and Google. They tend to believe that once they institute a perfect process, everything works out perfectly. Perfect coding guidelines lead to perfect code, no matter who writes it. Perfect testing process - testing can be done by monkeys. Perfect project management process - now we can hire project managers with just basic Microsoft Excel skills. They don't understand that without actual talent the company enters a "spiral of death" which is impossible to escape.

* Ignoring proven practices such as code reviews and unit testing

This is done frequently by people who never tried such techniques as code reviews and unit testing. If you do it consistently through, say, one release cycle, you start to value those techniques and understand their importance.

Unit testing, for example, helps me to avoid painful debugging complex issues in production. All features that I unit tested usually just work when integrated into the rest of the product. In fact, the last bug I had to fix happened in code that I neglected to unit test, because the unit test setup was too complex for that component (in itself an indirect sign of a problem). Unit tests also lead to components usable independently of each other, thus reducing the overall system coupling.

* Hiring developers with no “people” skills

This is a double edged sword. On one hand a developer who can't communicate well will eventually produce code that doesn't do what's intended. On the other hand there are people with too much "people" skills who can't code shit. They just bullshit their way through. I'd say there are too many of such bullshitters. A lack of communication skills in a developer is a problem fairly isolated to that developer. A lack of coding skills in a bullshitter is much bigger problem that affect many people around him.

Re: How terrible code gets written by sane people

#146
post #103

Earlier quoted context omitted.

I wrote two mails yesterday which basically "push back against upper management", for a very good reason. At least that's what I think. Now I'm totally terrified about what will happen tomorrow. I have 4 kids and almost no money in the bank.

Don't 'push back'. That is the wrong terminology, and it's inherently confrontational. Explain to your managers the range of outcomes and give them the power to make the decision with the best information you can provide them. i.e. 'if we skip this bit, then quality will likely suffer, with these kinds of expected outcomes'. Don't be dramatic or emotional, just try to give the best information you can. Also have symp…

Pretty much this. Sometimes pushing back is needed, but way more often "negotiation" is needed. It is unreasonable to expect managers to magically see into the development details, you have to explain, made plans transparent etc etc. When you do that you often (not always) find that requirements are negotiable and not equally important, e.g. it is possible to meet the deadline without sacrificing code quality. Oftentimes the compromise is possible - you wont get two week straight of refactoring, but they are ok with using 20% of development time for cleanups.

I have seen developers "push back for the right thing" in a way that basically amounted to angry emotional outburst over things manager did not understood. The dude thought he is pushing for the right thing, but everyone else thought he does not listen to their needs, refuses to follow the company vision of the product replacing it by his own. (They wanted simplest possible functionality and fast, he was constantly adding own requirements to "make it better". When the same person pushes for yet another refactoring, management does not trust him.)

The other thing to understand is that some experienced lead remembers teams that were given time, no deadlines and all the good stuff and then produced mess anyway, procrastinated and took long time to do it. I have seen that happen and I have also seen that ended in long wars over petty differences in style and opinions. Sometimes the mess is result of people doing something knew and thus bad decisions along the way. Code review alone wont solve that, because the reviewer may be the one forcing mistake on others.

You need to communicate in the way that will ensure the manager that he or she is not in the above situation.

Re: How terrible code gets written by sane people

#147

"mixed spaces/tabs for indentation" If that's the second thing in the list of problems, the problems aren't nearly so bad or the author's got a savage case of mixing in the trivial with the important.

I'd say it's like smelling smoke. If your team can't even agree on a standard indent and stick to it, and you haven't got a linter which picks it up, what else are they missing?

Re: How terrible code gets written by sane people

#149
post #130

Earlier quoted context omitted.

As long as you're tactful and willing to cede your argument if they don't come to see your side, there shouldn't be any reason to be terrified. If you act diplomatically and still have crazy bosses, might be good to find a different job if you can, or just not care and get your paycheck.

Unfortunately it is not that simple. Sometimes pushing back on the management is an indication of misalignment of priorities. It may not happen right away, but it can definitely limit your tenure. I have been on both sides of this.

Surely not if you raise a point one time to get a sense of the waters. If the management doesn't like to hear opinions from subordinates, you could pick up that vibe and stop pushing back. It might require greater social and political tact than should be necessary, but no more than needed in normal life situations.

Granted, social IQ is on a scale just like analytical analytical IQ. It would be nice for engineers if we could be blunt and to the point in our communications and let rationality win, but people aren't like that.

I'm just arguing the other end of this, because I've sometimes seen engineers be abrasive while "technically correct", and then have it cause problems for them. Being pleasant in interactions is an important skill, and I feel like sometimes it gets disregarded.

Again,sometimes even with tact and diplomacy, your bosses can still be unreasonable, and that sucks.

Re: How terrible code gets written by sane people

#150
post #146

Earlier quoted context omitted.

Don't 'push back'. That is the wrong terminology, and it's inherently confrontational. Explain to your managers the range of outcomes and give them the power to make the decision with the best information you can provide them. i.e. 'if we skip this bit, then quality will likely suffer, with these kinds of expected outcomes'. Don't be dramatic or emotional, just try to give the best information you can. Also have symp…

Pretty much this. Sometimes pushing back is needed, but way more often "negotiation" is needed. It is unreasonable to expect managers to magically see into the development details, you have to explain, made plans transparent etc etc. When you do that you often (not always) find that requirements are negotiable and not equally important, e.g. it is possible to meet the deadline without sacrificing code quality. Oftent…

There should be no need for 'wars' or even 'negotiation'.

It's the managers decision - not the developers, really.

The devs can lay out what can be done, and describe what the results will be if various paths are chosen.

'Skip the tests' - you get quality issues, but better schedule.

'Write perfect code' - you get quality, but it could take to long.

The old saying: 'fast' 'quality' or 'cheap' -> pick 2.

If your team is having problems because of bike-shedding over details, or messed up code - this is altogether another issue and needs to be addressed differently.

Post reply on HN