Mental Models (pt 1/4) — My Journey to Code
By: Andy Leroy
Tags: Mental Models, Learning To Code

I didn’t know what to expect in my first computer science class. When Mark Zuckerberg coded away on an all nighter and the Trent Reznor and Atticus Ross In Motion Social Network score slowly built to a crescendo and took over the entire movie theater a few summers earlier, I knew I had to learn how to code though. So when I was 24, I left my job in software sales, sold my belongings, and flew across the country to Boston to go figure it out.

I was betting a lot on this move and didn’t have any room for failure. In the weekends before my move and class start, I cobbled together a web based blackjack game after reading a book on jQuery. I figured out a way to upload my spaghetti code and the 52 card images I had saved to the domain I had purchased. And just like that someone could come to andysblackjack.com and play their hands, complete with an ongoing betting counter. It wasn’t pretty, but it worked.

So I was more than a bit excited that first day of class. It was only a matter of time before I would learn how to build the next facebook.

That first week we dove into the material. I was doing all of the extra credit and problem sets and reading and re-reading all of the lecture notes. But after the first week I was confused. We were doing all kinds of work with strings and arrays, and writing formulas to merge each of our characters and access different array elements. I plowed ahead, each day running my javac command over and over into my terminal, running my suite of functions.

After the second week I began to grow frustrated though. We had moved onto trees, but I couldn’t figure out what any of this had to do with building the next great app.

I had put a lot at stake for this. I was older than just about everyone in the class (who were mainly incoming freshmen), and I had left my job and city behind to move and begin a new career. So every day I would be the last one in office hours after class inundating my TA with questions:

Where does the binary search tree go in an app? When do we use merge sort on a website? Where are the buttons that use these constructors and static methods?

My TA was great, and he patiently would explain to me that computer science wasn’t just about apps and websites and that the data structures and search and sorting algorithms we were studying were all required to form a basic understanding of computer science and that computer science was not the same thing as an app. I was definitely a bit disappointed. The closest we got to an app was our final problem set to build a sudoku solver. But even that had to be fed prearranged text files of numbers.

And that was the end of my first summer and class. I had worked all hours of the day and night, on the weekends — studying everything to make it through all of the material. But I didn’t feel like I was much closer to building a website or an app.

My class program moved to the evenings, and I was able to find a job at a small company out in Cambridge that built custom plugins for Pharmaceutical companies to help them manage experiments. They had also started on building their own software product in ‘Ruby and Rails’. I didn’t have experience with any of those so I would have to start on the analytics and consulting side until I could prove I knew enough about Ruby and Rails to move onto the product development work.

That fall felt like I was late to the start line of a perpetual race. Every morning I would take the Red Line out to the last stop in Cambridge for work, where I would help design experimental data capture programs (I have no scientific background). After work, I would either attend my night classes or work on problem sets and class projects.

It wasn’t until one day at work that I took a book off a shelf in the break room and everything started to click. Michael Hartl’s Ruby on Rails Tutorial was exactly what I had hoped to find. At night I would read a chapter on the subway, and when I got home I would try to make it through the coding. Then the next morning on the subway, I would re-read and replay everything from the previous night.

In this book, the author — Michael Hartl — takes us through eleven chapters of building a clone of a twitter website. We start with a basic Rails website and add more and more complexity — a profile, posts, a timeline, follower requests, and user logins — before finally pushing all of the code up to a Heroku app plan website. Everything in this book was exactly what I had hoped to learn. And things started to finally come full circle from my classes. The array merge functions finally had a place I could mentally slot them away. I could attach the searching and sorting algorithms I had learned in class to a clear start to finish application. The object oriented design patterns could be applied to a full program. My journey to learn coding was starting to feel like a success.

This is a long story to make the point that context is everything. Without context, learning is challenging, communication is disrupted, and people can’t understand each other. The notion of put yourself in the other person’s shoes is often about empathy, but applies just as equally to helping communicate and understand ideas. For me, I had to see a basic app get created from start to finish before I could contextualize the details of various data structures and algorithms.

We all have our way of interpreting and understanding things — this is what makes us different. And understanding how each of us learn and process new information is crucial for growth. Part of what has been rewarding in my journey to learn ‘coding’ has been learning how I learn — and also realizing that this process will never be complete (not as rewarding on some days).

That’s why listening to the podcasts of technology leaders, watching youtube videos of great teachers and professors, and reading books from people who have done it is such a good way to learn. These people have the ultimate mental models to provide all levels of context for the rest of us. So with that said, we move to take a look at some of these mental models.