Live data from Hacker News

Maintaining code quality when nobody cares

mkdev.me

151–160 of 245 posts

Re: Maintaining code quality when nobody cares

#151

Some things I've learned about code quality in organizations where the quality is terrible: 1. The problem starts with culture. These organizations are run top-down by people who don't understand coding. Sometimes they are ex-engineers, but that's usually about as good as non-engineer. 2. These organizations are systemically incapable of determining good work from bad. Who on the team is performing and who isn't? The…

I like this list. What I have found about point #4 is that even teams that try to actually measure performance in a meaningful way will miss things.

If the quality of the software is slowing down feature releases, causing fires but is not being measured, you can make some headway with presenting ways to measure code quality so that your work shows up on their radar. This is difficult with such a subjective word as "quality" but tracking number of fires of time would be a good way to show that the way you develop is better than other people.

The other thing that companies miss are employees that help other employees in a mentoring sort of way. These people essentially cast a buff on everyone they work with. These buffs can be in the form of better tools, improved workflows, recommending reading material, new technologies etc. Unfortunately it seems this is up to that person's superior to recognize their value and fend for that person to upper management. I feel like it's easy for me to identify peers that cast buffs but not sure how easy it would be for a manager to identify such characters.

Re: Maintaining code quality when nobody cares

#152

Earlier quoted context omitted.

Yes, but in this case someone else did the thinking for you and it is actually pretty accurate. If the only time you care about quality is when you are being checked, audited or supervised then it will not work. Quality needs to be infused all across the board and needs to be reinforced from the management downwards throughout the whole organization, not just in the quality control department. So Ford was definitely…

isn’t this like saying quality code is code that is correct without unit tests? They seem unrelated

They are related in that quality code is code that is both correct now and can easily be made correct when things change--and things always change. Unit tests are what enable correctness in the future.

Re: Maintaining code quality when nobody cares

#153
I am a Dev Coach. This means companies hire me to pair program with their developers and help them focus on "technical excellence" which is manager speak for "code quality".

Here's what I've found:

- Most companies don't actually care about code quality. This is especially true for the ones that hire me. The managers that bring me in would much rather play-act than make the systemic changes required for their teams to operate with improving quality.

- There are systemic challenges to code quality in these environments. Namely hiring practices, performance evaluation, and priorities (budget/timeline). Obvious.

- Nobody can explain the benefit of code quality in terms persuasively enough to managers that they will accept the cost. I've never seen it done. It must come from somewhere else. This is why companies with more technical people in positions of leadership tend to have this problem less IME. Frankly I think this is why we use words like "technical debt" either that or it's a tautology. There's an irrational lack of discipline in this area akin to credit card debt.

- Furthermore, software itself does not matter to these companies.

That last one is the most important and it is not meant to be normative. I'm not saying software is not of actual importance. I'm saying it is not treated in the company with any importance. Software development is viewed as a necessary evil, not as an opportunity for competitive advantage.

The difference between my clients who view software as a necessary evil vs. a competitive advantage cannot be understated. It is immense. Often these companies with different perspectives are competitors in the same industry! You can guess which ones are growing happily and which ones are struggling to cope with changes to their business.

There are companies where the ratio of "business" people to IT is 1:3 and they balk when you tell them they're essentially a software company.

"No, we're a mortgage company."

Ok how's that working out?

What I've decided is to start doing a better assessment up front as to the actual priorities and perspective within these companies when choosing a client. There are companies where the light bulb is coming on and it can be a blast to work with them. In the current climate I would advise everyone to just flat out avoid companies that don't see themselves as tech companies. Work for companies that see themselves as tech companies or are seriously trying to change that perception internally. You can find companies like this in all industries. You might be surprised.

Re: Maintaining code quality when nobody cares

#154
post #56

> Code review at the end of the task. This is something I still struggle with. I think it's a result of an open source tool (GitHub) bringing bits of culture along with it. In open source world, all contributions are entirely voluntary, and most follow the Benevolent Dictator For Life form of governance. So you do a bunch of work, and you submit a polite request for the BDFL to pull your work into the project. He or…

Or you can do pair and/or mob programming, where the review happens as the code is created. This eliminates the feedback loop and the creation of throwaway code.

Re: Maintaining code quality when nobody cares

#155
post #147

I've tried this approach in the past and and it has made me very bitter. Eventually I realized that the company I worked for enforced no accountability for bad code, so I would often open the solution later and found a pile of ugly hacks or other mess. Code reviews? Refactoring? "We don't have time and no one is going to pay for it". Eventually you come to a conclusion that if no one cares then why should you? If any…

Don't stress about code quality. Quality code is it's own reward. Yes, clean code is more fun to write and work with. But, just think of it as a different kind of optimization problem. If the investment is not going to pay off in the future, then it's not worth doing in the first place. PS: This is not giving up, it's about getting even better by becoming ever more flexible.

this is very selfish, unless you're the only developer in your shop.

whoever works with you will have to bear the burden that you left behind because you think its a low ROI for YOU

Re: Maintaining code quality when nobody cares

#156

I've tried this approach in the past and and it has made me very bitter. Eventually I realized that the company I worked for enforced no accountability for bad code, so I would often open the solution later and found a pile of ugly hacks or other mess. Code reviews? Refactoring? "We don't have time and no one is going to pay for it". Eventually you come to a conclusion that if no one cares then why should you? If any…

It can be very frustrating, but ultimately it's a reflection on you. Whether you're a coder, or a librarian, or a janitor, take pride in your work. Do the best job you can. If everyone else's code looks like crap, that's on them. When new people come on, they'll see your work compared to the slackers, and start emulating you, not them. Like anything in life: Do the right thing, even when you're surrounded by villains…

Better advice: Go to where they actually care about what you're doing, if you can. Otherwise, put effort into what you're doing, but don't go overboard, and absolutely never work overtime.

Re: Maintaining code quality when nobody cares

#157
post #147

Earlier quoted context omitted.

Don't stress about code quality. Quality code is it's own reward. Yes, clean code is more fun to write and work with. But, just think of it as a different kind of optimization problem. If the investment is not going to pay off in the future, then it's not worth doing in the first place. PS: This is not giving up, it's about getting even better by becoming ever more flexible.

this is very selfish, unless you're the only developer in your shop. whoever works with you will have to bear the burden that you left behind because you think its a low ROI for YOU

Not just your coworkers today, "future you" as well.

I've known of or read the situation where someone opens some old code, thinks "Who wrote this hot garbage?", and then realizes it was them.

Re: Maintaining code quality when nobody cares

#158
post #104

I’ve often wondered about a twisted form of asynchronous “pair” programming: One person codes quickly, creating mediocre code that achieves the goals, the other person cleans the code up and modularizes it. I’m drawn to this because they are two different mindsets that achieve somewhat conflicting goals, and the tasks can be separated with minimal communication overhead. Thoughts?

I just left a project after I was unable to make peace with being the cleanup guy for an endless, never-improving stream of mediocre code. I am convinced that it's faster to write solid code in the first place.

Once there are two or more interacting layers of code, it gets really hard for the refactoring to catch up. If you fix a bug in a basic layer, the leaves of the codebase break. If you fix a bug in the leaves, you never get to refactor the core. If you want to stop the world and refactor everything at once, you get in the way of your quicker counterpart.

Or think of a multithreaded codebase without any synchronization. It definitely works well enough for demoing an "almost finished" product, but cleaning it up requires a lot of time and can introduce temporary regressions (deadlocks) that are worse than the bugs that the cleanup is supposed to solve (very spurious data corruption). It's a bit like the bullshit asymmetry:

https://twitter.com/ziobrando/status/289635060758507521

Ruby on Rails (from the OP) makes it easy to build many kinds of maintenance deathtraps.

Re: Maintaining code quality when nobody cares

#159

I've tried this approach in the past and and it has made me very bitter. Eventually I realized that the company I worked for enforced no accountability for bad code, so I would often open the solution later and found a pile of ugly hacks or other mess. Code reviews? Refactoring? "We don't have time and no one is going to pay for it". Eventually you come to a conclusion that if no one cares then why should you? If any…

It can be very frustrating, but ultimately it's a reflection on you. Whether you're a coder, or a librarian, or a janitor, take pride in your work. Do the best job you can. If everyone else's code looks like crap, that's on them. When new people come on, they'll see your work compared to the slackers, and start emulating you, not them. Like anything in life: Do the right thing, even when you're surrounded by villains…

Strongly agree. Still, do keep some of your powder dry and look for opportunities to join a better team or company.

An engineer once told me he cried with joy when he saw the interface and used some subsystem I had written a year earlier (in C, for an embedded system). So, I encourage you to write such great, beautiful code that other engineers will cry with joy when they behold and maintain it.

Re: Maintaining code quality when nobody cares

#160
post #137

I've tried this approach in the past and and it has made me very bitter. Eventually I realized that the company I worked for enforced no accountability for bad code, so I would often open the solution later and found a pile of ugly hacks or other mess. Code reviews? Refactoring? "We don't have time and no one is going to pay for it". Eventually you come to a conclusion that if no one cares then why should you? If any…

I'm in a similar situation right now: The company thinks that any feature-wanter who's loud enough is automatically "one of the product owners" (always plural, always ambiguous) with the ability to tap an outsourced development house for "additional capacity." I regularly come across months-old new code that the main team wasn't even consulted about. Reinvented caching layers, eval'ed code in database tables, file-do…

At that point, you could probably bring in Legal. Not only are these just poor coding practices, but some of these things are very serious security vulnerabilities. If you've got contracts with clients, or even if you're licensed straight to individuals, it's a good bet that you're breaching some data security/privacy rules. Legal would definitely want to know and take steps to correct.
Post reply on HN