DEV Community

Discussion on: How to tell a Junior Dev that what they've done is wrong?

Collapse
 
mvuorinen profile image
Mikko Vuorinen

When there's enough time given to the whole team to help everyone grow, this is the approach I try to take in situations where someone's done something that doesn't look right:

  • Let them take you through what they've done and explain why they ended up doing it like they did
  • Ask questions to make sure they explain their decision making
    • "Why did you decide to use X?"
    • "What did you assume about Y?"
    • "Are there other ways of doing this that you considered?"
  • If you think they might have missed something, ask questions that will make it easier to see
    • "What happens to Y when you do this to X?"
    • "In what kind of situation we end up here [line of code / method / API endpoint etc]?"
    • "Would this also work in situation Z?"
    • "Do you know about this [tool / library / documentation etc] that might be related?"

It's really impactful to have the person discover themselves where they've gone wrong and figure out a better way of doing things, with someone more experienced just gently nudging them to that direction. Try to avoid just giving them your "correct" way of doing things.

Make sure to be genuine when asking questions. You might have an answer in your mind, but you may have missed something or don't know something they do, so listen when they give you their answer. More often than not it's a learning experience for both sides.

The example questions above are just something I came up with, and they can be anything that fits the situation, the type of work being done, and the experience level of both of you.

One thing to note is that this is quite mentally demanding way of solving this kind of problems (because it's more about learning than fixing). Try to be aware when they or you don't have the energy to push through it, and find other opportunities for it, especially if it's a recurring problem.