Blog 2019 02 06 Virtue always has neighbours

Virtue always has neighbours

Confucius wrote that “Virtue is never solitary; it always has neighbors.” What he meant by that was that good behaviour and good thinking is contagious.

Is that actually true? I don’t have the answer in general, but in my experience, it is working pretty much like that.

When I joined 5 years ago the company I still work for, I knew - almost - nothing about software development. I kept receiving tons of comments on my pull requests, often the same ones. For example, I found it difficult to pay attention not to pass variables by value, but to use an ampersand and even the const keyword. What a horror to write const std::string& param instead of simply write std::string param!

Three things helped. Time, of course. And asking the whys. When I understood why to put those extra characters there it got easier. And besides, I saw that my colleagues were acting what they were preaching. Their good behaviour was contagious.

Then I took on some automation tasks in my team and I started learning and using Python. I soon learnt there was a guy in the team with pretty solid Python skills. Samuel worked as a C++ developer, but he enjoyed Python the most. I suffered a lot in the beginning because nothing was good enough for him that I wrote. Frankly, in hindsight, what I wrote was crap in terms of being Pythonic, but it did the job. That would have been just the next step for me - to write Pythonic code. I’m very grateful for him having pointed out all those details in my code.

Having Samuel reviewing my code and having the possibility for me to review what he wrote helped me to jump that next level quite fast. I can thank the foundations of my Python skills to Sam. His Pythonic thinking and his good coding behaviour were contagious.

In that team, I really started to value good thinking. I also understood that having someone with no coding experience doesn’t mean the end of the world. One can get better by - not so much - time, especially if the foundations are there. Should it be projects you did in/after a boot camp or your CS degree.

In that team, the quality of pull requests, the depth of discussions initiated in the code reviews, the design meetings helped me develop a professional pride that I have taken with myself to my later teams. In the beginning, I didn’t start working in my new positions with the explicit intention of changing how people think and work. I just did my job the way I thought it’s right - of course, that will constantly change if you don’t stand still but learn. After some time, I found that my way of doing things helped like-minded people supporting each other in our daily work.

That was the point when I realized that one plus one is way more than two. If you are not alone speaking about something, more people will believe it and actually follow your pieces of advice. We could create a culture of learning and attracted a few talented coders who had not had the right inputs and we helped each other to get better. How? By deliberate practice at coding dojos, by watching Clean Coder videos, by doing code reviews for each other and of course by many other means. There is nothing better than seeing someone getting better because of the lifting power of the community that you helped grow.

I saw good behaviour being contagious in other projects too. Once I joined only for a couple of months to port a C++ API to Python. To understand what I had to do, I actually had to look into the server part that was written in Java. It was clearly not the most awful code I’ve ever seen, but it also showed that the people who wrote it, they didn’t handle code quality and testability as an important aspect of their job. Maybe because of time pressure, maybe not. Needless to say, they were long gone to other projects.

I understand that having developers perfecting the code for ages and never delivering are not welcome. They are bad for the business as they never deliver. I’m not one of them. On the other hand, I also see how people spend their time. A cigarette here, a coffee there, a Tweet, a Facebook post and lunchtime has almost arrived. Everybody knows that we cannot work efficiently between noon and three and most if it is lunchtime anyway, and between three and half-past five when we are not having another coffee we might write a couple of lines of code.

Obviously, I’m exaggerating. A lot. But it’s hard to say that there is no truth in it. I’ve never used to smoke, but I used to be guilty with some other just mentioned time-wasters, especially with the aimless, long coffee meetings. But I made up my mind and I misuse much less of my time. Most probably because I have way less of it as a parent and I have to appreciate my time more.

Going back to my subject of good behaviour, I decided to dedicate 25 minutes (1 pomodoro) to tackle technical debt in that server part I mentioned a couple of paragraphs before. Some would scream that the project didn’t ask for it. True. Did they ask us to scroll aimlessly on your favourite social media platform? Did they ask us to… No, I don’t continue, if you wanted you already got the point.

I made a small pull request almost every day for one and a half months and actually cleaned up about 80% of the technical debt - according to SonarQube at least. By the end of my time on the project, I found that someone else also started to clean up some of the repositories. Cleaning up technical debt was contagious. Soon he got promoted. Not because of me, it was him who he did the work, but it was good to see that maybe… maybe I had a good influence on him.

When I left that project/team, I was looking for the next one with an idea in my mind to find a place which is not so great yet, but where I could help to make the environment better. I didn’t just want to join a team that seemed already great. I arrived at my new team about six months after someone who I already knew and respected a lot. We both arrived with the same will. It’s a half-win already. I find changing things alone to be very difficult, but two people have much better chances as I said.

After a year, I still feel motivated. In fact, I am more motivated than ever. I can see many good changes in the way we work. We write more tests, we think about the maintainability, we ask more questions in code reviews, there are fewer buddy reviews and we stand up for ourselves and for the team if needed. This also means that from time to time we have to have some less pleasant conversations, but that’s not a problem. As it is said, the more difficult discussions one has the more successful he or she will be.

I shared my example because I experienced in my own career how good behaviour is contagious and how much Confucius was right. I’ve experienced it from both sides. I’ve both seen and shown good behaviour. Even today that’s one of the most motivating things I have in my career. People showing a good example around me. I’m grateful for them and I try to pay their service back, by also showing good behaviour.

In my opinion, that’s the best you can do. Follow and show a good example. Keep your head up and remember: virtue always has neighbours.

This post is licensed under CC BY 4.0 by the author.