“Learning by Doing” is Not Enough

By | August 28, 2018

I’ve spent a fair portion of my career teaching and mentoring other programmers. Some of this training involves covering basic programming and design concepts that they may not have learned previously. When covering a fundamental concept, I often defer to books written by people much smarter than I am rather than explain the concept myself. Sometimes, the person I’m training has balked at reading any material because they prefer to learn by doing.

I am quite aware that people learn some things better by actually doing them. I started my career as a self-taught programmer. I learned programming by writing code for hours. I quickly realized that I needed more if I was going to get really good at this. So, I began reading programming books.

Experience

There is a problem with only learning by doing. You can certainly learn from your own mistakes, and you are likely to retain the lesson if you made the mistake yourself. Even though programming is a relatively young field, there are still decades of experience out there, and there is no way that you can rediscover all of that knowledge by trial and error. In other words, you need to also learn from the experience of others. No matter how prolific you are at doing, there is no way to match the experience of everyone who has written about programming since the 50s.

Knowledge is part of the tool set you use for writing code. Only using learning by doing is like building a house only using tools (and materials) you made yourself. How long would it take to build even a doghouse if you had to develop a hammer from scratch first?

Old Knowledge

The next problem I have with the learn by doing mantra is the (implicit) assumption that all of the knowledge that came before is old and useless. I’ve been told flat out by some developers:

  • There’s no need to pay attention to size of data, we have virtual memory.
  • There’s no need to think about managing memory, because we have garbage collection.
  • There’s no need to understand standalone programs, because we do everything on the web.
  • There’s no need to pay attention to how things work in C, we use higher-level languages.
  • There’s no need to pay attention to primitive numeric types, our language converts numbers as needed.
  • I don’t need to know how a hash/dictionary/associative array works, it’s constant time lookup.

I’ve seen every one of these things blow up on some programmer sometime in the last few years.

Some of our fundamental algorithms were developed when resources were much more constrained. This helps to understand the trade-offs made in those algorithms. It also becomes helpful when understanding a program that as suddenly run out of an infinite resource. I have sometimes solved problems based on an explanation of a technique from the days when main storage was tape.

Many developers are fond of tossing off the line Don’t reinvent the wheel when someone proposes recreating something they already know about. Unfortunately, I’ve also seen these same people re-discover ideas from the 70s, 80s, or even 90s. Many developers don’t have a good grasp of long-understood fundamentals, because they have only learned what they, personally, have coded. I watch programmers continue to make mistakes that I read about more than two decades ago, in books that were already a decade old.

Conclusion

Learning by doing is not a bad thing. In fact, I’d be comfortable with saying that you can not learn to program without writing any code. But, you will also never master programming without learning by studying what has been done by others. This is really no different than any other discipline.

Leave a Reply

Your email address will not be published. Required fields are marked *