How to get your more experienced and respected teammates not to create “quick workarounds”?

I am currently working on a small short-lived project. But, despite the size, it is quite complex, with very obscure logic. That is why it was started by more experienced developers. From time to time they work on it because it is not their main project.

They made several drafts of the code with numerous places that "will be rewritten in the near future." After that, they added a few more “temporary pieces.” And again..

So, now the project is a mess of “half-working” code fragments with some hard-coded values, such as file names or some constants that “will be replaced by the last working parts”. The API is terrible (no one thinks about it).

And it’s really, really hard to do development now (for me this is the main and only project). I caught myself thinking that every hour I spent about an hour to again understand all these complex “temporary” things and the shortcomings of the API. And after this hour, my brain melts.

I can't just say "guys, your code smells like garbage." What is the right way?

+4
source share
3 answers

It seems that the ultimate problem is that they write the code and take no responsibility for its quality.

If this goes against the culture of the organization, the question is whether the situation should be known to others. If the developers do not know, and I have sympathy, I would take "I do not quite understand this. Could you spend a few minutes going through me through this?" with them. They should soon understand what they are doing with you, and good programmers will adjust their methods. This can also be done using the management hierarchy: "To progress on project X, I need programmers to work with their code." This should happen or cause the conversation "Why", which should lead to change.

If it is an organization culture, it is unfortunate. This may mean that the programmers who produce the code do not care, and not a single guide. This is a bit of a political question - who is capable and / or interested in this change? Find allies and act best. A vivid conversation with the developers may be the best choice, as these are people who are capable of changes, and no one else will prompt them ... so just ask directly.

Hope this helps.

+2
source

Click to implement a formal code verification process. Then they dare not write such code in the first place. I recommend using a shared tool such as SmartBear Code Collaborator or a free survey table. Just like people drive slower when they know that the police are watching, they write the best code if they know that someone will look at it.

+2
source

Don't these “other developers” work on the project anymore? And if so, are you the main person working on this? If the answer to both of them is yes, the project is yours. Start making incremental improvements to make it more readable.

You may also like to show the code to a more experienced developer who did not work on the project. See if they agree that the code is hard to maintain. Offer your boss that you set aside some time to “finish” the temporary work and bring it to the point where it is supported.

Implementing a formal code review process is also a good idea if you want to prevent this from happening again.

And remember that this may not have been the mistake of other developers. Sometimes people are told that they spend minimal time or say that the code will be thrown away.

+1
source

Source: https://habr.com/ru/post/1305313/


All Articles