Semantic Code Reviews – Simple and direct comments without drama
m31coding.com
m31coding.com
Whimsical analogy: The Elcor in Mass Effect adopted a similar approach to manage communicating with other races who lacked their ability to communicate nuance through scent and microgestures.
> Elcor speech is heard by most species as a flat, ponderous monotone. Among themselves, scent, extremely slight body movements, and subvocalized infrasound convey shades of meaning that make a human smile seem as subtle as a fireworks display. Since their subtlety can lead to misunderstandings with other species, the elcor prefix all their dialog with non-elcor with an emotive statement to clarify their tone.
Cynical observation: HK-47 is commonly passive-aggressive and sarcastic.
So for example something that has 10 nitpicks I will let it pass because all it tells me is i'm a dick :)
Link?
All too often, eager young developers are told to, "do code reviews," without being given any instruction on how.
This can lead to all kinds of unproductive misunderstandings, such as:
- Interrogating the author's competence, Why did you add the fields to this struct instead of...
- Shaming people, You should know... or How could you miss something so obvious? etc
- Bikeshedding, this one is subtle and a huge source of wasted effort and a huge nuisance. When discussing the construction of a nuclear power plant the most well attended and heated discussion was what color to paint the bike shed. Consider if your comment would really change anything for the better or is it just creating busy work? Remember: personal preferences aren't important, and neither are superficial ones.
Simple things you can do to avoid these kinds of comments, sound more constructive and assertive: refrain from the use of the words "I," or "you." Use the non-personal pronouns, "this," "they," to talk about the code. Stick to facts and avoid personal preference: you might have written it differently but if the tests pass, the style fits the rest of the module, there are no lint warnings, etc; people shouldn't have to come to you to ask how you would have written it. And use labels as the article suggests: if you feel compelled to leave some helpful advice for a junior colleague that isn't necessary to get the code merged, leave a label to indicate your intention.
In a similar fashion, authors: make sure you're comfortable rejecting poorly written review comments, ignore unhelpful nit-picking, etc. Practice rejecting a few nitpicks once in a while. After all, you took the time to understand the problem and write the code in the first place. Some times reviewers dropping by at the last minute haven't taken the time to fully understand and appreciate the problem. If their suggestion would have you re-write half of the work you did and not materially change outcomes it's a sign they have no idea what they're talking about.
Taking unprofessional or deconstructive criticism is not part of the job.
Suggestion: read the article
> a lot of time and energy are spent coping with the general disadvantages of written communication, such as the lack of tone and body language
If you encounter criticism that could be improved, help improve it: https://chromium.googlesource.com/chromium/src/+/master/docs...
After reading a round of feedback, I frequently had to make a pause, 30 minutes minimum. I tried to control my will to respond at the same tone, not always managing to hold the impulse. There was a lot of rumination and resentment too, not only on my part, but on the rest of the team's. Such a huge waste of mental energy.
Pretending that people is supposed to behave like a robot, dismissing their emotions etc, IMO is a mistake and, sometimes, an excuse used by people who feel good treating others badly.
I also enjoy a tactical use of smileys and other emojis where applicable :)
* I've heard Kiwis say "F*ck you?" in lieu of "Seriously?"
* A Brit who says "That is an interesting solution!" usually does not feel intellectually stimulated by the solution but is conveying that it is utter garbage.
Thus, I very much like the proposed idea of well-defined labels.*
If in work setting your coworkers (god forbid teamleads or managers) interact like that just run, don't try to solve it with conventional reviews or something. Believe me you will not finish blinking before they start misusing this too to cope with their repressed anger through mockery/shallow sarcasm. "nitpick: have you considered escaping user input?"
I can be sarcastic but I have never directed sarcasm towards someone who I am reviewing. (Sarcasm towards third-party code is okay for me.)
I don't know if people who are using sarcasm would want to start labeling things like that as such, since it tends to detract from the intended effect.
Disclaimer: not a Brit.
The label makes it easy to find comments still in need of replies, and for automated security to prevent merging items with outstanding crucial comments.
The label opens the possibility of automated reporting and/or review of reviews.
And they might very well be! But just make sure you get a rapport with the reviewed party, and prefix or suffix the comment with a "just a suggestion" or an explicit "I'm not asking you to act on this remark". With a semantic review, you can shorten it to "nit:".
That's what the article suggests, using "Suggestion:" as a prefix.
> or an explicit "I'm not asking you to act on this remark"
Same, the article suggests the "Remark:" prefix. Both are more terse than what you suggest here.
Of course sometimes the reviewer is just dumb/tired/distracted and a simple explanation is all that's needed....
Like, "what does ??= mean? I've never seen it before" in modern JS. I've had to adjust to code like that for a bit because I've been doing JS since ES3/4 and may have missed some developments (or the general availability of those).
For the rest, isn't it obvious when an question is a question or a hint is hint? If you understand English then the meaning of each comment should be clear.
See that's where your assumptions already fall apart; keep in mind a lot of developers do not have English as their first language, let alone the cultural differences and nuances if they seem to have a good grasp of the language. "Can you change this please?" can be seen as a friendly request by one, a helpful suggestion that can be ignored by someone else, or a passive-aggressive "You Have To Change This Or Else" reply by yet another. It's not as straightforward as you wish it was or as you experience it to be.
Besides, English is not even a good international language; it's three different languages in a trenchcoat.
Comparing this with designers, they go through rounds of feedback constantly in college. They come out as feedback/revision machines.
Semantic comments come with labels that convey their purpose, whether it's a simple remark, a question seeking an answer, a hint for future consideration, a suggestion open for discussion, an important point requiring change, or a crucial issue that must be addressed.
However, while "strong communication skills" is something we say we look for, it's not something we actually test for. What does "strong communication skills" actually mean? Does it mean you know how to use a spell checker? A grammar checker? Read and write in your native language?
Personally, I've always taken "strong communication skills" as being able to communicate with other people to achieve the goals of the company. And if one of the goals of the company is creating a team of people that enjoy working at the company, then communicating in a way that doesn't achieve that flies in the face of a goal of the company. In other words, you are lacking in "strong communication skills."
tl;dr: Does "strong communication skills" really matter or is it just a platitude?