Day 6 of Advent of Code completed in record time (less than an hour). Part 2 took me maybe 5 minutes of adjustment, which was surprising.
My knowledge of Typescript is no longer holding me back, I can largely manage without searching for common things.
I think my number of searches this time was 2. First to see if there was a built in zip() function like python has (no) and then second to verify the syntax of filter() on an array.
I feel like I'm back writing Perl again with lines like this:
Number(line.split(":")[1].trim().split(" ").filter((e) => e != "").join(""))
Day 5 of advent of code done. Today was the dumbest parser yet. It was a few characters off of being valid yaml, but alas.
Today was also the “datasets so large they overflow common data structures” day. So iterating over all the generated elements took 900 seconds or so in Typescript.
I *almost* didn’t do it, but after doing the parser the actual algorithm was super easy once you read the dozen paragraphs it took to explain how the obfuscated input worked.
I love programming -_-
Day 4 of Advent of Code done with Typescript. Lessons learned:
1. console.log() is super slow, I thought a recursive function was blocked, but it was just really slow. I took out the logging and it came back in a few seconds
2. typescript has "sets" but they don't have a built in way to do intersections... I know an array of unique values can be useful for the uniqueness, but comparisons are a pretty valuable part of sets.
3. I still hate typescript and I refuse to learn the difference between var and let until it bites me
My biggest problem with Advent of Code is that the largest amount of difficulty comes from parsing their irregular inputs.
This is why most systems have regular inputs with quality parsers now. I have plenty of shit to say about JSON but it's not
467..114..
...*......
..35..633.
......#...
617*......
.....+.58.
..592.....
......755.
...$.*....
.664.598..
Like... seriously... this is the input for a problem of "collect the right numbers and add them up", which is basically what the past two days were, the increasing difficulty is the dumbness of the inputs.
Day 1 on Advent of Code done with Typescript. I hate it. It really is just javascript with some shitty typing added on top and kinda-sorta some QoL improvements.
I'm not really looking forward to tons of string parsing with this garbage.
But this is how we grow as programmers, right? By challenging ourselves?
It’s time to pick another shitty language* I don’t already know to do Advent of Code.
I did Elixir last year so I don’t want to do another functional language. Typescript has some direct application to some work I’m doing, but only kinda.
Maybe it’s the year to learn Rust and then pretend like everything should be written in it?
Should I go super cozy and try Perl 6? I know Perl, but from back in the 5.0053 days.
Decisions, decisions.
*all programming languages are shitty