How I became an Engineer (Part 2): Discovering Programming
This is a series on my experiences growing up that eventually led me to becoming an engineer.
My first experience with writing a computer program was in 4th grade. My mom offered to help me write a simple program in C++ that would act as a database for some of my toys. We sat at a computer together, and she pretty much told me what to type. I thought it was really cool and enjoyed it, but I didn’t really understand how the program worked. It was mostly magic to me, and I remember that being a point of internal insecurity for me when I described the program to others. I knew that there was no way I could make changes to the program or create something new on my own, which I think caused me to lose interest for some time.
I got a few other opportunities to program through elementary school and middle school, but things took off in high school. In 9th grade, I took a class that was structured as an introduction to a variety of different information technology topics. This included things such as Microsoft Office, and Photoshop, but they also spent 6 weeks teaching Java. Java seemed to come easy to me and I wanted more, so I decided to take AP Computer Science the next year.
I was a little intimidated to be taking my first AP class, so I did all I could to prepare the summer before. My mom taught herself Java so that she could help me, and gave me some assignments to work on. The most memorable program during this time was a text-based Yahtzee game. Users had to type in commands, to do things like roll the dice and to pick combos. The program only ended up being about a 1000 lines of code, but I spent quite a bit of time tinkering with it to get the text layout just right.
It turned out that the AP computer science curriculum didn’t assume any prior programming experience, so I started out the year way ahead. This allowed me to continue experimenting and writing programs on my own. As I learned about new concepts, it inspired new ambitious projects, which motivated more learning. Once I knew something should be possible, I would obsessively research and try to figure out how to do it. I found this process to be much more engaging than reading general programming books, since I had specific problems I was trying to solve.
This positive feedback loop took up much of my free time for the rest of high school, and produced dozens of programs of various size and scope. I created many little games, such as hangman and a game based on Phoenix (a popular graphing calculator game). Often, I wrote programs to help me with my other classes, such as a flashcard program to help me study the different forms of Spanish verbs. I learned network sockets by writing a file copier program that can copy files between two computers. I also dabbled in 3D computer graphics by writing something that rendered wooden children’s blocks using OpenGL.
The most complex program I wrote during high school was a drawing program, modeled after MS Paint and creatively named MichaelPaint
. It started out as something very simple once I learned how to render shapes on the screen and accept mouse input. It only supported a handful of shapes and was limited to saving images as a text file, which listed all the coordinates of all the shapes in the file. At some point, I rewrote it to support rasterized image graphics and to use better object oriented design. I wrote many of my own algorithms, either because I didn’t know that a library already existed or because I wanted the challenge. For example, I wrote library to read/write bmp image files, because I didn’t know that Java already had libraries for that (though it ended up being a good learning experience). Another example is I wrote my own circle drawing library, because I didn’t like the way the Java library rendered small circles. The final paint program was about 18,000 lines of Java code.
By my senior year in high school, I was certain that I wanted to do computer programming as a career. However, I wasn’t sure what I should study in college. On one hand, Computer Science seemed like the closest thing to programming, though I wondered if it was really necessary, since I (somewhat naively) thought I already knew how to program. On the other hand, both of my parents were electrical engineers, which seemed to serve them well, so maybe that would useful. In part 3, I will describe the experience that helped me decide.