I speak Russian and used to read habr.com a lot, which is a Russian-speaking platform where the community members can post on topics related to software engineering, computers, and tech in general. (As you can notice, habr.com have also been trying to gain an English-speaking readers for some time now.)
So I read or saw multiple articles in Russian from this specific author. Actually, the one linked in this post is a translation. To put it bluntly, while they clearly have a background in software engineering, they are a troll. All their articles seem to have one thing in common: they look to be as controversial as possible on purpose, I don't believe them to be sincere.
And I'll give it to the author, the tactic worked great: their articles usually generated a huge discussion in comments and -- I would guess -- a lot of traffic for the site. Though people seem to got immune to it over time.
And there's probably nothing wrong with writing in a provocative style, but you might want to keep it in mind when reading the post and not take it too literally.
> saw multiple articles in Russian from this specific author. Actually, the one linked in this post is a translation. To put it bluntly, while they clearly have a background in software engineering, they are a troll. All their articles seem to have one thing in common: they look to be as controversial as possible on purpose, I don't believe them to be sincere.
Is "don't be an asshole when it's actually not helping the other person like you told yourself if you look closely" actually controversial enough on that site to be considered a troll?
Honestly, the article comes across to me as someone publicly acknowledging their shortcomings in an attempt to combat them. If that's trolling Russian developers that frequent that site... maybe they deserve to be trolled in that way?
The article is actually really useful; it’s a good example of how to not think of code reviews. If you relate to any of the text except for the last three lines, it means you’re reflecting on and running code reviews wrong.
A code review is an opportunity for the reviewer to learn about someone else’s coding style and improve it when necessary, and the reviewee to learn their flaws and just how other people see their code. Because everyone has their own viewpoint with their own flaws. Not an opportunity for the code reviewer to show that he’s smarter, or the reviewee to be “humiliated” that his code isn’t perfect.
I read your comment, and then the article, and honestly, the article makes a lot of good points.
I had precisely one boss who was an asshole code reviewer - and the worst is that by then I was a far better programmer than he was, because he was crazy.
(Random example of many - he personally adopted a "foveal coding style" which meant that he pressed return at the first possible moment after 40 characters. Yes, 40. To achieve that, he had a whole glossary of local variable names, all starting with the same prefix, that you needed to learn to read his code - slea, sleb, slec, sled, slee, slef, etc. "sle" stood for serialized ledger entry, except that none of these were serialized and most weren't ledger entries...)
Even knowing he was an idiot, these abusive code reviews were surprisingly hard on me, particularly since I got forced to do a lot of stupid things with my name on it.
I started to get panic attacks, and they lasted for years.
I made a girl cry once with a code review when I was being purely formal - "this cannot work", that sort of thing. Maybe she was somewhat oversensitive, _but_ she was definitely overwhelmed by her new job, and it was not productive! It was just a mistake on my part.
So I am "brutal" and incredibly detailed in code reviews _but_ I'm also friendly and chatty and explain how I have also made that error in the past, which I certainly have because I have made a huge number of errors!, and tips on how to avoid these issues in the future, as well as some sort of programming language suggestion if appropriate.
People seem to really like it. I get a lot of kind words. It makes it much more fun if you see this as a collaborative game whose idea is to get the highest group scope than a competition.
(Also, it's the rare code review that I don't catch some actual bug in the code that would lead to wrong results, and if you point it out nicely, people really appreciate not having to debug that later.)
> If a guy brings me his code, and it has mistakes, it brings insane pleasure from how smart I feel [...] And if you tell me that you haven’t had this feeling ever, then you’re lying. Tell me about higher goals, training rookies and all that — I know you’re simply too full of themselves. And if you try to tell me that you learned to defeat that feeling (however it manifests in you), then I must be a pink unicorn.
I really can't relate at all. I feel the opposite. I often feel angry (I realize this is not a GOOD response either!) and always feel sad. I don't want to have to do more work. I don't want a reminder that my previous feedback didn't click with them.
I'm constantly looking for ways to do less tedious work, through automation and such, and code review for bad code is the worst sort of tedious work. I want to learn things, but code reviewing bad code doesn't teach me anything - I want to work with people who can teach me things when they review my code just as often as the reverse.
My takeaway from that has been to try to intercept people earlier in the planning and designing and start-of-coding process. If a bunch of bad code gets to code review, someone failed at explaining what this thing needed to do and how it should be done beforehand. The article claims this is always just itself a confrontational form of argument, but... it doesn't have to be. Stop being an asshole, and find non-assholes to work with.
I have worked with people like the author. They suck. They destroy entire teams and often times the feedback is 99% pedantic personal preferences because why would they do something useful like setup the linter and propose the silly things they always nit pick.
These people don’t last long and I have gotten pretty good at screening out this personality in interviews after having it cause huge issues at two different places I worked.
It is possible that the person is accidentally projecting their internal state as a model of how other people feel when they do code review. It's easy to accidentally fall into that trap. I've probably made that mistake before.
The truth is that people's emotions can be a lot more different from yours than people may be willing to imagine.
No one is perfect. But not everyone derives 'insane pleasure' from criticizing, either. And if you do, that may not be obvious.
I agree with the 'stop being an asshole' line, but to do that we need to help people realize when their qualia is way out of the ordinary. If you think everyone else is power-tripping, too, then will you think you're really being an asshole, or are you just doing what everyone else does?
It's scary to think that you might have something else you think everyone else does, but is really just you accidentally being oblivious. Speaking for myself, I'm going to try to be more mindful of this trap in the future.
>Stop being an asshole, and find non-assholes to work with.
I think the process of realizing he needs to do that and doing it is what he's describing in his article. Generally people don't open up about how their behavior is toxic unless they recognize it as a problem. And, though my experience with Russian culture is limited, I understand that competitiveness and criticism is the rule, at least in the STEM fields there. So this guy has been behaving the same way (most) everyone else does, but now he's realizing it's bad and trying to fix himself. I don't think he deserves the criticism he's getting in the comments here. We all start somewhere, and trying to improve should always be encouraged.
Yeah, I was afraid I'd see myself in this post, because I'm known for giving tough reviews. But I don't. I feel terrible whenever I give a tough review. I agonize about how to say the difficult things that need to be said but do it in a way that won't sting as much, and I know that often, it's going to sting anyway. I feel like I failed for not helping the other developer know how to do things better in the first place. I'm still figuring out how to make my process more constructive, but I've got a long way to go.
Same here. For me, code review is a good time to share knowledge and help other people. If a problem often comes up, I usually try to see if a tool can solve this. I'll admit that it can be really hard to know what level of tolerence people have for nitpicks and things like that, and at which point you're starting to sacrifice team spirit/people's feeling for small things.
Same, I've never felt anything like this. I find code review tedious and the only thing I really care about is if their code is properly tested or not.
I concur. I'm not a coder but I do review things every 2 months as part of the release cycle, and whenever I see mistakes, especially silly mistakes, I don't feel smart at all, it doesn't even cross my mind.
I feel, in order: disappointment - because how could they make this stupid mistake, then anger - why the f do I have to waste time to correct stupid mistakes, then a bit hateful - we need to fire this person and hire someone competent, then sometimes a bit scared - what else has this person got wrong and I missed, then a mix of all of the above.
What would make me feel good, as far as reviews go, would be to say "hey, this person did this way better than I would have".
> I want to learn things, but code reviewing bad code doesn't teach me anything - I want to work with people who can teach me things when they review my code just as often as the reverse.
I mean maybe you're working on extremely repetitive code, but the idea that you don't learn anything from reviewing bad code, and hopefully writing comments designed to help not humiliate, seems pretty bad to me also...
You want to learn from others who review your code, but become angry when you have to teach those whose code you review? That seems bad...
Sometimes I’ll look over PRs early on, notice the entire approach is bad, and leave a comment.
People often got annoyed, they would say their PR isn’t ready yet.
That’s fair, I kind of understand, my intention was to just save them time going down an incorrect path though, because I know it’s going to be difficult to convince them later they need to rework days of work.
The other thing to keep in mind is that most code is fine.
When one company buys another the quality of the code is a calculation in the sales price. But it's a small one, and it takes a real dumpster fire to move that needle.
> I'm constantly looking for ways to do less tedious work, through automation and such, and code review for bad code is the worst sort of tedious work.
What kind of automation or tools are you using for code review?
Nothing makes working at a place more unbearable than having to deal with someone that gives an excessive amount of criticism on working code, at least that's how I feel. I've been in that situation before and it made me never want to submit pull requests. It made me even madder when other developers, whose code was no better than mine but had been at the company longer, received basically no critiques.
Some might say, oh it's hazing, well fuck you because I'm quitting. I'm not putting up with any amount of hazing at a job. If I have to spend 8 hours everyday somewhere I'm for sure not going to spend it with some asshole.
Not only that, but the title of the post is, "I ruin developers’ lives with my code reviews and I'm sorry".
This person is so confident in himself, that he thinks his code review takedowns are so brutal, yet effective, that he is ruining lives. It almost comes off as "I'm so handsome that I ruin people's lives with my looks and I'm sorry."
And then there is this...
"I was mad that, while I spent my nights learning F#, my daughter started calling everyone around “fathers”. And this guy, instead of getting better at his job, went home to his children. And I wanted to punish him."
I got annoyed by people leaving "philosophical" or "style" type comments in code reviews - i.e. nothing related to functionality or performance but just different ideas about how things could be written without obvious advantages. Then I realized I could just write something like "Thanks for the feedback. I've addressed the points that I feel are critical, the remaining comments can be addressed in future if necessary". Then I'd just ignore the worthless comments.
My mental model is that some people feel like they must comment on a code review to show that they've done something. They don't actually care, but just want to write a comment or two and you can shrug those off.
If following this approach you do need to be careful to only ignore genuinely useless comments though. Often a good way to tell is just to chat with the reviewer. That has the added benefit of the reviewer learning that useless comments will create more for them because you'll be by to chat about their useless comments.
Conversely, nothing makes working at a place more unbearable for me than working with people that over-engineer everything. These are the types of PRs that tend to get the most feedback, and also the type of person that complains most when receiving this feedback.
I've had the same thing the other way, where I feel that I usually give kind and fair code reviews (no nitpicking, etc) but have had former colleagues that get genuinely upset and push back really hard when I make any sort of comment on their PR.
Because it creates technical debt, that's why people get frustrated with shit code. They just aren't properly equipped how to convey/teach/train/fix it without coming across like an asshole.
Congrats to the author for realizing that confidence doesn't equate skill. This isn't being a pink unicorn, it's simply humility.
The real danger of confusing the two is that real skill dulls if you let overconfidence take over, since the very thought of being "better than others" prevents you from accepting that maybe there are things that you don't know or haven't considered.
For example, is "destroying" a coworker's commit in a code review really really helping? Did the person perhaps forget to consider that hiring to refill the position of a fired developer actually costs physical money (as opposed to time spent on coaching?) or that perhaps a lot of time is being spent on nitpicks without bottom-line value or that tip-toeing around egomaniacs can stunt autonomy and therefore creativity? This is not merely a matter of whether you're lulling yourself into some false sense of superiority/duty/whatever; thinking in terms of bigger and bigger pictures is an actual skill that one needs to develop when going up the career ladder.
Humility goes a long way in life. Anecdotally, it's definitely something a lot of software developers and systems engineers should learn how to practice.
If you want some empathy with the guy whose code you are reviewing, go pull up some of your own code from a few months or a year ago. Do a mock code review on it.
Maybe everyone else only writes good code, but this works for me every time. Even after over 30 years coding, I still have no problem seeing how imperfect the code is that I wrote as recently as last year.
And don't ever make it personal, anyway. Adopt a neutral tone, phrase comments abstractly as how they relate to team goals, how the code might be made clearer, etc. Don't accuse, don't belittle, don't try to look smarter than you are. And try to recognize the difference between the stuff that actually matters, the things which will actually be a headache down the road, and the pointless details that are just not how you'd have chosen to code something.
There are a few types of comments on code review that I see:
1. Critical mistakes
2. Style guide mistakes
3. Non-optimal design (in your opinion)
#1 Always receives a comment, obviously.
#2 Always receives a comment, but we have good automation here so it's not too much of a worry.
#3 Is where it gets interesting. A lot of the time, commenting about this category is prematurely optimizing and it's a waste of time for both the reviewer and the owner of the change. At most I try to make one overarching comment about the design.
You really have to ask yourself "Does it work? Will it cause issues down the line?" If the answers are Yes and No respectively, you should likely let it go.
The feeling of ownership over the design, especially for a junior engineer, is incredibly important for moral and the ability to get better over time. IMO it's also important to let them make small mistakes now and again so they can learn from it.
With number 3 I usually leave a comment but it's something along the lines of "Why did you decide to do x instead of y. I think y would be better because..."
I don't necessarily want or expect them to change their code but I want to make sure they're considering multiple options and intentionally choosing that path instead of just copy and pasting something from stack overflow (as an example.)
Ouch. I’ve had a few cases of developers on the verge of being fired because of bad code causing friction with the team.
Code reviews never help in those cases. There is always an underlying cause: the developer is trying to rush to prove something, or maybe over-engineering for the same reason. Maybe he has some issues at home, or isn’t sleeping well. Maybe it’s just lack of experience. Maybe it is a personality issue and the developer is trying to save face by sticking to his guns.
Either way, I find that it is much better to have private discussions with the developer to increase the code quality via mentoring, or pairing. It helps removing the defensiveness, doesn’t make them feel publicly humiliated and doesn’t spend the time of the team with the review-fix cycle.
I'm not a super-coder; give me a JS project of moderate complexity and I'd have no idea what's going on or what I'm supposed to do with it. But as a data scientist I do have the reputation of being good at coding even among some of the engineers at my company.
And some of the code produced by both data scientists and engineers ... it's, hm, not great? Just between you and me? So I'm glad I've never had the inclination to tear anyone to shreds. Indeed, part of my job used to be to help people with their coding problems, and I loved doing that.
But sometimes when I'm reviewing code ... it's very hard to bite my lip and not call out every little issue, even though it would just be too much and most of the "problems" aren't actually very important. I try to impress upon people that developing good code is useful when I lead training sessions, but it's hard, especially for people who'd rather be doing data science than coding.
I'd like to point out that every one of the "correct" examples is longer, sometimes much longer, that the "wrong" example preceding it.
I've found that I usually start with the "correct" way and end up regressing to the "wrong" way as more and more work piles up, stress builds and deadlines approach. I guess the "correct" way only works if the organization actually prioritizes it and gives reviewers the time to do it the "correct" way no matter what stage the project is in.
I had an incident many years ago where I found glaring design flaws in a much more senior developer's code, and, overcome with some feeling of superiority, left a million nitpicky comments and a snide summary, then posted on our team chat "left a review". Finally, I was getting back at all the senior developers who had torn apart my code.
I later realized my comments were mean and I apologized. While you could still potentially call it constructive criticism, there is a difference between mean criticism and polite criticism.
I do think thorough feedback is important, that's how I've learned the most after all. But typically now if I I'm going to write more than 5 comments, I meet with the other developer in person instead. That way the code problems are solved faster and it avoids any sort of public humiliation.
Funny. I'd say that if somebody can't work with or maintain code written by others then that's the sign of a weak programmer. If all code you work with has to be written exactly as if you wrote it yourself then that's a weakness.
> I was, again, technically stronger. A thousand-string pull request was littered with 200 comments, not leaving the person even a faint hope in his competency. Great.
That's way too much feedback. It makes it very hard determine which problems are critical, and which come down to aesthetics or personal preference. On the flip side, if I was churning out buggy code at that rate, I'd want to know about those bugs in detail.
There's also an opportunity cost of evaluating code so tightly. Not only does it take up more of the reviewer's time, it also eats up developer time that could be spent on other features.
> The reason for these angry code reviews is obvious. As part of the team, I bear full responsibility for the project’s code base. I have to work with it later, after all. It’s a source of many issues for the business. The code doesn’t scale, can’t be tested properly, is littered with bugs. Support gets more and more expensive. It can’t be open-sourced or used to lure new developers.
Premature optimization? The mistake here is trying to optimize the legacy of your code base, possibly thinking too far ahead.
Everyone is capable of writing crap code ... Code that might give the impression of working but is unmaintainable.
PRs are conversations. Every team member should be able to request changes to start a conversation. A conversation about the code should focus on what tradeoffs are necessary to get stuff done now along with a consideration of how comfortable every team members feels they can maintain the code.
Teams where PR approvals are considered endorsements, where PRs are rubber stamped, where developers throw fits when others dare to ask questions etc are detrimental to both getting things done and maintaining a sane working environment.
Don't confuse the code with your worth. The greatest asset you will ever have is the ability to be openly critical about code you have written while understanding the right level of imperfection for a given circumstance. This only comes with experience. The more you nurture your ability to view your own code critically, the faster it comes.
Since we all have blind spots, take others' questions seriously.
I had an experience in my first year of grad school that has informed my code reviews and my general attitude toward reviewing others' work ever since.
I was taking a graduate-level introduction to mathematical logic. In the class we learned about a bunch of different propositional axiomatic proof systems, and then we proved properties like soundness and completeness for them. The class was organized around class participation: everyone was required to do at least one proof at the board in front of the class and every session consisted almost entirely of students doing proofs at the board.
I'd been out of school, working, for eight years before grad school and I found this all very intense and unfamiliar. I did my required work at the board, choosing an easy problem, but otherwise mostly sat in the back and watched. There was, however, a cohort of very intense aspiring logicians who sat in the front row and took deep interest in every proof.
One day, a student went up with a particularly challenging problem. From the start it was clear that he was taking an unorthodox approach to the proof. The front row went nuts, interjecting and kibitzing on practically every line, telling the guy different things that he should do instead of whatever it was that he was doing. The guy was a good sport and tried to justify everything and answer all the criticism, but it seemed like he might not get through the proof before the class ended.
The prof who had been watching quietly from the side of the class, let it go on for a while, then stepped out and quieted everyone.
"I need you to remember," he said to the front row, "that we are the audience. It is not our job to prove this theorem; it is this gentleman's job. Our job as the audience is to listen to him, and at the end, decide if we are convinced. He may do things differently that you would have done, but that doesn't matter, as long as in the end we are convinced."
That was twenty-three years ago, but it stuck with me. In programming, there are often many different ways that a problem could be solved, but there is almost never One True Way™, even though there are often many voices that would like to convince you that their way is the right one. My job as a reviewer of code, or really anything, is not to try to get the other person to do what I would have done, but to decide if I'm convinced that the way that they've chosen is good enough, and, if not, to ask for changes that would convince me.
Sure, sometimes a PR is so bad that it needs to be completely rewritten, but in my experience that's rare, and in that case the feedback should probably be given in person and in private or in a friendly, sympathetic group.
i have been on an ever onward journey to try to find the balance:
- is a developer making the same set of mistakes? send them information on a better strategy to try overall
- how bad is this mistake? Is it just something that I know how to do better, or legitimately a broken way of thinking?
- what is worse, a slightly inefficient or unpretty algorithm, OR someone researching the problem / solution
Point is, 90% of my comments were meaningless. I really comment when things look wrong -- Did they misunderstand the intent of the ticket, did they verify everything with product because this looks weird, did they check the edge cases, did they forget about this other behavior, etc. All that I just mentioned is the real meat-and-potatoes. Code-fu is important, but less important than the other stuff. And if you are a calm, trusted, and mentoring team member, those same people will come to you to up their code-fu voluntarily.
Having an auto-formatter like Prettier or `go fmt` has been a huge boon and productivity gain for the teams that I've worked with. No longer having code nitpicks on formatting has saved so much time going through reviews, and it really increases the signal to noise ratio on pull request comments too.
Would definitely recommend those for any teams that have a similar teammate as the article author on their team.
Yeah, we mostly do Python and I've really been trying to push the use of black. I don't actually like some of black's formatting choices (OK, it's grown on me) but it's better to have a standard and stick to it.
This is why I now use tools like SonarQube (commercial static code analyzer) to drive most code quality reviews. SonarQube also gives justifications for all of it's recommendations, so it serves as a training tool as well.
The only I things I manually look for in reviews are overall readability, sensible naming, high level adherence to the architecture/design, and data system/database/API queries.
After 20 years of writing code and leading teams, I've found that most of the stuff developer blogs and the OOP community fret over simply doesn't matter in most cases. The high level interfaces are often more important than the low levels details, and static code analyzers do a decent job of pointing to problems. I've almost never seen bad code that didn't also have many issues in the static analyzer.
It also matters what kind of code you are writing - foundation code or something that will be used by thousands/millions of developers should have a higher bar than some internal one off. However, I've seen enough very profitable companies running on total crap code to believe that code quality is the most important thing.
I had a completely different response to this article then all of the other commenters. Yes, he is a smug, insufferable asshole who takes pleasure in putting his colleagues down. On the other hand, he is publicly acknowledging his poor behavior and apologizing for it. I thought this was a raw, vulnerable thing to write - he says that his poor behavior arises from a need to feel superior. We've all met people like that - but how many would publicly acknowledge and try to do better? A lot of posters are tearing into this guy for his confession. I suggest that we instead thank him for sharing and encourage him to do better in the future.
His post reminds me a bit of this religious group, Filhos da Mente de Cristo, that appears in Orson Scott Card's novel Speaker for the Dead. All members of this group take names that reflect their resolve to overcome their greatest flaw, for example: "I will put others before myself" or "I will listen carefully before speaking", etc.
In my opinion, when doing a code review over a weaker developer, as the stronger developer you should show your strength by making commits to help them improve their pull request, instead of passing back-and-forth a bunch of passive-aggressive comments. If you are reviewing someones work and you go back and forth more than a couple times, you should step in and pro-actively help resolve. Together as a team you draw the conclusion. NOT working as a team is a aspect of a Narcissist.
Definitely not; but, I would recommend, in the comment, to share alternative code and sample usage that they can take advantage of and apply themselves to their own code.
If you overwrite all their code, what have they learned?
> The universe blessed me with this trait so I can awaken the anger in other young and inexperienced coders
An important skill to develop is the ability to "read the audience". Almost prescient in nature, predicting how people will react to you is of utmost importance so that you can tailor your responses accordingly.
This is important when mentoring people because, even though tough love might work on some, it may very well destroy self esteem for others and make them shift career, ending something before it even starts.
If you are in a position of mentoring, it is your responsibility to adapt. It is painful, frustrating and a source of contempt when you try and try but you just can't seem to find the sweet spot to inspire newcomers, but as long as you persevere there is hope in teaching others.
I had a recent experience in this. I am in no way a long experienced infrastructure engineer, but I built my share of cloud applications to have an idea what can go wrong. I recently tried mentoring someone new and it was just plain frustrating. I couldn't explain too much without overwhelming him with details, and I couldn't just direct to sources without him feeling abandoned. That sweet spot of attention I couldn't reach before he requested to "learn different things" and effectively abandon infrastructure haunts me sometimes.
I had this once with a co-worker, who was also a technical lead. I don't mind critical code reviews, I do want them. I can spare my own feelings if I didn't do something right. But, if that person comes off as someone who cannot relate to anyone, the code review goes into a different direction.
Many times, I felt like I had to write code to get through the co-worker's code review, not for the requirement. The requirements to get pass that code review felt inconsistent and vague, so it made work very stressful. Having a conversation with him was a chore as well, as he came off to be very critical even when prepared with questions.
When he left the company, I was not the only one who felt a weight lifted off all of us. No one wanted to put up with that.
Code reviews and other analyses should be topics of open conversation, if anything. They should work both ways and help each other about not only needs but skill development. When it is used as a tool to boost someone's ego instead, it becomes counter-productive and many years later, I sometimes have that in the back of the head, even with those who I know can be attentive towards criticism in code reviews but are otherwise good people.
This except there is no right way and there are 'n' equally good ways of solving any real world problem. It's only worth pointing out flaws if something is genuinely bad and I mean bad. Otherwise you are using a gut opinion to trash someone else's emotional health.
Yay! you found an edge case that breaks a piece of code that will never get hit while the other million and 1 edge cases that haven't been found are still out there. Yet you drag it out from the dark and show it off for all to see like some damn trophy. Yay! look I am great I found one more thing wrong than the other guy. No matter that we are all swimming in a sea of wrong and every one is completely clueless. Only slightly less clueless than those who don't even realise they don't have a clue.
It follows from a simple argument - every programmer and every company has a different view of 'good'. I've seen it, I've worked in many. Just as every religion cannot be right, every weird view on correct programming style cannot be correct.
A team I was on years back had developers like this. My role there was as an infra dev where the main project was to install security daemons on a bunch of hosts. The devs who worked on the project for two years basically made an unusable piece of junk, with infrastructure written in four different languages. In my role I was expected to use what they built, but it never worked, though the opinionated devs didn't believe in storing logs, calling it an "ephemeral" system and we could never know why the damn thing didn't work. So we had to ssh into hosts and install the daemons by hand.
At one point we had a major issue with a client, because our daemons weren't installed on their hosts right before a major event of theirs, and none of the tooling could install on this clients' hosts. So I threw something together over an afternoon that could do it all by frankensteining the other devs' code. It was run-once code to fix the emergency. Lots of selenium garbage.
Since it was one-off, hacky code, I didn't feel it was necessary to put it into git, so I didn't.. until others complained to management and forced me to. From there, I had about four devs dog pile my code, commenting on everything wrong with it - maybe 20-30 comments. I explained that it was one-off code meant to solve a specific problem and of course it was going to be messy, but I got responses like "if your code was made public, you'd want your code to be clean so you can be proud of it!". It was infuriating, considering their system worked maybe 5% of the time.
I'd like to say it was in good-faith, but I really doubt it. At one point while I was there, one of the devs rejected a PR because I had bash in an Ansible role, saying "you don't know if the remote host will have bash installed."
That whole ordeal was enough to leave the company.
I always look at code reviews or just reading / talking about each other's code as a way for us to just get on the same page about how we do things. Make everyone's life easier. "Hey man when we're looping through that thing here is how we usually do it." "Ok cool, I'll do that." Or maybe we have a discussion on why I did it differently this time and how we might address that.
Much of the time I don't "care" or feel strongly what the change or answer is. If we're all doing the same thing / spot a bug sooner, it's just easier for everyone.
But it seems code reviews to some are this sort of battle / proving ground / have a lot of elements of status. I don't get that...
> And finally, I became the exact thing I hated: a toxic asshat throwing his skills around like fists. I don’t do code review for the business, I just like showing the rookies their place. My skills have finally started to pay off.
Or he's just lazy.
It's way harder to build up the people you work with than tear them down. The key ingredients tp the former are patience and empathy. And those qualities are lacking in many managers.
Also, aggressive, opinionated people are often perceived as more intelligent than their more reserved peers. You'd think that the snowmen can't get snowed, but the type of person the author describes seems to be just as vulnerable to the misdirection as others.
In my estimation, most places have the opposite problem: everybody approves the code without looking through it, and the only comments that are left are stylistic problems.
Good code reviews spot real bugs and provide solutions and explanations that help the owner to improve their branch. It's completely constructive and feels like going out of your way to way to help them and paying attention to what is meaningful -- the vibe should be a bit like "doorman at a posh hotel providing excellent service", so not disrespectful at all. Also, if you're nitpicking, it's a sign of lack of focus...
Devs often have insufficient time for the standard of perfection code reviews assume: perfect code, formatting, testing, experience, foresight, etc.
Code reviews also have a strong element of bullying, hazing, and people reenacting semi-trauma (that is the cycle of abuse so common in life: trauma makes you lonely, enacting that trauma on others in kind makes you feel less lonely)
I used to joke that in lots of enterprises, it isn't faster, cheaper better pick two, it's actually faster, cheaper, better, follow process, document. Pick about 1 1/2.
PRs definitely bring out the worst in some people ... would head for the exit with a vibe anywhere near like this on the team. sad to me that young devs have to go through this.
> If a guy brings me his code, and it has mistakes, it brings insane pleasure from how smart I feel. [...] And if you tell me that you haven't had this feeling ever, then you're lying. Tell me about higher goals, training rookies and all that - I know you're simply too full of themselves. And if you try to tell me that you learned to defeat that feeling (however it manifests in you), then I must be a pink unicorn.
Is ths really the norm though? If this really happened to you, by all mean voice your story, but it's not fair to make up story just to get a point across, as they could unrealistically pain the software developer community a bunch of a-holes. In reality, most people I worked with are sympathetic as code review is one of the first skills we learn working professionally.
If you're giving soul-crushing feedback and not enjoying it like the OP, one problem could be that perhaps you're not providing the developer with enough detail on the task at hand. Communication isn't easy.
I have been mentoring junior developers for about 10 years, and some more senior ones for the last few years. My ego is more attuned to getting things done than tearing up people's work. The following works really well for me:
1. Never insult people's work, it's counter-productive. (Unless see number 9)
2. Nitpick on convention/style, not implementation, unless the implementation is infeasible. Convention and style will quickly become rote. This forces new developers to pay more attention.
3. If it works as intended and has meaningful tests, MERGE IT. Congratulate them :rocket:!
4. Point out logical pitfalls/caveats by asking "what would happen if". Asking questions starting with "why" triggers people and puts them on the defensive. That's your EQ lesson for today.
5. Through code-review, you can identify a lot of little problems and suggest articles to read that would help the person grow. Examples: misunderstanding async/await vs. thenable in JS. Parallel programming in R/Py. These are distinct, language specific (R has sessions/multicore, Py has the GIL) pieces of knowledge that people can learn easily with a tiny bit of guidance.
5. If you're a better programmer - write the first 1000 lines so that they can fill in the next 10,000 (credit: don't remember, someone tell me?)
6. Even junior developers can get a surprisingly challenging task done if you give them hints (point form) about how you might approach it.
7. Do code reviews in-person (1-1) or if you are tactful with your feedback and have encouraged an environment where making mistakes is acceptable - in a group, that way everyone learns! This is the management version of the DRY principle.
8. One of the biggest problems I see with new developers is "how do I break this problem into smaller pieces". Discuss potential approaches BEFORE the PR. Not after.
9. Fire people that are consistently lazy. When you manage people for a long time it easy to see the difference between someone that needs training and someone that is lazy. You can help a someone that wants to learn, but you can't motivate someone to be interested in something that they aren't already.
10. Cultural differences can make people less likely to speak up when they are stuck - check in with your team!
sounds like the folks that quit didn't have their lives ruined by his attitude and outlook, rather they had their lives improved by being allowed to move away from such toxicity.
ego is one heck of a thing. this guy sounds terribly painful to work with.
i also agree with another commenter, if tearing people down gives you pleasure, you might be wise to seek counseling.
> And if you tell me that you haven’t had this feeling ever, then you’re lying. Tell me about higher goals, training rookies and all that — I know you’re simply too full of themselves. And if you try to tell me that you learned to defeat that feeling (however it manifests in you), then I must be a pink unicorn.
That line also annoyed me. I think this person has a lot more self reflection to do about their insecurities. I am glad he has begun to recognize there are some issues and I hope he is able to continue to improve himself.
People like this are so toxic that companies must eject them. They have no real added value, they merely harass those that should be helped to grow and learn as they evolve in their positions. Software engineering teams need collaborating peers and mentors not bullies.
90% of a code review is not about finding THE BUG in the PR but asking questions and making the author find his own bugs or learning something from him.
If you are performing a code review hunting for bugs you already lost your humility and think you are better then the PR author.
Have you ever written some text, and re-read it, and it sounded just right, and had someone else read it, and they said "what does this mean"? Sometimes the words you write are sufficient to trigger in your own head the thoughts you've already had, but not enough to make someone else think those same thoughts.
Code can be like that, too. You write code, and it's enough to convince you that it does what you think it does. But someone else reading it can sometimes see the holes that you don't see.
Assuming that person X writes bug-free code is bad, whether X is "you", "me", or "that co-worker".
I don't have to be better than the PR author. I just have to be decently good, and be a different person. That's enough.
And of course I'm looking for bugs. That's the absolute first thing to look for!
Now, true, if I can help the author be able to see their own bugs (asking questions, maybe), then that's probably better than me just lecturing them. Teach them how to think so that they can see it themselves next time.
The answer is strong contracts based development. This way, they have the responsibility to make it work behind the public API. If it is garbage, that is their problem. If it needs to be replaced, you have someplace to start with.
Buddy, don’t blame the yhe industry for your argumentative nature. Blame your dad. And unless the company pays you for every line of code you comment, you’re better off spending more time with your kid.
You can be a good Developer AND a nice human being. The choice is not either or. That is the goal one should strive for, not to decide between shooting down a PR or checking-in bad code into the repo.
tried to use bitrix like 6 years ago or so and it was hell, they said absent documentation should be looked for on their forum, and yes it was there, but so much hate even from topic starters, got out 1 month later and it was never too early. im russian myself, i will never work with russian dev products ever.
Sometimes when I read these things, I wonder if I've just gotten really lucky and selected positions at places with well-adjusted, mature, talented software developers? This is in no way representative of any of my experiences both giving and receiving code reviews. I've experienced them in a variety of "ways" -- senior's reviewing mid/juniors "by policy", dedicated teams reviewing certain types of code for certain purposes[0], "randomly distributed" reviews among people of similar skill levels, two-person I review you, you review me always and on and on.
I have been doing this work for far longer than I care to admit. My rejections/non-approvals (both received and provided) land in one of the following categories: (a) Did you notice that? (Oops, D'Oh!), (b) Did you know about that? (Educational), (c) Did you think about that? (Edge Cases), and (d) Why? I work with these men and women day-to-day, so we don't often need to butter up negative responses, we have established that "I trust you can do your job" and my comments do not imply otherwise.
The best way I've heard it said is "We do code reviews because errors in software development are common, regardless of proficiency. I don't write perfect code and having a second set of eyes on my work will only make it better/me look better. Reading a growing code-base by reviewing each other's work benefits everyone."
Of the ways those land, the (b) category is the one that requires a little care (if your goal isn't just to bully/shit on someone's gap in knowledge). I find the way to take the sting out of it is to start off with "Hey, I came across an approach to solving this using (whatever); have you done anything with that? It would be an improvement ... (comment goes on)". I didn't say I came across that approach 15 years ago, that it's what I have decided is "Kindergarten in C# School". Guess what? Someone's read my code and thought the exact same thing. I know this because I've thought them about code I've written as early as 6 months prior. Of course, it's a matter of perspective. I thought that over the one thing I saw that made my toes curl up, never mind that the rest of it was perfectly fine, just like the code I'm currently reviewing.
My favorite, though, is the occasional class/implementation that lands in "Why?". Usually those look like the previous -- a WTF-worthy implementation that the only comment I can send with is "Why was this particular implementation used?" -- and often it requires refactoring ... but every once in a while there's that gem. Some edge case that was cleverly discovered, covered and the developer was left with "This is, literally, the only way that this can be done (given the constraints)." It's the code that's both frighteningly ugly/really cool once you realize why it had to be that way.
[0] I was one of two (but really, one of one) doing the entirety of secure code review for a large multi-national telecom for one brief, terrifying, point.
There's something to be said for "Marine Drill Instructor" responses.
When the DI is screaming profanities at recruits, [s]he is preemptively saving their lives. The manner in which it is done, is actually a component of the training. A significant part of military training, is to deprecate the individual, in favor of the team. The DI is not an individual. They are the sharp end of the elite organization that the recruit hopes to join. The variable is the recruit. The organization is a hardcoded constant.
But most of the world is not in the military.
I understand Linus' expletive-laden rants. I don't like them, and I think he could probably find other ways to enforce Quality, but he does get results. The same for Steve Jobs, and his infamous diatribes. When I worked for a Japanese company, I watched managers literally bring employees to tears, with simple, quiet comments. I worked for a British company, and got experience with the sarcasm-fueled way that British managers work.
As a manager, I worked with firm kindness. I made it clear what was expected as an end result, and did my best to support my employees. It seemed to work for my team, but I also had a particular type of team. My style probably would not have worked in other contexts. I feel that I projected a gestalt, as opposed to a set of individual orders. We acted as a unit; which wasn't easy, as I also worked to preserve the individuality of the members.
As a coder, I am fairly obsessive about Quality. Code quality, documentation quality, design quality, process quality, schedule quality, and end-result quality.
I'm very hard on myself. I set a high bar, and usually meet it.
I've learned not to project it onto others; if at all possible. I understand that my level of Quality is probably not something most companies would consider "cost-effective."
Here's an example: I am writing an app with a screen that displays a big map, and has overlaid views and controls. I spent at least 45 minutes, today, ensuring that one of the controls aligns pixel-perfect with its "alter ego" in the "unfurled" HUD display. It was a pain. I had to set a measurement point in the simulator, run the animation, then review the open display, and make sure they matched. Then, I had to rotate the device, and do the same.
Many, many developers would say "5 or six pixels off; good enough. It's all under a fat finger, anyway." I am not right in the head, though. That kind of thing actually makes me physically uncomfortable. For me, that needs to be 0 pixels; even if it is under a fingertip.
So I will do it for my work. If I find that I can't use the work of others, I won't work with them. I'm very, very picky about dependencies. Fancy Web sites and eye-candy aren't particularly indicative of decent work. Sadly, large user communities no longer seem to be a mark of quality, either. I can't take anyone at their word. I have to test for myself. I have been fortunate to find teams of like-minded folks, but they are rare.
But I won't tear people apart, and I won't lob public insults. I feel that is not helpful. If the only way that I can feel good about myself, is to tear down others, I need to do some work on myself; maybe with a psychotherapist.
When the DI is screaming profanities at recruits, [s]he is preemptively saving their lives. The manner in which it is done, is actually a component of the training.
This is true but it's not simply because it breaks down individual identity and makes the team more important than personal ego. If you can't stand unflinchingly in the face of yelling and cussing, you can't stand unflinchingly in the face of live fire and people trying to kill you.
myk9001|4 years ago
So I read or saw multiple articles in Russian from this specific author. Actually, the one linked in this post is a translation. To put it bluntly, while they clearly have a background in software engineering, they are a troll. All their articles seem to have one thing in common: they look to be as controversial as possible on purpose, I don't believe them to be sincere.
And I'll give it to the author, the tactic worked great: their articles usually generated a huge discussion in comments and -- I would guess -- a lot of traffic for the site. Though people seem to got immune to it over time.
And there's probably nothing wrong with writing in a provocative style, but you might want to keep it in mind when reading the post and not take it too literally.
kbenson|4 years ago
Is "don't be an asshole when it's actually not helping the other person like you told yourself if you look closely" actually controversial enough on that site to be considered a troll?
Honestly, the article comes across to me as someone publicly acknowledging their shortcomings in an attempt to combat them. If that's trolling Russian developers that frequent that site... maybe they deserve to be trolled in that way?
armchairhacker|4 years ago
A code review is an opportunity for the reviewer to learn about someone else’s coding style and improve it when necessary, and the reviewee to learn their flaws and just how other people see their code. Because everyone has their own viewpoint with their own flaws. Not an opportunity for the code reviewer to show that he’s smarter, or the reviewee to be “humiliated” that his code isn’t perfect.
TomSwirly|4 years ago
I had precisely one boss who was an asshole code reviewer - and the worst is that by then I was a far better programmer than he was, because he was crazy.
(Random example of many - he personally adopted a "foveal coding style" which meant that he pressed return at the first possible moment after 40 characters. Yes, 40. To achieve that, he had a whole glossary of local variable names, all starting with the same prefix, that you needed to learn to read his code - slea, sleb, slec, sled, slee, slef, etc. "sle" stood for serialized ledger entry, except that none of these were serialized and most weren't ledger entries...)
Even knowing he was an idiot, these abusive code reviews were surprisingly hard on me, particularly since I got forced to do a lot of stupid things with my name on it.
I started to get panic attacks, and they lasted for years.
I made a girl cry once with a code review when I was being purely formal - "this cannot work", that sort of thing. Maybe she was somewhat oversensitive, _but_ she was definitely overwhelmed by her new job, and it was not productive! It was just a mistake on my part.
So I am "brutal" and incredibly detailed in code reviews _but_ I'm also friendly and chatty and explain how I have also made that error in the past, which I certainly have because I have made a huge number of errors!, and tips on how to avoid these issues in the future, as well as some sort of programming language suggestion if appropriate.
People seem to really like it. I get a lot of kind words. It makes it much more fun if you see this as a collaborative game whose idea is to get the highest group scope than a competition.
(Also, it's the rare code review that I don't catch some actual bug in the code that would lead to wrong results, and if you point it out nicely, people really appreciate not having to debug that later.)
unknown|4 years ago
[deleted]
cxr|4 years ago
fgland102|4 years ago
[deleted]
majormajor|4 years ago
I really can't relate at all. I feel the opposite. I often feel angry (I realize this is not a GOOD response either!) and always feel sad. I don't want to have to do more work. I don't want a reminder that my previous feedback didn't click with them.
I'm constantly looking for ways to do less tedious work, through automation and such, and code review for bad code is the worst sort of tedious work. I want to learn things, but code reviewing bad code doesn't teach me anything - I want to work with people who can teach me things when they review my code just as often as the reverse.
My takeaway from that has been to try to intercept people earlier in the planning and designing and start-of-coding process. If a bunch of bad code gets to code review, someone failed at explaining what this thing needed to do and how it should be done beforehand. The article claims this is always just itself a confrontational form of argument, but... it doesn't have to be. Stop being an asshole, and find non-assholes to work with.
bogota|4 years ago
These people don’t last long and I have gotten pretty good at screening out this personality in interviews after having it cause huge issues at two different places I worked.
tux3|4 years ago
The truth is that people's emotions can be a lot more different from yours than people may be willing to imagine.
No one is perfect. But not everyone derives 'insane pleasure' from criticizing, either. And if you do, that may not be obvious.
I agree with the 'stop being an asshole' line, but to do that we need to help people realize when their qualia is way out of the ordinary. If you think everyone else is power-tripping, too, then will you think you're really being an asshole, or are you just doing what everyone else does?
It's scary to think that you might have something else you think everyone else does, but is really just you accidentally being oblivious. Speaking for myself, I'm going to try to be more mindful of this trap in the future.
wilburTheDog|4 years ago
I think the process of realizing he needs to do that and doing it is what he's describing in his article. Generally people don't open up about how their behavior is toxic unless they recognize it as a problem. And, though my experience with Russian culture is limited, I understand that competitiveness and criticism is the rule, at least in the STEM fields there. So this guy has been behaving the same way (most) everyone else does, but now he's realizing it's bad and trying to fix himself. I don't think he deserves the criticism he's getting in the comments here. We all start somewhere, and trying to improve should always be encouraged.
dimal|4 years ago
Zababa|4 years ago
unknown|4 years ago
[deleted]
friedman23|4 years ago
flud|4 years ago
I feel, in order: disappointment - because how could they make this stupid mistake, then anger - why the f do I have to waste time to correct stupid mistakes, then a bit hateful - we need to fire this person and hire someone competent, then sometimes a bit scared - what else has this person got wrong and I missed, then a mix of all of the above.
What would make me feel good, as far as reviews go, would be to say "hey, this person did this way better than I would have".
Can you tell I hate doing reviews?
ravitation|4 years ago
I mean maybe you're working on extremely repetitive code, but the idea that you don't learn anything from reviewing bad code, and hopefully writing comments designed to help not humiliate, seems pretty bad to me also...
You want to learn from others who review your code, but become angry when you have to teach those whose code you review? That seems bad...
atom_arranger|4 years ago
People often got annoyed, they would say their PR isn’t ready yet.
That’s fair, I kind of understand, my intention was to just save them time going down an incorrect path though, because I know it’s going to be difficult to convince them later they need to rework days of work.
Not sure what the solution is.
JamesBarney|4 years ago
When one company buys another the quality of the code is a calculation in the sales price. But it's a small one, and it takes a real dumpster fire to move that needle.
aracena|4 years ago
What kind of automation or tools are you using for code review?
watwut|4 years ago
That emotional reaction in combination with conviction everyone has the same one disqualify him.
onlyrealcuzzo|4 years ago
[deleted]
backoncemore|4 years ago
Some might say, oh it's hazing, well fuck you because I'm quitting. I'm not putting up with any amount of hazing at a job. If I have to spend 8 hours everyday somewhere I'm for sure not going to spend it with some asshole.
nyczomg|4 years ago
This person is so confident in himself, that he thinks his code review takedowns are so brutal, yet effective, that he is ruining lives. It almost comes off as "I'm so handsome that I ruin people's lives with my looks and I'm sorry."
And then there is this...
"I was mad that, while I spent my nights learning F#, my daughter started calling everyone around “fathers”. And this guy, instead of getting better at his job, went home to his children. And I wanted to punish him."
Uh, whose life is being ruined?
billycorben2|4 years ago
I’m craving some constructive feedback.
ALittleLight|4 years ago
My mental model is that some people feel like they must comment on a code review to show that they've done something. They don't actually care, but just want to write a comment or two and you can shrug those off.
If following this approach you do need to be careful to only ignore genuinely useless comments though. Often a good way to tell is just to chat with the reviewer. That has the added benefit of the reviewer learning that useless comments will create more for them because you'll be by to chat about their useless comments.
seattle_spring|4 years ago
* in my experience, of course.
baseballMan|4 years ago
I've had the same thing the other way, where I feel that I usually give kind and fair code reviews (no nitpicking, etc) but have had former colleagues that get genuinely upset and push back really hard when I make any sort of comment on their PR.
X6S1x6Okd1st|4 years ago
In my opinion the first priority of code review should be to prevent mistakes in the code at hand
dreyfan|4 years ago
Because it creates technical debt, that's why people get frustrated with shit code. They just aren't properly equipped how to convey/teach/train/fix it without coming across like an asshole.
gjs278|4 years ago
[deleted]
lhorie|4 years ago
The real danger of confusing the two is that real skill dulls if you let overconfidence take over, since the very thought of being "better than others" prevents you from accepting that maybe there are things that you don't know or haven't considered.
For example, is "destroying" a coworker's commit in a code review really really helping? Did the person perhaps forget to consider that hiring to refill the position of a fired developer actually costs physical money (as opposed to time spent on coaching?) or that perhaps a lot of time is being spent on nitpicks without bottom-line value or that tip-toeing around egomaniacs can stunt autonomy and therefore creativity? This is not merely a matter of whether you're lulling yourself into some false sense of superiority/duty/whatever; thinking in terms of bigger and bigger pictures is an actual skill that one needs to develop when going up the career ladder.
robohoe|4 years ago
blahyawnblah|4 years ago
Why should be bad PRs ever be allowed for any reason?
rootusrootus|4 years ago
Maybe everyone else only writes good code, but this works for me every time. Even after over 30 years coding, I still have no problem seeing how imperfect the code is that I wrote as recently as last year.
And don't ever make it personal, anyway. Adopt a neutral tone, phrase comments abstractly as how they relate to team goals, how the code might be made clearer, etc. Don't accuse, don't belittle, don't try to look smarter than you are. And try to recognize the difference between the stuff that actually matters, the things which will actually be a headache down the road, and the pointless details that are just not how you'd have chosen to code something.
yupper32|4 years ago
1. Critical mistakes
2. Style guide mistakes
3. Non-optimal design (in your opinion)
#1 Always receives a comment, obviously.
#2 Always receives a comment, but we have good automation here so it's not too much of a worry.
#3 Is where it gets interesting. A lot of the time, commenting about this category is prematurely optimizing and it's a waste of time for both the reviewer and the owner of the change. At most I try to make one overarching comment about the design.
You really have to ask yourself "Does it work? Will it cause issues down the line?" If the answers are Yes and No respectively, you should likely let it go.
The feeling of ownership over the design, especially for a junior engineer, is incredibly important for moral and the ability to get better over time. IMO it's also important to let them make small mistakes now and again so they can learn from it.
RandallBrown|4 years ago
I don't necessarily want or expect them to change their code but I want to make sure they're considering multiple options and intentionally choosing that path instead of just copy and pasting something from stack overflow (as an example.)
unknown|4 years ago
[deleted]
ratww|4 years ago
Code reviews never help in those cases. There is always an underlying cause: the developer is trying to rush to prove something, or maybe over-engineering for the same reason. Maybe he has some issues at home, or isn’t sleeping well. Maybe it’s just lack of experience. Maybe it is a personality issue and the developer is trying to save face by sticking to his guns.
Either way, I find that it is much better to have private discussions with the developer to increase the code quality via mentoring, or pairing. It helps removing the defensiveness, doesn’t make them feel publicly humiliated and doesn’t spend the time of the team with the review-fix cycle.
mrtranscendence|4 years ago
And some of the code produced by both data scientists and engineers ... it's, hm, not great? Just between you and me? So I'm glad I've never had the inclination to tear anyone to shreds. Indeed, part of my job used to be to help people with their coding problems, and I loved doing that.
But sometimes when I'm reviewing code ... it's very hard to bite my lip and not call out every little issue, even though it would just be too much and most of the "problems" aren't actually very important. I try to impress upon people that developing good code is useful when I lead training sessions, but it's hard, especially for people who'd rather be doing data science than coding.
papaf|4 years ago
https://medium.com/@sandya.sankarram/unlearning-toxic-behavi...
sbacic|4 years ago
I've found that I usually start with the "correct" way and end up regressing to the "wrong" way as more and more work piles up, stress builds and deadlines approach. I guess the "correct" way only works if the organization actually prioritizes it and gives reviewers the time to do it the "correct" way no matter what stage the project is in.
andreshb|4 years ago
tornato7|4 years ago
I do think thorough feedback is important, that's how I've learned the most after all. But typically now if I I'm going to write more than 5 comments, I meet with the other developer in person instead. That way the code problems are solved faster and it avoids any sort of public humiliation.
2OEH8eoCRo0|4 years ago
quxpar|4 years ago
Doctor_Fegg|4 years ago
https://mobile.twitter.com/sebjilke/status/10364067943591731...
(I believe TFA is Russian, so read the Eastern European graph)
leepowers|4 years ago
That's way too much feedback. It makes it very hard determine which problems are critical, and which come down to aesthetics or personal preference. On the flip side, if I was churning out buggy code at that rate, I'd want to know about those bugs in detail.
There's also an opportunity cost of evaluating code so tightly. Not only does it take up more of the reviewer's time, it also eats up developer time that could be spent on other features.
> The reason for these angry code reviews is obvious. As part of the team, I bear full responsibility for the project’s code base. I have to work with it later, after all. It’s a source of many issues for the business. The code doesn’t scale, can’t be tested properly, is littered with bugs. Support gets more and more expensive. It can’t be open-sourced or used to lure new developers.
Premature optimization? The mistake here is trying to optimize the legacy of your code base, possibly thinking too far ahead.
nanis|4 years ago
PRs are conversations. Every team member should be able to request changes to start a conversation. A conversation about the code should focus on what tradeoffs are necessary to get stuff done now along with a consideration of how comfortable every team members feels they can maintain the code.
Teams where PR approvals are considered endorsements, where PRs are rubber stamped, where developers throw fits when others dare to ask questions etc are detrimental to both getting things done and maintaining a sane working environment.
Don't confuse the code with your worth. The greatest asset you will ever have is the ability to be openly critical about code you have written while understanding the right level of imperfection for a given circumstance. This only comes with experience. The more you nurture your ability to view your own code critically, the faster it comes.
Since we all have blind spots, take others' questions seriously.
jp57|4 years ago
I was taking a graduate-level introduction to mathematical logic. In the class we learned about a bunch of different propositional axiomatic proof systems, and then we proved properties like soundness and completeness for them. The class was organized around class participation: everyone was required to do at least one proof at the board in front of the class and every session consisted almost entirely of students doing proofs at the board.
I'd been out of school, working, for eight years before grad school and I found this all very intense and unfamiliar. I did my required work at the board, choosing an easy problem, but otherwise mostly sat in the back and watched. There was, however, a cohort of very intense aspiring logicians who sat in the front row and took deep interest in every proof.
One day, a student went up with a particularly challenging problem. From the start it was clear that he was taking an unorthodox approach to the proof. The front row went nuts, interjecting and kibitzing on practically every line, telling the guy different things that he should do instead of whatever it was that he was doing. The guy was a good sport and tried to justify everything and answer all the criticism, but it seemed like he might not get through the proof before the class ended.
The prof who had been watching quietly from the side of the class, let it go on for a while, then stepped out and quieted everyone.
"I need you to remember," he said to the front row, "that we are the audience. It is not our job to prove this theorem; it is this gentleman's job. Our job as the audience is to listen to him, and at the end, decide if we are convinced. He may do things differently that you would have done, but that doesn't matter, as long as in the end we are convinced."
That was twenty-three years ago, but it stuck with me. In programming, there are often many different ways that a problem could be solved, but there is almost never One True Way™, even though there are often many voices that would like to convince you that their way is the right one. My job as a reviewer of code, or really anything, is not to try to get the other person to do what I would have done, but to decide if I'm convinced that the way that they've chosen is good enough, and, if not, to ask for changes that would convince me.
Sure, sometimes a PR is so bad that it needs to be completely rewritten, but in my experience that's rare, and in that case the feedback should probably be given in person and in private or in a friendly, sympathetic group.
jimmyvalmer|4 years ago
Justsignedup|4 years ago
- is a developer making the same set of mistakes? send them information on a better strategy to try overall
- how bad is this mistake? Is it just something that I know how to do better, or legitimately a broken way of thinking?
- what is worse, a slightly inefficient or unpretty algorithm, OR someone researching the problem / solution
Point is, 90% of my comments were meaningless. I really comment when things look wrong -- Did they misunderstand the intent of the ticket, did they verify everything with product because this looks weird, did they check the edge cases, did they forget about this other behavior, etc. All that I just mentioned is the real meat-and-potatoes. Code-fu is important, but less important than the other stuff. And if you are a calm, trusted, and mentoring team member, those same people will come to you to up their code-fu voluntarily.
clarle|4 years ago
Would definitely recommend those for any teams that have a similar teammate as the article author on their team.
mrtranscendence|4 years ago
cowanon22|4 years ago
The only I things I manually look for in reviews are overall readability, sensible naming, high level adherence to the architecture/design, and data system/database/API queries.
After 20 years of writing code and leading teams, I've found that most of the stuff developer blogs and the OOP community fret over simply doesn't matter in most cases. The high level interfaces are often more important than the low levels details, and static code analyzers do a decent job of pointing to problems. I've almost never seen bad code that didn't also have many issues in the static analyzer.
It also matters what kind of code you are writing - foundation code or something that will be used by thousands/millions of developers should have a higher bar than some internal one off. However, I've seen enough very profitable companies running on total crap code to believe that code quality is the most important thing.
gautamcgoel|4 years ago
His post reminds me a bit of this religious group, Filhos da Mente de Cristo, that appears in Orson Scott Card's novel Speaker for the Dead. All members of this group take names that reflect their resolve to overcome their greatest flaw, for example: "I will put others before myself" or "I will listen carefully before speaking", etc.
djangofan|4 years ago
t-writescode|4 years ago
If you overwrite all their code, what have they learned?
gchamonlive|4 years ago
An important skill to develop is the ability to "read the audience". Almost prescient in nature, predicting how people will react to you is of utmost importance so that you can tailor your responses accordingly.
This is important when mentoring people because, even though tough love might work on some, it may very well destroy self esteem for others and make them shift career, ending something before it even starts.
If you are in a position of mentoring, it is your responsibility to adapt. It is painful, frustrating and a source of contempt when you try and try but you just can't seem to find the sweet spot to inspire newcomers, but as long as you persevere there is hope in teaching others.
I had a recent experience in this. I am in no way a long experienced infrastructure engineer, but I built my share of cloud applications to have an idea what can go wrong. I recently tried mentoring someone new and it was just plain frustrating. I couldn't explain too much without overwhelming him with details, and I couldn't just direct to sources without him feeling abandoned. That sweet spot of attention I couldn't reach before he requested to "learn different things" and effectively abandon infrastructure haunts me sometimes.
bigpeopleareold|4 years ago
Many times, I felt like I had to write code to get through the co-worker's code review, not for the requirement. The requirements to get pass that code review felt inconsistent and vague, so it made work very stressful. Having a conversation with him was a chore as well, as he came off to be very critical even when prepared with questions.
When he left the company, I was not the only one who felt a weight lifted off all of us. No one wanted to put up with that.
Code reviews and other analyses should be topics of open conversation, if anything. They should work both ways and help each other about not only needs but skill development. When it is used as a tool to boost someone's ego instead, it becomes counter-productive and many years later, I sometimes have that in the back of the head, even with those who I know can be attentive towards criticism in code reviews but are otherwise good people.
plutonorm|4 years ago
Yay! you found an edge case that breaks a piece of code that will never get hit while the other million and 1 edge cases that haven't been found are still out there. Yet you drag it out from the dark and show it off for all to see like some damn trophy. Yay! look I am great I found one more thing wrong than the other guy. No matter that we are all swimming in a sea of wrong and every one is completely clueless. Only slightly less clueless than those who don't even realise they don't have a clue.
It follows from a simple argument - every programmer and every company has a different view of 'good'. I've seen it, I've worked in many. Just as every religion cannot be right, every weird view on correct programming style cannot be correct.
vdqtp3|4 years ago
This is objectively, mathematically, incorrect. There are optimal solutions, and for some/many problems, there is one optimal solution.
chaps|4 years ago
At one point we had a major issue with a client, because our daemons weren't installed on their hosts right before a major event of theirs, and none of the tooling could install on this clients' hosts. So I threw something together over an afternoon that could do it all by frankensteining the other devs' code. It was run-once code to fix the emergency. Lots of selenium garbage.
Since it was one-off, hacky code, I didn't feel it was necessary to put it into git, so I didn't.. until others complained to management and forced me to. From there, I had about four devs dog pile my code, commenting on everything wrong with it - maybe 20-30 comments. I explained that it was one-off code meant to solve a specific problem and of course it was going to be messy, but I got responses like "if your code was made public, you'd want your code to be clean so you can be proud of it!". It was infuriating, considering their system worked maybe 5% of the time.
I'd like to say it was in good-faith, but I really doubt it. At one point while I was there, one of the devs rejected a PR because I had bash in an Ansible role, saying "you don't know if the remote host will have bash installed."
That whole ordeal was enough to leave the company.
unknown|4 years ago
[deleted]
duxup|4 years ago
I always look at code reviews or just reading / talking about each other's code as a way for us to just get on the same page about how we do things. Make everyone's life easier. "Hey man when we're looping through that thing here is how we usually do it." "Ok cool, I'll do that." Or maybe we have a discussion on why I did it differently this time and how we might address that.
Much of the time I don't "care" or feel strongly what the change or answer is. If we're all doing the same thing / spot a bug sooner, it's just easier for everyone.
But it seems code reviews to some are this sort of battle / proving ground / have a lot of elements of status. I don't get that...
aazaa|4 years ago
Or he's just lazy.
It's way harder to build up the people you work with than tear them down. The key ingredients tp the former are patience and empathy. And those qualities are lacking in many managers.
Also, aggressive, opinionated people are often perceived as more intelligent than their more reserved peers. You'd think that the snowmen can't get snowed, but the type of person the author describes seems to be just as vulnerable to the misdirection as others.
lhnz|4 years ago
Good code reviews spot real bugs and provide solutions and explanations that help the owner to improve their branch. It's completely constructive and feels like going out of your way to way to help them and paying attention to what is meaningful -- the vibe should be a bit like "doorman at a posh hotel providing excellent service", so not disrespectful at all. Also, if you're nitpicking, it's a sign of lack of focus...
AtlasBarfed|4 years ago
Devs often have insufficient time for the standard of perfection code reviews assume: perfect code, formatting, testing, experience, foresight, etc.
Code reviews also have a strong element of bullying, hazing, and people reenacting semi-trauma (that is the cycle of abuse so common in life: trauma makes you lonely, enacting that trauma on others in kind makes you feel less lonely)
I used to joke that in lots of enterprises, it isn't faster, cheaper better pick two, it's actually faster, cheaper, better, follow process, document. Pick about 1 1/2.
marstall|4 years ago
908B64B197|4 years ago
This has to either be a cultural thing or satire.
throwthere|4 years ago
nsonha|4 years ago
bbertelsen|4 years ago
I have been mentoring junior developers for about 10 years, and some more senior ones for the last few years. My ego is more attuned to getting things done than tearing up people's work. The following works really well for me:
1. Never insult people's work, it's counter-productive. (Unless see number 9) 2. Nitpick on convention/style, not implementation, unless the implementation is infeasible. Convention and style will quickly become rote. This forces new developers to pay more attention. 3. If it works as intended and has meaningful tests, MERGE IT. Congratulate them :rocket:! 4. Point out logical pitfalls/caveats by asking "what would happen if". Asking questions starting with "why" triggers people and puts them on the defensive. That's your EQ lesson for today. 5. Through code-review, you can identify a lot of little problems and suggest articles to read that would help the person grow. Examples: misunderstanding async/await vs. thenable in JS. Parallel programming in R/Py. These are distinct, language specific (R has sessions/multicore, Py has the GIL) pieces of knowledge that people can learn easily with a tiny bit of guidance. 5. If you're a better programmer - write the first 1000 lines so that they can fill in the next 10,000 (credit: don't remember, someone tell me?) 6. Even junior developers can get a surprisingly challenging task done if you give them hints (point form) about how you might approach it. 7. Do code reviews in-person (1-1) or if you are tactful with your feedback and have encouraged an environment where making mistakes is acceptable - in a group, that way everyone learns! This is the management version of the DRY principle. 8. One of the biggest problems I see with new developers is "how do I break this problem into smaller pieces". Discuss potential approaches BEFORE the PR. Not after. 9. Fire people that are consistently lazy. When you manage people for a long time it easy to see the difference between someone that needs training and someone that is lazy. You can help a someone that wants to learn, but you can't motivate someone to be interested in something that they aren't already. 10. Cultural differences can make people less likely to speak up when they are stuck - check in with your team!
elwell|4 years ago
duxup|4 years ago
jimmyvalmer|4 years ago
mtnGoat|4 years ago
ego is one heck of a thing. this guy sounds terribly painful to work with.
i also agree with another commenter, if tearing people down gives you pleasure, you might be wise to seek counseling.
fwip|4 years ago
I think that this is called projection.
fayten|4 years ago
ethanfinni|4 years ago
seiferteric|4 years ago
neo2006|4 years ago
AnimalMuppet|4 years ago
Code can be like that, too. You write code, and it's enough to convince you that it does what you think it does. But someone else reading it can sometimes see the holes that you don't see.
Assuming that person X writes bug-free code is bad, whether X is "you", "me", or "that co-worker".
I don't have to be better than the PR author. I just have to be decently good, and be a different person. That's enough.
And of course I'm looking for bugs. That's the absolute first thing to look for!
Now, true, if I can help the author be able to see their own bugs (asking questions, maybe), then that's probably better than me just lecturing them. Teach them how to think so that they can see it themselves next time.
WalterBright|4 years ago
I haven't. I love it when I see a great PR that I can just stamp "Approved" on.
The last thing I want to do is close something as so bad it's unsalvageable.
jhawk28|4 years ago
glitchc|4 years ago
draklor40|4 years ago
athenot|4 years ago
https://news.ycombinator.com/item?id=19190472 - 155 comments
mixmastamyk|4 years ago
There are also good comments here about prioritizing the categories of issues into whether important or not.
gn170xdw07d5|4 years ago
mdip|4 years ago
I have been doing this work for far longer than I care to admit. My rejections/non-approvals (both received and provided) land in one of the following categories: (a) Did you notice that? (Oops, D'Oh!), (b) Did you know about that? (Educational), (c) Did you think about that? (Edge Cases), and (d) Why? I work with these men and women day-to-day, so we don't often need to butter up negative responses, we have established that "I trust you can do your job" and my comments do not imply otherwise.
The best way I've heard it said is "We do code reviews because errors in software development are common, regardless of proficiency. I don't write perfect code and having a second set of eyes on my work will only make it better/me look better. Reading a growing code-base by reviewing each other's work benefits everyone."
Of the ways those land, the (b) category is the one that requires a little care (if your goal isn't just to bully/shit on someone's gap in knowledge). I find the way to take the sting out of it is to start off with "Hey, I came across an approach to solving this using (whatever); have you done anything with that? It would be an improvement ... (comment goes on)". I didn't say I came across that approach 15 years ago, that it's what I have decided is "Kindergarten in C# School". Guess what? Someone's read my code and thought the exact same thing. I know this because I've thought them about code I've written as early as 6 months prior. Of course, it's a matter of perspective. I thought that over the one thing I saw that made my toes curl up, never mind that the rest of it was perfectly fine, just like the code I'm currently reviewing.
My favorite, though, is the occasional class/implementation that lands in "Why?". Usually those look like the previous -- a WTF-worthy implementation that the only comment I can send with is "Why was this particular implementation used?" -- and often it requires refactoring ... but every once in a while there's that gem. Some edge case that was cleverly discovered, covered and the developer was left with "This is, literally, the only way that this can be done (given the constraints)." It's the code that's both frighteningly ugly/really cool once you realize why it had to be that way.
[0] I was one of two (but really, one of one) doing the entirety of secure code review for a large multi-national telecom for one brief, terrifying, point.
ChrisMarshallNY|4 years ago
When the DI is screaming profanities at recruits, [s]he is preemptively saving their lives. The manner in which it is done, is actually a component of the training. A significant part of military training, is to deprecate the individual, in favor of the team. The DI is not an individual. They are the sharp end of the elite organization that the recruit hopes to join. The variable is the recruit. The organization is a hardcoded constant.
But most of the world is not in the military.
I understand Linus' expletive-laden rants. I don't like them, and I think he could probably find other ways to enforce Quality, but he does get results. The same for Steve Jobs, and his infamous diatribes. When I worked for a Japanese company, I watched managers literally bring employees to tears, with simple, quiet comments. I worked for a British company, and got experience with the sarcasm-fueled way that British managers work.
As a manager, I worked with firm kindness. I made it clear what was expected as an end result, and did my best to support my employees. It seemed to work for my team, but I also had a particular type of team. My style probably would not have worked in other contexts. I feel that I projected a gestalt, as opposed to a set of individual orders. We acted as a unit; which wasn't easy, as I also worked to preserve the individuality of the members.
As a coder, I am fairly obsessive about Quality. Code quality, documentation quality, design quality, process quality, schedule quality, and end-result quality.
I'm very hard on myself. I set a high bar, and usually meet it.
I've learned not to project it onto others; if at all possible. I understand that my level of Quality is probably not something most companies would consider "cost-effective."
Here's an example: I am writing an app with a screen that displays a big map, and has overlaid views and controls. I spent at least 45 minutes, today, ensuring that one of the controls aligns pixel-perfect with its "alter ego" in the "unfurled" HUD display. It was a pain. I had to set a measurement point in the simulator, run the animation, then review the open display, and make sure they matched. Then, I had to rotate the device, and do the same.
Many, many developers would say "5 or six pixels off; good enough. It's all under a fat finger, anyway." I am not right in the head, though. That kind of thing actually makes me physically uncomfortable. For me, that needs to be 0 pixels; even if it is under a fingertip.
So I will do it for my work. If I find that I can't use the work of others, I won't work with them. I'm very, very picky about dependencies. Fancy Web sites and eye-candy aren't particularly indicative of decent work. Sadly, large user communities no longer seem to be a mark of quality, either. I can't take anyone at their word. I have to test for myself. I have been fortunate to find teams of like-minded folks, but they are rare.
But I won't tear people apart, and I won't lob public insults. I feel that is not helpful. If the only way that I can feel good about myself, is to tear down others, I need to do some work on myself; maybe with a psychotherapist.
DoreenMichele|4 years ago
This is true but it's not simply because it breaks down individual identity and makes the team more important than personal ego. If you can't stand unflinchingly in the face of yelling and cussing, you can't stand unflinchingly in the face of live fire and people trying to kill you.
unknown|4 years ago
[deleted]
ChrisMarshallNY|4 years ago
Still stand by what I wrote, but glad the OP was flagged out.
unknown|4 years ago
[deleted]
frazbin|4 years ago
declanhaigh|4 years ago
notamy|4 years ago
unknown|4 years ago
[deleted]
unknown|4 years ago
[deleted]
jimmyvalmer|4 years ago
Editorial: code reviews are inherently combative; if criticism doesn't come off petty, it comes off paternalistic which is worse, imo.
kaminar|4 years ago
[deleted]
adamnemecek|4 years ago
watt|4 years ago