The Case Against Learning On The Fly

The Case Against Learning On The Fly

After my 34th commit to 10 lines of simple JavaScript, I had to admit something to myself: “I have no idea how any of this works.”

And while that should’ve been obvious, I’d stubbornly convinced myself that I could troubleshoot and Stack Overflow-ify any problems that came my way.

The result was a scrambled piece of spaghetti code that worked 80% of the time, probably just by sheer luck.

And this is a common issue in self-teaching, because we’re naturally eager to get to the part where we make something ourselves and see the results. But as numerous Stack Overflow threads will show, if you copy and paste code and say “why won’t this work,” you probably skipped over the vocabulary needed to understand why it doesn’t work.

And I was 100% guilty of this. I had no idea what it meant to “use functions.php to hook into an action and post form values”. And while I might’ve been able to Google all the foreign terms in a suggestion, it would still leave me with a fragmented understanding of a subject. Without a fundamental understanding of how everything is working, I only had these small pockets of knowledge with nothing connecting them.

I could explain to you how posting a form to PHP works, but I couldn’t tell you a thing about PHP syntax or concepts. I could explain how to modify an existing stylesheet, but setting breakpoints with media queries was an enigma.

The worst part is that I thought I was learning the fastest way. But I was actually setting myself up to spend much more time overall by having to relearn these things.

After hitting enough walls, I took a step back and tried a few online instructional courses. I made sure to find ones that included actual instructors who explained how things worked.

I spent about 10 hours taking JavaScript courses. Then I went back and tried to tackle the simple script that had refused to work when I’d tried previously.

Obviously, the difference was night and day. I was embarrassed to look over my previous code, seeing how repetitive and sloppy it was. I cleaned it up significantly, added some comments to make sure I knew how it was working (similar to rubber duck debugging) and was able to make it work in 10% of the time I had spent trying to fix it before.

To clarify, I don’t think there’s anything wrong with following along and applying ideas as you learn them. I would say that’s the ideal model, and is frequently used by online courses in the form of “code tests” and the like.

But my plea to budding developers is this: Learn, then apply. If you try to apply, learn, then apply again, you’ll quickly burn out and become frustrated. Or worse, you’ll think you know what you’re doing and add a bug at the expense of your sanity.