4 ms·
I often use this principle when explaining my code review objections: "I am slightly astonished that this code does X." If someone asks me if it's really astoni
by einpoklum 7y ago
I often use this principle when explaining my code review objections: "I am slightly astonished that this code does X." If someone asks me if it's really astonishing, or what I mean by that, I explain the principle to them.
- mason55 7y agoDo you find that it just pushes the argument "up the stack"? And now instead of the discussion being about the code you're arguing about which outcome would be less astonishing? It seems like it would move the conversation from concrete to abstract and subjective. If the person replies "this is how I would expect it to work" you can't really argue with that, because maybe that is what they'd expect, even if that's not what you think a generic person would expect. Also, in my experience, one of the major holes that mediocre devs have is that they struggle to look at things from a different perspective (either the perspective of a user or the perspective of another developer). This principle is fully based on putting yourself in someone else's shoes and thinking about what they would expect, which is exactly what these devs struggle with.
- zhengyi13 7y agoI think that's the point, and the value of the discussion (hopefully not "argument"). In my imagined best case result, you and your coworker are now having a conversation about your backgrounds and perspectives to try to understand where the mismatch is that led to your astonishment. One possible outcome there is that you establish a new, common basis for understanding, and less future astonishment thereby.
- Ididntdothis 7y agoTo be honest the word “astonished” comes across a little weird in a code review. I think it’s better to say “I don’t understand” or ask “why is it this way”?”
- deleted 7y ago[deleted]
- einpoklum 7y ago> the word “astonished” comes across a little weird ... this is what gives me an opportunity to describe the principle :-) and for those who know it - they already know what I mean.