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 (8)
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...
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. π
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.
I decided to learn some new language during AoC (golang). The puzzles take more time than usually, but I have double fun.
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
π€π€π€π€
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!