DEV Community

Discussion on: Things i learnt from best programmers around me

Collapse
 
benjaminjprice profile image
Benjamin Price

Here’s one that I learned when I was a junior developer that has stuck with me - and I try to teach others:

When reviewing someone’s code, try to use questions instead of statements. You don’t have all the context the author did and they may have a good reason for doing something.

For example, instead of saying “you should have done it like this [...]” you could just as easily ask “did you consider using this approach?” - they might have and might have a good reason for not doing it that way.

Finally, as a bonus point, if the code works and doesn’t have any issues allow the author to reject your ideas/feedback.

Collapse
 
dihfahsih1 profile image
Mugoya Dihfahsih

wow this is awesome, at one point in time i have also used it though not so often