DEV Community

Cover image for My Advent of Code 2019 Approach
Dave Follett
Dave Follett

Posted on • Originally published at davefollett.io on

My Advent of Code 2019 Approach

2018 was my first experience with Advent of Code. It sounded like Codewars, so I jumped right in. Wow, I was really impressed. Not only were the puzzles fun, but I really like these aspects as well:

  • Most of the data sets are large, your algorithms and data structures matter. With modern computing, it can be easy to skip or not be worth the time to optimize code. But this doesn’t mean we shouldn’t practice it and the Advent of Code puzzles tend to put you into situations where it’s necessary to do so.
  • The puzzle descriptions can be long and contain lots of details not necessary to solve the puzzle. Some folks don’t like this but I do. Raise your hand ✋ if you have been given a vaguely worded specification that you have to comb through to find the real requirements. Like it or not, some degree of detective 🕵️ work is part of a software developer’s job.
  • Each day’s part 2 puzzle provides a twist on the part 1 puzzle. Sometimes its a small adjustment to solve part 2, but sometimes it’s a near rewrite. Though making a major change can be frustrating, this frequently happens for software applications whether it be the customer changing their mind or through the addition of new features.

🎄 2018 Approach 🎄

I didn’t have much of an approach last year, but I did decide to do the following:

  • Use JavaScript as my language.
  • Do all development directly on CodeSandbox using the NodeJS template. The idea here was to avoid setting up a local development environment, but still have an easy way to share my solutions.

🎅 2019 Approach 🎅

  • Be more organized. Last year, I was careless by not using version control, sometimes I broke part 1 to solve part 2, and it was hard to make my code run different solutions. This year I’m not doing those things and my code can be found in the following GitHub repository:

  • Setup a local development environment but still upload it to CodeSandbox. I decided to build on last year’s NodeJS web application by adding ExpressJS and making it more visually appealing (thanks to NES.css). Check it running live on CodeSandbox below. It’s also easy to run locally.

  • Don’t stress out about it. Last year, I put too much pressure on myself to solve each day’s puzzles as quickly as possible. This year I want to focus on creating good working solutions. If I get them done the same day they release, great. But if not, that’s okay, too. The creator of Advent of Code, Eric Wastl, recently gave good advice regarding this on Twitter:

AdventOfCode tips:

  • Focus on learning; don’t worry about the leaderboard.

  • It’s okay to skip puzzles!

  • It’s okay to ask for help!

  • If you don’t know how to solve something, try breaking it into smaller parts. Repeat as necessary.

You’ve got this! 🌟

@ericwastltwitter.com/ericwastl/status/1202297198236573697

🤔 Parting Thoughts 🤔

That pretty much wraps up how I’m approaching Advent of Code this year. Last year, I earned ⭐⭐ on 10 of the first 11 days (I completely skipped day 9). I hoping 🤞 to do about that well this year, but I’m not going to sweat it if I don’t.

Good luck and feel free to contact me if you need any hints or help.

Top comments (7)

Collapse
 
craigmc08 profile image
Craig McIlwrath

This is my first year doing it, and I chose Haskell for it. I'm stil learning it, so my focus is more on solving the challenges than optimization.

I thought about doing Javascript, but I decided that would be the "easy" way out 😂

I'm also keeping a git repo for my solutions.

I'm keeping each day separate, but I have a feeling that my IntCode interpreter will be a recurring component...

Collapse
 
davefollett profile image
Dave Follett • Edited

I think AoC is a great way to learn a new language as long as you don't stress out about your pace. But whatever language you use, AoC will definitely sharpen your skills with it.

By the way, JavaScript isn't the "easy" way out for me. 😜

Collapse
 
craigmc08 profile image
Craig McIlwrath

Yeah I'm not too worried about pace, just want to solve them all.

And when I said easy, I meant for me I wouldn't really need to think about the language, just about the puzzles.

Collapse
 
hexin profile image
Kacper Kaśków

I decided to learn some new language during AoC (golang). The puzzles take more time than usually, but I have double fun.

Collapse
 
heartyhardy profile image
Charith Rathnayake

I'm learning Go by doing the puzzles. Maybe not the best language to use if you want to finish them as soon as possible. I'm just going to take my sweet time and solve them all. :D

Collapse
 
thejoezack profile image
Joe Zack

🤚🤚🤚🤚

Collapse
 
davefollett profile image
Dave Follett

I did a bit of advanced prep to get things setup before Dec 1st so it would be easy to focus on the puzzles. Ironically, I'm much more experienced with C++ than JavaScript.

Good Luck!