Discussion about this post

User's avatar
Aleix Morgadas's avatar

__TLDR;__

As Manager, I

- discourage tidying when the team has low business knowledge on the product

- encourage tidying first when that code is strictly related to the delivery

- encourage tidying later when the code was detected during a delivery but not straightly related.

__Long Version;__

I would like to share with you my latest experience leading a product team, and how I felt in some situations that I needed to incentivize to do some tidying and when I needed to discourage it. We have the following context:

We started around 9 month ago, a part of the product was mainly being developed by an external consultancy firm. As the product gain more business relevancy, we decided to start adding organization attention, moving from outsourcing that part into adding more developers from the company.

At the beginning, I was discouraging "huge efforts" on tidying. I felt that people were able to spot several sections on the code that could be improved, yet unable to apply safe tidying due:

1. Not understanding the product and the businesses processes

2. I tend to see people blaming the code because it doesn't match what they are familiar with

When feeling that you don't know about the code and the context, I found that people feel more secure if they adapt the code to what they know, either folder structure or main patterns being used. Indeed, I did this in the past for the same reason.

I consider applying tidies too early lead into the "full refactors", which it's, in my humble opinion, a way to explore the project and gain business knowledge.

So, instead, I discourage dedicate time on them and focus on the businesses and understand them. Helping the team define and understand the ubiquitous language first.

Some time passes. We define new features, experiences and process flows. Team starts being more confident on the source code, and mainly because they created it aside from the legacy code.

They still share their concerns about the code. Their argues move from this is not well coded to this do not represent our business model and therefore has several technical complexities and they are overcoming by avoiding that zone of the code since it's complicated to understand/maintain and slow to modify.

👆 This is a hint to me that we are not applying enough tidies because we are avoiding that zone by creating a new parallel structure aside of the previous or a super structure on top/around of the previous (our case).

In this moment, I see we might need to be more focused on tidying when some uses cases touches those areas. I start incentivizing the team to have conversations about it and aim to see if they can do some tidying incrementally (saying "incremental tidying" seems a redundancy 🤣 )

> Why are we unable to improve the code? What is happening that's preventing us to improve that zone of the code? Based on what you learned, do you think we can reduce the accidental complexity?

--------

As a manager, I think the one of the very few situations I discourage tidying early is when the team members have few to non business knowledge and it can let into several assumptions and applying tidies everywhere without a proper business focus.

This is for a small period of time. When the team has this business focus and mission driven, I tend to encourage them to do tidy first when that tidy is directly related to the business impact that we want to achieve. I also encourage them to take notes of the zone that might need tidying but that's not straightly related to what they are working now. Here it might be good tidying after.

-----

Verbose but I hope it helps you somehow :D

Expand full comment
Valentin Tudor Mocanu's avatar

Timing.

New code over an good design: first I write and then I perform the refactoring.

New code over old code that I don't understand or is hard to work with: tidy first.

I do the initial cleaning as much as I can to work without major problems and then I re-factor anyway along the way and at the end

Expand full comment
10 more comments...

No posts