How teaching can make you a better programmer

Learning how to code in San Francisco has become as hip as learning to how to DJ or eating $4 toast. From investment bankers to artists, everyone wants to beef up a skill that now seems as necessary as knowing how to read in this city’s startup fueled economy. With coding schools boasting job placement rates as high as 98% for graduates, and starting salaries as high as $110k, the rewards for learning how to code are instant and tangible.

\"code\"

But what does this mean for those of us already in the tech industry? I think it’s a great trend but in many ways I’m envious. For existing engineers, deepening our understanding of code requires nights and weekends of self-study and spending many hours struggling to contribute to open-source projects. New students get the luxury of focused learning and the benefit of putting it into practice immediately. It’s often tough for us seasoned engineers to go into a mode of pondering rather than implementing, and even harder to know what you need to learn without proper instruction.

This problem is even worse for web developers, where the number of new technologies grows every day and it’s difficult to figure out how they fit together.

There’s an old saying that the best way to learn something is to teach it to others. I don’t think that’s true for all subjects, but it’s definitely true from my experience teaching web development at General Assembly.

Seven weeks ago, I embarked on a journey teaching 20 adult students for General Assembly’s front-end Web development program. As I end my semester with them, and they walk away with an entirely new skill set that will catapult their careers, I can wholeheartedly say this experience has catapulted my ability to contribute as an engineer.

Here are the 3 key lessons I’ve learned from my students:

I’ve come to realize my own prejudices and assumptions

I first started learning computer science in Java. I then progressed to JavaLogo and then SmallTalk. I did a short stint in Scheme but my bread and butter is object-oriented programming languages. JavaScript is a whole other world. I struggled to explain why you would ever want an anonymous function. After all, the syntax is more confusing and you might lose your function. Initially, I could only come up with an excuse that sometimes you use a function only once.

After barely believing my explanation, I’ve had to study up and internalize that anonymous functions are part of the beauty of functional programming. They give you more flexibility. You can pass in functions as arguments to other functions and write your code in a more declarative way. Through teaching JavaScript, I’ve finally internalized and learned how powerful JavaScript is, and am able to use it in a much more efficient way.

There are some things we take for granted

I knew conceptually that there was a call stack but I didn’t think too much about it. Its sole purpose was to show me where a runtime error might have originated. As I was showing my students an example about a function that returned a different function that referenced an argument to the initial function, they mimicked their heads exploding.

Even after numerous explanations about control flow and how functions are also values, the material just didn’t click with the students. Finally, the aha moment came when my teaching assistant drew a stack on the board and demonstrated how functions get put on the call stack when they’re called and popped off when they are done executing. That was something that I had internalized a long time ago but hadn’t thought about in a long time.

Teaching my class has made me contemplate how things actually work and what’s going on in my computer as I run a program. Every time I explain a new concept, I get immediate feedback on whether my explanation makes sense and I solidify my own understanding of the concept.

It’s okay to admit you don’t know

There’s a lot of ego in tech. I graduated many years ago from MIT with a degree in Math with Computer Science. I started coding when I was 13. Obviously, my mental model for runtime environments should be solid. After all, I’m the one standing in front of the class, trying to spread my wealth of knowledge. But there’s a big difference between being a practitioner and truly grasping the theory behind something. As you’re teaching others and helping them make associations, you need to have a solid foundation in the theory behind what’s going on behind all the abstraction.

I’ve spent entire nights and afternoons re-learning the theories behind programming so I can explain it to my students. Before I started teaching, I would have glossed over my own shallow understanding and excused it by thinking, “Sure, I can implement a website — what else do you need?”

So you might be thinking, what does a deeper understanding get you in coding? Weren’t you a perfectly functional practitioner before? With my new solidified understanding, I can now read through source code and construct a mental model much faster (and more accurately). I’m able to have more productive and meaningful conversations with my collaborators. I never previously considered contributing to large open source projects because I was intimidated and didn’t know where to begin. Now, I find myself enjoying reading source code and I imagine that in the next couple of months, I’ll make my first commit to IronRouter (the main router project associated with Meteor, a JavaScript framework).

I’m currently working on an educational platform for practicing software engineers to grow and sharpen their technical skills. Every other field has training programs to level up their existing workforce, whether it’s an executive MBA program or a leadership retreat. Once in a while, developers might get sent to a conference but deep learning often doesn’t happen there. I’m creating a platform that allows developers to learn and understand new concepts on their own time and through a new medium.

By supplementing my product development with part-time teaching, I’ve been able to put my theories into practice and the results have been outstanding. I’m not exaggerating when I say that one of the best feelings in the world is that moment when you look at a beautiful website and think, “Damn I wish I could make that” and then realize that it was made by a student who learned web development from you.

Reposted from http://venturebeat.com/2014/09/14/how-teaching-can-make-you-a-better-programmer/

Scroll to Top
Scroll to Top