Artem Tyurin

Advent of Code 2017

January was about collecting stars. First by writing code, then in Mario Odyssey (well, game calls them moons).

Quite past the December, but I finally collected all 50 stars in Advent of Code 2017. In case you’re not familiar, it is annual set of total 25 code problems, similar to Project Euler or Google Code Jam.

I picked Go this time instead of JavaScript which I used for previous 2 years of AoC. My overall impression is very positive. I didn’t measure time spent on each attempt, but overall it seemed that there were less silly mistakes thanks to static typing.

Best three puzzles: day 23, day 18, day 13.

Features I missed from JS:

  • map/filter/reduce pipeline
  • ternary operator
  • easier immutable handling for arrays and objects (spread operator)

What I liked about Go compared to JS:

  • structs as keys in maps, together with structural equality
  • defaults for basic types

Go WTF’s:

  • interface{} type seems like a hacky solution for union (sum) types
  • no min/max/abs functions for int 😱

My language candidates for next year challenge: Kotlin, Reason, Swift, Rust.

GitHub repo

Posted January 27, 2018

See other notes

Blog comments powered by Disqus.

Contact me

Email, GitHub