Skip to content

adamgauthier/advent-of-code-2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2020

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

This repository houses my solutions for the 2020 Advent of Code event. See the official website for more information.

Motivation

I use Advent of Code mostly to get familiar with languages which I have always wanted to learn or experiment with but never had a specific project in mind for. This is a fun way to keep up with modern languages that I don't get to use in my day to day life!

This year, a colleague jokingly challenged me to complete a day in F#. I'm pretty familiar with C# and had some interest to learn more about functional programming languages. I decided this was the ideal moment to learn F# and accepted the challenge, but for as many days as I could!

Takeaways

Unexpectedly, I ended up liking F# more and more as the days went by. I had done a bit of OCaml in school and my memories of it were somewhat negative. Maybe I was not ready to dive into the functional paradigm back then or my teacher did not frame it in a way that hooked me in.

F# often forced me to think of problems with a recursive approach, rather than using loops like I would intuitively in C#, for example. It was harder at first, but I feel now like have the ability to see both perspectives and have new tools in my problem-solving toolkit.

A lot of Advent of Code puzzles are ideal to showcase the benefits of using a language like F#; even as a beginner, it felt like some of my solutions were much more leaner, expressive and idiomatic than if I would have written them in C#. I often hear about how useful functional languages are with immutability by default and their powerful type systems, but solving 25 days of puzzle with one made me understand it in practical terms.

Overall, I really enjoyed how well integrated F# is with the .NET ecosystem I'm already familiar with. This means I can use the same NuGet packages I would in C#, use the same command line tools to build/run/test the code and work with the same project system I know from .csproj files. All of that while benefiting from a functional language, amazing! I have a feeling it's not the last time I work with it!

About

My solutions for Advent of Code 2020

Resources

License

Stars

Watchers

Forks

Languages