712
Better start fixing your spaghetti code.
(lemmy.world)
Post funny things about programming here! (Or just rant about your favourite programming language.)
I see coding tasks with juniors a way to actually have a two-way conversation with said juniors and get them engaging.
What I tend to do is I'll give them an objective, and then I'll ask them what they think needs to be done. Each step of the way I'll try and correct them and get them going in the right direction.
If all is well, everything is cleared up, the junior knows what to do at each step, and then they go off and do it. Then I do the code review and the conversation restarts.
More often than not, the junior dev will get mentally stuck on a problem that they cannot conceptualise. That's fine - I tell them to leave it, work on the stuff they can do, and then we'll tackle it together.
Generally speaking, good junior devs can conceptualise a task about 50-80% and will get stuck on the other 20-50%. An excellent junior dev can be given a task and independently complete it - the code may not be perfect or up to a middle-senior coding quality, but they can get the job done.
The bad junior developers are the ones who need their hands held at every step of the way and never seem to improve or improve at such a snails pace that it is taking effective resources away from the team (i.e. senior devs - 1 or more) to explain the task repeatedly.
At this point, you need to raise that up to your line manager and have a serious discussion about whether you and your line manager think it is worth the investment to keep teaching this person while making said line manager aware of the problems (and make this based with facts that both you and the line manager can clearly observe and/or have observed).
For the others, you should go from a path of having to explain fundamental concepts (mostly because you both missed out on the weird edge cases of the task at hand) to in months being able to leave said juniors to the task and have them mostly complete it without any help from senior devs. And seeing that progress is why mentoring & code reviews is great - seeing that personal development in real time is an incredibly rewarding feeling.
The point is just differentiating your behavior between what you call a "bad" or a "good" junior.
And from experience the difference is whether they want to learn (regardless of their skill!!) or not (i.e are they passionate or it's just a job?).
Passionate seniors get frustrated when they try to teach bad juniors, but there is no point on doing that, the problem was just that the senior was not involved in the hiring process...