Skip to content

Comment on Common Species Of Code

Comments

I've been watching my son go through MIT 6.00.1x. He's working on the first midterm this very minute.

One of the things I've noticed is that, yes, code quality is from OK to horrid sometimes. Rather than stand behind him and correct every little detail I've let him navigate the problem sets and quizzes mostly on his own. When he gets stuck I give him a shove in the right direction and see what happens.

I've reflected on this as I've never really looked at student code. By the time I was a college student taking my first programming course I had already built a number of microprocessor boards, learned how to program them in machine language and moved on to Forth and C. I think my code was reasonably clean by that stage. Still, I know it wasn't professional grade by any measure.

It's easy to forget where we all started from and, as a result, criticize student code as naive. Well, in most cases, it is. That's a fact.

What I have now realized from watching my son learn to code as well as interacting with him through the process is that he is not learning to code. He is learning to think. He is learning about dissecting problems into small conceptual units that he can then translate into code. Sure, he is learning python in the process. However, the problem solving, solution structuring and problem representation skills that are very much necessary to be a good software developer are mostly language agnostic.

Realizing this, the fact that he is writing code that isn't the cleanest or the slickest possible solution to a problem stopped bothering me. I want him to learn how to think first.

Not to say that I've completely ignored the issue. I let him finish the assignments on his own and then we sit down and do a code review session where I point out where and how things could be better. We've had cases of a dozen lines of code replaced by just a couple. And that's OK. That's how he is going to learn.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.