Bugs in the Code

 

This quarter, I decided to take CS106B at Stanford. A step above its popular counterpart, CS106A, this class dives more deeply into programming through the C++ language, covering more abstract data types (ADTs), recursion, binary search trees, graphs, and inheritance. After a three-year-long hiatus between taking CS106A, my style starting off was a little rusty, but a good amount of time spent writing algorithms in R (or doing various econometric things using STATA) meant that my ability to write and solve coding challenges hadn’t degraded.

One of the biggest frustrations when coding an assignment is when you know that there’s an error in the code’s functionality, but can’t quite pinpoint how to resolve it. Sometimes, I can solve large sections of my assignments in minutes; other times, a small but critical component can take me hours to resolve. There’s an agony and ecstasy to realizing that one tiny change can dramatically alter the functionality of your algorithm, but sheer perseverance isn’t always the best way to find triumphs.

Some of my best breakthroughs occurred just from taking a short break to mull things over in the back of my mind. By opening yourself to the world around you, creative ideas and insights can begin to take shape, puzzle pieces that shift and reorient the systems of logic fundamental to computer science. Just the other day, as I headed upstairs to a friend’s room in my dorm, idle associations to friendship lingering in my mind ended up helping me resolve a particularly tricky portion of my code. From a long conversation late at night to a tranquil afternoon biking through the quaint neighborhoods in Palo Alto, different environments help me continue to unravel the logic in my problem sets, and the rules that underlay our world.

After all, bugs in the code of a homework assignment are relatively easy; someone’s solved it before, so you know an adequate solution exists, even though your path may not be the same. In the real world, a few searches through Stack Exchange could solve many problems (I refrain from these outside sources to avoid violating the Honor Code, of course), but there are always more questions that no one has managed to unravel yet. For questions about life, trying to resolve “bugs in the code” we find ourselves in, we have no manual to walk through solutions step by step. Instead, we can take mental breaks, open ourselves to new possibilities, and, with time, we can work to resolve the tricky problems in real life, too.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s