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

Keff - May 19 '22 - - Dev Community

I struggle with this a lot, how do you approach this? How do you explain that what they've done is wrong, it affects the rest of the team, and that they should think more about the problem and side-effects? Without affecting their confidence and morale too much by doing so. I'm always afraid of affecting them negatively...

What if the issue is recurrent and happens on most tasks they're assigned to? Not too bad as to justify a layoff, but enough to increase development times.

How do you deal and communicate these things?

Cheers! Waiting for your helpful advice as always!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .