Live data from Hacker News

Advent of Code 2020

adventofcode.com

71–80 of 86 posts

Re: Advent of Code 2020

#71

Earlier quoted context omitted.

Not Slack, but this is what I did with colleagues last year (I first participated in 2018, got a group in 2019). It was fun, moderately competitive (between myself and one other guy, the rest were just solving problems but he is always competitive, and I like to goad him), and we got to teach some of the young guys at the office things they should've learned in their CS education (but somehow didn't).

> and we got to teach some of the young guys at the office things they should've learned in their CS education (but somehow didn't) What specific things had they not learned in their CS education/which puzzles utilized them?

I suspect that thy learned these things, but it didn't stick. From memory of 2018/2019 things that the younger colleagues didn't know (or didn't know well enough to get without prompting):

- When to use CFG versus regex for parsing. Many inputs could be parsed with regexes if you made certain assumptions and got lucky. But CFGs were much easier for some.

- Shunting-yard algorithm. This came up, I think, in 2018.

- Using fast/slow to detect cycles and cycle length (one step at a time versus two, when they collide you can determine that there is a cycle and then determine how long the cycle is). Most used a hash table/map but this was not effective (due to RAM requirements) for some very large inputs. This actually comes up a few times. Variants of game of life, or just numeric processes.

- Multi-threading. It was very useful to implement the intcode VM using threads in 2019. Everyone who tried to juggle state and run multiple VMs at a time struggled when we later had to have a large number of VMs communicating with each other.

- Maybe not CS proper, but typically covered as part of a CS curriculum in a discrete math course. Several times problems related to modular arithmetic and permutations came up. If you understood them, the problem was tractable. If not, you struggled and maybe solved it but it wasn't efficient.

- Various graph and search algorithms. Particularly A* and Dijkstra's. Looking back, it seems there were a couple maze ones in 2019 and several more maze/path finding ones in 2018.

- Sorting/ordering of graph nodes, specifically topological sort. If you know what it is, it makes several of the problems much simpler over the years. I think it was specifically used in 2018.

Re: Advent of Code 2020

#72

I look forward to Advent of Code every year. So far, I've used it as a way to learn new languages - I've done it in D, C#, Swift so far. I don't bother with the competition aspect, but I do have a few people that I bounce solutions off of. This year I'm taking a different approach though, I'm going to use it to re-learn an old language - UniVerse[0] Basic[1]. In my first IT job, I supported an in-house system that ra…

I do the same thing! One year, it gave me a reason to really understand Javascript. Another time I learned Go. Last year, it was the 50th anniversary of the release of the first PDP-11, so I'm still going through and writing the solutions in bare-metal PDP-11 assembly.

That's an impressive challenge!

How are you finding the challenges in PDP-11 assembly? Are there any unique things about the PDP-11 instruction set or architecture that helps in the challenges?

Re: Advent of Code 2020

#73
Very nice. I like to try doing these in a different language each year. Last year went very well with F#, let's see how this year goes with Haskell.

Re: Advent of Code 2020

#74
post #42

Why Advent of Code, how is it different to the million other coding challenges online? I never participated, only looked at some of the puzzles.

My experience of other coding challenges is: here's the problem, and you submit source code which is run against many test cases to confirm correctness. Advent Of Code only asks you to submit an answer, not source code.

Re: Advent of Code 2020

#75
post #52

Earlier quoted context omitted.

I always like to do some puzzles but it takes me quite long to solve them, so far I've burned out after a couple of days every year I've tried it. This year I'm going to try to use Elixir, a language I've started learning the past year, hoping I can at least get past day 5 this year.

I did it in 2018 in Elixir when José Valim, the language's creator, has publicly streamed his solutions [1] at mid-day (in Europe), so you had quite some time to resolve them yourself and then later watch him go through them. I will be forever grateful to him for this opportunity. --- [1] https://www.twitch.tv/josevalim/videos

Oh I didn't know he had a twitch, thanks for sharing!

Re: Advent of Code 2020

#76

Earlier quoted context omitted.

> and we got to teach some of the young guys at the office things they should've learned in their CS education (but somehow didn't) What specific things had they not learned in their CS education/which puzzles utilized them?

I suspect that thy learned these things, but it didn't stick. From memory of 2018/2019 things that the younger colleagues didn't know (or didn't know well enough to get without prompting): - When to use CFG versus regex for parsing. Many inputs could be parsed with regexes if you made certain assumptions and got lucky. But CFGs were much easier for some. - Shunting-yard algorithm. This came up, I think, in 2018. - Us…

Excellent comment, I did both parts last year up to day 17 and just had to stop, but learning about things like A* were really what made it worthwhile.

I have no formal CS training, but did a lot of online courses and so I use events like this to help plug gaps and learn new languages, and it would have been great to have a mentor like yourself through some of these puzzles last year as it can be quite hard to solve algorithm knowledge gaps etc. when also quickly trying to roll your own solutions.

Still, really a cool thing. I couldn't resist starting again today.

Re: Advent of Code 2020

#77

I've always found AoC to be added stress during a time of the year I'm not really running a stress-deficit. I find the competitive aspect a pretty big turn off. I usually get a few puzzles in and then burn out, because I can't keep up with the people who do it every day (I don't even use my computer every day). I wish the scoring didn't prioritize timeliness. This is really the sort of thing I'd enjoy cranking out on…

Well for me i am in a complete different time zone so I have not the possibility to do it exactly at the start time, even if i wanted it is the middle of the night ... (5 in the morning)

I do it when I have time for it and if I have time for it in the evening I have fun solving it. Last year I did a few once since i remembered these far to late but came till 10 ? challenge and forgott about it again till yesterday, and now try to follow up each day if i have time and want to and dont feel pressured by it it is for fun and maybe learning something new! I actually loved the aspect of writing half a interpreter last year I hope for something similar this year!

Re: Advent of Code 2020

#78

I've always found AoC to be added stress during a time of the year I'm not really running a stress-deficit. I find the competitive aspect a pretty big turn off. I usually get a few puzzles in and then burn out, because I can't keep up with the people who do it every day (I don't even use my computer every day). I wish the scoring didn't prioritize timeliness. This is really the sort of thing I'd enjoy cranking out on…

Yeah - it would be much more cool without leaderboards. I can see myself working on them late in the evening (after work and after I had my rest) but now I would need to get up at 6am to "stay in the game" :D.

Obviously, nobody makes me do that or compete, but it I don't do that, then it just feels like I am just a passive bystander instead of a participant.

Re: Advent of Code 2020

#79
AoC is great.

But I also think that it's a missed opportunity to measure productivity and runtime performance of programming languages.

In "Benchmarks Game" you get extremely optimized programs which is not usually achievable by an average developer. On AoC you would get a wide distribution of submissions and you could get the right estimate of how performant are the programs submitted by PHP, Python, or Rust developers.

I guess we wouldn't get to see people abusing mpz_add on Python or PHP that often.

Re: Advent of Code 2020

#80
post #55

Anyone else planning on rotating languages? I think that using a different language every day is too much of a stretch for me, but I plan to switch between C++, Rust and Julia.

Julia, Common Lisp, and maybe Haskell or something like that for me. I use Julia to get the correct solutions in a naive way, then I optimise the approach and compare the efficiency of the languages. It's pretty fun. Yesterdays puzzle was 0.0002 in Julia and 0.002 in CL for the exact same approach.
Post reply on HN