DEV Community

Discussion on: It's not your job!

Collapse
 
sandordargo profile image
Sandor Dargo

What is "unauthorized" refactoring? Do you also have "unauthorized" unit tests? Classes? Methods? Loops? Variables?

I think if you are a professional software engineer you can decide when to do what with the code. If people get offended because their code gets refactored either because it was messy when it was created or because just too many things happened around it, there is a big cultural issue in the team.

On the other hand, when I say do refactoring, I don't say that you should stop delivering features. Just always clean up around the code you touch. Nobody needs an authorization or a user story for that.

Thread Thread
 
jfrankcarr profile image
Frank Carr

Unauthorized means outside of the scope of work you are assigned to do.

You used a military analogy in your post. In the military, if you go outside the rules of engagement or circumvent orders you will likely find yourself court martialed and earn a bad conduct discharge or perhaps a term in Leavenworth even if in your professional opinion you did the right thing at the time. While the consequences aren't as dire on a software development team, doing things beyond what you are assigned can easily land you in trouble or in the unemployment line.

I work with a lot of legacy code, code that has been under development since 90's with a lot of different people involved over the years. Refactoring of this huge legacy code base has to be done with care and planning. If it isn't, it probably will cost the company downtime and money. Maybe if you are working on a newer code base that you can get away with more. I don't have that luxury. I have to keep the factory running.

Thread Thread
 
sandordargo profile image
Sandor Dargo

I also work on such systems. Some parts are newer, some are older. How messy the code is don't just a matter of age, but more like who touched it.

I agree that care and testing are important things. Many will not care and just add the same couple lines here and there dozens of times in a fear-driven development, making things worse. They will not even create a new function, not to mention cleaning up around. Why? Usually not because they think it needs planning and authorization to do a proper job.

I still think I (or anyone else) don't need any authorization to do the work the way, I think it should be done. The PO cannot tell me, how I should implement the feature. But I know people who think differently. The most extreme was someone, who didn't even fix the typo "Hanlder", because the PO made the typo in the title of a user story, so he helped it almost slipping into our codebase. (Code reviews are cool)

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀

And that's why pushing back is so important. Thanks for sharing this post it's a topic very close to home for many I'm sure.