91 points · by resentfuldev · 8y ago · 41 comments
Even though all of us have a lot of experience, we came from different organizations and we have different styles. I come from a very strict team where everyone was forced to give their best, the standards were really high and the code reviews were brutal.
Even though I appreciate my new colleagues and I want us to have a healthy team culture, I often find myself resenting them each time I review their code.
I don’t think highly of myself as a developer but I find my coworkers extremely sloppy and it seems to me they focus more on narrow problems than the big picture.
I don’t want to be the grumpy developer that thinks he is better than everyone else but that’s what I'm becoming. How do I stop?
If its really sloppy, bend your boss' ear and see if they agree. If so, develop a plan of action with your boss to get things up to standard for everyone.
If it's sloppy and terrible and no one wants to change, find a new job.
I suppose every team is different though.
Something like a style guide might help clarify points. There's also no guarantee that what OP feels about the code is correct. They might like one way but wasn't present for discussions or doesn't understand the work completely. If they're running straight to a manager every time it's only going to end poorly.
I don't care how shitty your code looks, I see little risk as long as it has well contained boundaries with system at large.
You have ownership of your module, and if you leave, and someone needs to work on it, and cringes at how it looks, since the input/output edges are clear, it can be thrown out at re-written to said dev's personal taste.
Focus on delivering business value and creating the best END-USER experience.
If you are focused on pretty code, you will likely be the only one patting yourself on the back when all is said and done.
I agree 100%. For most projects clean code comes secondary.
Moreover, what is clean and what is sloppy is extremely subjective. If the code doesn't produce too many bugs and is understandable enough for others to modify, great. That's all you need.
From my experience, the correlation between writing clean code and delivering business value isn't a thing. I would even go so far to say that people who really care about writing clean code often tend to ignore business goals. Additionally, I've worked with a few clean code/TDD enthusiasts whose output very often contained bugs.
NOTE: This is my personal and VERY anecdotal experience from working on mostly small to medium sized projects (up to 100k LOC).
- https://blog.plaid.com/building-an-inclusive-code-review-cul...
- https://medium.freecodecamp.org/unlearning-toxic-behaviors-i...
The takeaway is that it's a communication problem, and one of the first steps is probably setting some shared expectations. As others have mentioned, if you can't get alignment on expectations, you're not going to be happy in your job, but hopefully there's common ground somewhere, and you can all help each other level up technically and as a team.
Being "strict" in code reviews is not necessarily a good thing. It's great if you're strict with regard to stability and code standards, but it's not at all great when you reject everything because, "hey, this super specific module should be written because MAYBE ONE DAY in 20 years it could be maybe re-used, so you should make it ultra-generic and over complex."
I eventually realized that this problem will be worse overtime as I get smarted, more experienced, and can predict issues even more than I do now. So the best solution I think is to maintain your rigor, don't stoop to the lower quality work that is the norm, and choose your battles in terms of what you call people out on, and do it in an emotionally intelligent way.
As you progress in your career, it's inevitable that more and more of your coworkers will not be performing at your level. Accept it, and use that as an advantage in climbing the ladder and leading teams. That awareness of potential issues and foresight of problems in designing architectures and prioritizing work is very valuable.
Be smart about how you use your competitive advantages, put emotion and frustration aside, and it will have great payoffs.
And as others have mentioned; code reviews shouldnt ever be brutal. You need to look at code reviews as a way to improve your team's performance. It shouldn't be a roast.
Additionally, you may want to take a step back and see if you can implement/point to a style guide. Linters/code formatters might help with this some of the frustration.
If the entire team is newly formed and you truly believe there are a lot of flaws in others' work, then the thing to work on for yourself is that feeling of resent. Why do you feel resentful? Realize at the end of the day you're talking about "work". You're not being personally attacked when others write bad code. Just make suggestions in a friendly and nice way and people will be accepting of it. There is no need to feel resent. A true engineering leader who is currently in your position would take this opportunity to provide guidance for the team and take leadership in improving things, not feeling resentful. If after attempts to improve things, they don't work out, perhaps it's time to find another place of work.
That being said, it's OK to have high standards. I've found myself in similar situations in the past and I discovered it's helpful to look at code reviews as a learning experience for everyone. If you find yourself reviewing truly horrendous code, it's an opportunity for you to develop your patience, teaching, and communication skills.
If you don't - well, be prepared for a bit of a bumpy ride until your group can formulate one. However, it has to be said that getting a formal Coding Rules guideline is easily one of the best things you can do for team cohesion - it takes effort, but at the end of the process it should be quite clear that you don't own the code...
Also, there is a way to provide constructive feedback without attacking the person behind the keyboard or phrasing it as 'you're wrong, make it right'.
The best reviewer on my team takes the time to point out where the 'big picture flaws' are, but phrases it in a way of 'this works, but here's why it won't work later on, and why you should consider fixing it now, just my 2c', rather than 'you're dumb if you think this is acceptable'.
Perhaps that is a symptom that many programmers do not like following guidelines. Which in turn leads to technical anarchy.
If the answer to all of these is no, then what are you concerned about?
Use this as an opportunity to improve your social skills. If you think your colleagues are sloppy, find a way to reach them. Learn how to give in-offensive feedback. That's invaluable for your career, no matter what you do.
Also, the resentment you feel towards others is likely resentment that you feel towards yourself (as you say yourself), so that is another area you have now the chance to use and grow.
“You’re always late” is evaluative. Causes an argument.
“You arrived at 10:30 am, and we agreed to meet at 10.” is descriptive — it lists observable facts.
Take a similar approach to code.
“This is sloppy” will only bring up defenses.
“I’m reading this and notice that the one or two letter variables cause me to have to re-read the method every time to figure out what each does. Maybe we can use more descriptive variable names, like accounts_payable instead of ap?”
And then reframe the situation into some kind of an opportunity for you. You need to figure that out, but maybes it's something like, "chance for you to learn how to mentor/influence others" or something.
Perhaps you have a more anarchical situation, in which case it would help to elect a leader who can maintain the respect of the others and provide firm guidance.
For example, for Rails development overcommit [1] is known to be useful.
Also: If you're the smartest person in the room, find a new room. Leave.
The emotions are "healthy", in that regard. What isn't healthy, is when they are not followed by positive change, most often including my taking action to effect that change.
(Resent them. Hate myself. Sound familiar?)
In this case, it's reading to me like your larger dev environment is substandard if not defective. Not that that's all that unusual, but you're in a position to perceive it and to understand (from and in terms of your perspective and experience) why.
Either that environment needs to change; is there some way you can successfully build such an initiative in your current environment? Not a "rogue" operation, but something that will be endorsed and reflect positively upon you in terms of your standing and security.
Or, you need to change your environment?
Unfortunately, these days and in tech, being "older" is often a significant barrier to the latter.
Anyway, speaking from experience: Don't let the negative emotions, unresolved, end up consuming you -- while their cause goes or go on their merry way, oblivious and skating by on larger life's externalization of longer-term damages.
--
P.S. I reread more closely. Smaller team. You are all "experienced". Maybe their approach reflects different experiences, expectations, even just personalities.
Nonetheless, don't let your negative emotions consume you.
In addition, or as an adjustment to what I said above, make sure you have enough of a life outside of work. Take care of yourself.
It is not your job (heh!) to fix every deficiency (real or perceived) of your co-workers.
Become more of an observer, and observe whether and how their behavior works out -- for them and/or overall.
And start looking for the door you'll eventually use, if it doesn't. Having an out might take off some of the pressure you're feeling, personally.
Best wishes!
And, maybe you'll actually come to perceive a development environment that works while being less "brutal". I'm not taking their side. Just saying, you never know.
I used to be very "strict" about "protecting" myself. Drugs are bad, yadayadayada. I'm still no fan of excess, but I look around me and see that the people who were more relaxed and less worried about such things, seem to have ended up happier and even sometimes more successful in life. Then again, a few of them nose-dived or ended up assholes.
On balance, though, I wish I hadn't been wound so tight, when I was young. I've paid a price for that.
At the same time, I still get quite frustrated by sloppy work that imposes upon co-workers and customers to compensate for its deficiency. Whereas I actually enjoy problem solving and doing things well.
Without knowing the full context I can't say who is right or wrong here. Sometimes sloppy code that focuses on narrow problems is the right solution! In some cases, good can be the enemy of good enough. From a business point of view, code should be just good enough to get people to throw money at you, and no better.
I'll be honest and say that writing the last paragraph left a bad taste in my mouth; it's clearly a bit of an exaggeration, but I put it down to make the point that it is obvious that there is some point at which effort spent working to make the code better is wasted effort, and carries opportunity costs that are detrimental to the goals of the project. Obviously the reverse is true as well.
Absent any other knowledge, I suspect the optimal point is somewhere between what you would like and what your colleagues would like.
For each specific gripe you have that you see happening regularly, consider: is this detrimental to the goals of the project, or is it something that is merely unpleasant for me to deal with. When doing this calculus, remember that short-term progress can be required for long-term survival (e.g. if you go bankrupt before shipping anything, it doesn't matter how good the would have been).
If the list of things that are not harmful to the projects survival but distasteful to you is particularly long, you'll probably want to find a new project to work on.
Finally a template for bringing up these concerns in some sort of team meeting (or with the team-lead if you have one, with a team of 6 you might):
1. I have a concern about [specific pattern X] I've seen in code reviews because it will impact our ability to achieve [project goal Y] due to [reason Z].
2. A solution that worked on my previous team was [solution S].
3. Do you think we could adapt [solution S] to work for this team?
The nice thing about this template is that nothing is labeled as "bad" but rather things are couched in terms of what are (hopefully) common goals. There is no implication that you are superior to others (as long as you aren't patronizing in your delivery). There is plenty of room for them to disagree. The main gate is item #1. If you and them almost always disagree at this point, then this is a bad team fit. If they agree on that point, then even if they hate your solution, you've started a conversation about how to fix the problem, which is probably more important that adopting the specific solution you had in mind.
Oh, how not to use this template (just in case it wasn't obvious):
"I have a concern that everybody except me is writing shitty code. On my previous team we solved this by actually caring about code quality, do you think we could adapt that to our current project?"
Which follows the template but misses the point completely...
I hope whoever felt the need to flag this gets treated better if they're ever in need of help.
Just playing devils advocate here.