3 ms·
This is my preferred style by far, but it seems like most junior programmers I work with don't seem to mind the style with deeply nested ifs and far away except
by nickm12 3y ago
This is my preferred style by far, but it seems like most junior programmers I work with don't seem to mind the style with deeply nested ifs and far away exceptional elses. I try to avoid commenting on such stuff in code reviews unless it is egregious, but I will rework it later if I happen to be in the same code. I hope it doesn't come across as passive-aggressive on my part.
- dsauerbrun 3y agoyou should mention it. When I was a junior programmer I also wrote the nested ifs and I had a mentor show me how much cleaner the code could look which I really appreciated. I continue to use this style which is far superior than the one I started with.
- bluefirebrand 3y agoIt probably comes across as passive aggressive It's also robbing them of a learning opportunity, and it's creating more work for you. Mention it on the PR, maybe show an example of how you would write it in a code snippet, and re-review after they've taken a stab at it.