5 ms·
> teach him it's more important that he learns how to find better ways to do things himself. I would ask him if he thinks it's actually check-in worthy. I woul
by rancur 11y ago
> teach him
it's more important that he learns how to find better ways to do things himself. I would ask him if he thinks it's
actually check-in worthy. I would continue asking until his doubt about it got the better of him, so that he views his code with a more skeptical eye. Then I would ask him to come up with 3-5 succinct ways to improve this. If they were good, I'd have him implement them.
You don't do the work for them, and you don't show them. The point of the college degree is that you've learned how to teach yourself without handholding. You need to be able to craft creativity yourself from blocks of wood.
If the 3-5 improvement ideas were bad, ask him to try again. If he still screws up [which is unlikely IMO] (and is really trying to come up with good stuff), give him one idea, ask him what he thinks of it, why, etc; have him implement it, give him another, etc.
- greenyoda 11y agoThe techniques for writing well-structured code may seem obvious to someone who has been practicing them for a long time, but they may be not at all obvious to someone who is just starting out. After all, it took a few decades in the history of programming and some very smart people like Dijkstra to convince professional programmers that code structure was important. The principles of refactoring weren't well known until much later. So I think that expecting some junior programmer to come up with these ideas by trial and error is setting them up for failure.
- rancur 11y agothis is a very good point. my own experience writing C was basically that all the fancy terms in the book didn't help me any, because they translated poorly to tacit knowledge. what helped me was running into the problems myself, coming up with the solution myself, and then realizing someone had already done it. I'm very slow at tacit acquisition though. I needed more practice. For someone like me in the first year and a half, I would just give them the info. However, now that I have 3 years of C and C#, I can rapidly digest new design paradigms, and write much better code. If the guy purported to have 5-10 years of experience and is still writing crap, I would take issue with telling him the problems himself as he's probably one of those rote-memorization dudes that China or India pumps out with no tacit understanding.