April 24, 2022•873 words
- Secure by default. No file, network, or environment access, unless explicitly enabled.
- Ships only a single executable file.
- Has built-in utilities like a dependency inspector and a code formatter.
- Has a set of standard modules that are guaranteed to work with Deno.
The trade-off is that, of course, you need to put more information about your code in a way that your editor can follow along. In this case, by defining types for your variables and describing how your objects are structured, you allow Deno's LSP (Language Server Protocol) to catch inconsistencies between what you expect of your variables and what you're doing with them. That's the thing with types, as with most things in programming: you think you need to do this because of the stupid computer, but it's actually for your benefit, you who will have to maintain this code. Much like good variable naming dispenses with a lot of comments, well-arranged types add implicit meaning to your code.
You can check out my 2021 Advent of Code in this repository. I knew that the puzzles would most likely lead me to stumble around my first attempts at Typescript as they're very much about working with large amounts of data until the correct answer falls out. But I also wanted to kick the tires of Deno itself, so I started working on this project before the Advent actually started. To save time getting myself going every day, I created a way to download each challenge that is published each day on the event's website. I had zero experience with the event, so I also expected to make a lot of adjustments to this workflow, which is fine. This gave me a reason to try out Deno's standard modules to do basic things like fetching files from the internet or managing some project folders.
My impressions of the event itself were positive, but I already had expectations that the difficulty curve would quickly increase and leave me behind. Everything was relatively new to me, which made it primarily a learning experience and not so much the thrill of solving puzzles. I also now understand the attraction that events like Advent of Code have for a lot of programmers: unlike most of what we do in our jobs, there is a definitive correct response for each problem and you can solve it in any way you like. I personally, on the other hand, kind of like the murkiness of delivering a solution that in real life is always not quite right and so we need to build upon it in feedback loops (as revealed by making a project out of the workflow itself). So I had no gripes with having it be about the journey just as much as ticking days on a calendar.