/advent-of-code-2017

Advent of Code 2017

Primary LanguageElm

Advent of Code 2017

I'm mainly using this as an avenue for exploring different languages. In general, because of limited free time, I try to solve the puzzles as fast as possible. This usually means we end up with write-only code, low abstraction, no bench-marking or optimization, little regard to factoring, no tests.

The puzzle-solving aspect makes the process slightly more rewarding than stuff like Exercism, though I still enjoy Exercism-style exercises quite a bit, too.

Languages used so far:

  • ClojureScript
  • Coconut
  • Elixir
  • Elm
  • Go
  • OCaml
  • Python
  • Ruby

Observations:

  • Elm's compiler is still a lot of fun.
  • planck makes ClojureScript easy and friction-less, I really enjoyed it.
  • Elixir, well, I'm somewhat equivocal on, though it has some cool stuff, and the docs are quite good. I'm going to do more of it.
  • Having automatic code formatting (as you do with Elm and now Elixir), especially when it is integrated into your editor on save, is so great.
  • When the going gets tough, and because I'm trying to solve the problems as fast as possible, my brain reaches for Python. It seems like I can brute-force a solution in heavily-imperative Python when other avenues are failing me. This is a bit disappointing and not at all surprising. I still like Python and still think it's probably the best choice for beginners.
  • I really do like functional programming. Going back to clumsy and impure styles of OO feels bad after immersing oneself in languages that encourage functional approaches.
  • I'm struggling to find a lot to like with Go. It's fast, but it seems to encourage behavior that feels dirty. I'll try to withhold judgment until I have done more.
  • I'd forgotten how helpful it can be to sketch a rough diagram on paper, especially when trying to visualize a data structure. And the higher rez and greater control afforded by pencil on paper, by comparison to marker on whiteboard, seems notable.
  • The OCaml tooling and docs take a bit of effort to get going with, and in my case, editor support isn't excellent. Having some Elm experience is proving useful when it comes to making the language feel less alien than it might otherwise (though the compiler messages leave a lot to be desired by comparison to Elm). It will be interesting to compare the overall experience against Reason’s. I'm finding that ocamlformat is pretty nice.
  • Using rbspy and flamegraphs to profile Ruby code was nice. It provided a really quick and accessible way to identify areas of extreme slowness that could be easily optimized.

Languages to try another year:

  • Reason
  • Swift
  • Rust
  • Kotlin
  • Haskell
  • C