Algorithm of Code

| posted in: nerdliness  algorithm 

I’ve known about the annual Advent of Code challenge for several years. I decided to participate this year; I’ve been slowly teaching myself the Go programming language and this would be a good way to reinforce what I know. Or to discover what I don’t know.

My bachelor’s degree is in “Applied Computer Science”. I was in college from 1979 until 1983. While algorithms may have been discussed in a couple of courses, I did not have a course specifically about algorithms. I graduated with a college level understanding of COBOL, JCL, VSAM, IMS, and CICS. The next decade was spent honing my use of those tools.

The problem domains I worked in were centered around batch processing of transactions, we weren’t looking for the speediest way, or the most memory efficient way, or the least costly way to solve problems. We wanted reliable, durable, functional code to generate bills, update accounts, and manage assets. We wanted code that was easy to understand and work with at 3 am when your pager went off.

Fast forward 40 years to the Advent of Code, or as I am calling it in my head, the Algorithm of Code challenge. So far I’ve completed the first three days puzzles; 6 puzzles total. My solutions produce the correct answers, but they are not elegant or pretty. My approach is somewhat brute force. Effective? Yes, but I’m convinced that someone with a better grasp of algorithms would be able to solve these challenges with fewer lines of code, perhaps more efficiently.

Going forward I plan to alter my approach to solving the puzzles. If I realize that I need to find the intersection between three sets, I’ll search for “algorithm to find intersection between sets” and try to incorporate what I find into my solution. Once I have a feel for the crux of the problem, I’ll research to see if there is some known algorithm useful in overcoming that hurdle.

A couple months ago I discovered that FrontendMasters is offering a free algorithms course. I started to watch the first lesson, but life intruded and I haven’t continued. Over the extended year end break I want to try to complete the algorithm course to gain a better understanding of what they are an how to utilize them.

In the meantime, I’ll be plugging away at the next set of puzzles, and hoping to learn a bit more about programming.

Author's profile picture

Mark H. Nichols

I am a husband, cellist, code prole, nerd, technologist, and all around good guy living and working in fly-over country. You should follow me on Twitter.