33

Refactoring suggestions are a compliment

 4 years ago
source link: https://github.com/Dobiasd/articles/blob/master/refactoring_suggestions_are_a_compliment.md
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Refactoring suggestions are a compliment

Bob is a software developer. He implements a lot of nice new features. Alice, his colleague, occasionally gives suggestions on how to refactor the code - sometimes in a formal code review, sometimes casually, sometimes as actual commits in a merge request she opens.

Bob interprets her ideas as a compliment because deep in his heart he knows that the intentions of Alice are noble and that she is making these suggestions because

  • she thinks the stuff Bob is working on is important enough to receive such care. She believes the code will be used and extended for quite some time in the future, and that investing her time in it is worth it.
  • she wants to reduce the amount of work on Bob and others in the long-term. They will be more efficient (and happier) maintaining a clean code base compared to something less SOLID.
  • she is positive that Bob is interested in learning and improving his skills. She cares about his personal growth as a developer.

Bob constantly reminds himself of these conditions. Bob is awesome. Think as Bob thinks.

Alice facilitates Bob's mindset by

  • conveying that these refactorings are not urgent but still important and by keeping them at a reasonable size.
  • pointing out issues not just as "smells" but as opportunities for improvement, while also mentioning the parts she likes.
  • striving towards an agreement of two equals by explaining her points and asking questions to understand Bob's way of thinking. She does not try to use authority.
  • being open to learning why Bob's original way might be better than her suggestion.

Alice talks more in terms of "we" instead of "you" and "I". Alice is awesome. Do as Alice does.

Carlos, their CTO, is happy about this friendly culture, which

  • helps to reduce the bus factor thanks to shared knowledge.
  • allows everyone to grow and results in low employee churn.
  • makes the team more productive and lets them create quality software.

Carlos fosters this culture by being a good role model. Carlos is awesome. Lead as Carlos leads.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK