Live data from Hacker News

Advent of Code 2024

adventofcode.com

381–390 of 580 posts

Re: Advent of Code 2024

#381
post #159

I usually do AoC in Common Lisp, but this year I'm giving Swift a chance. It's not half bad at this kind of twiddling for being a statically typed mainstream language. https://github.com/codr7/aoc24/tree/main/swift/Sources/aoc This year is a tiny bit weird, I was just getting ramped up organizing the event at a new job; because I think it's very useful for devs to learn some real problem solving, as opposed to stitch…

I enjoyed reading your solutions! I’m surprised how terse they are!

Lovely! I try to strive for readability first and foremost, which is a challenge in itself.

Re: Advent of Code 2024

#382

I love AoC! Did it the last 2-3 years in Rust, hanging out in a discord where we all try to make the absolute fastest solutions. Learnt all kinds of crazy performance hacks and some advanced algorithms & SIMD that way. This time I'm trying to do them in Rust and Golang in an effort to either learn to like/tolerate Golang (because we use it at work) or prove my hypothesis that it sucks and never use it unless I have t…

Interested by your rust speed approaches, care to share a link ?

Re: Advent of Code 2024

#383
post #208

Earlier quoted context omitted.

One reason I didn't enjoy it was that I felt the days don't build on each other well. So you get little code reuse. It was continually changing requirements, so it was especially like work.

In 2019 he built up about 12 challenges using a VM, for Intcode, you had to construct. It was poorly received because without a working version (developed over the first few Intcode challenges), you couldn't solve the rest of them. He hasn't done anything like that since, though I thought it was probably the more interesting series of challenges. The problem with continuity across days is that the later days can be b…

People are skipping days? I usually drop out when I'm stuck on some day. 2019 was my favorite.

Re: Advent of Code 2024

#384
post #215

Earlier quoted context omitted.

I re-read the intro and the fact it mentions leetcode and the like was enough for me to decide that it's an ultimately pointless endeavour for me. I have no interest at all in competitive programming or maths; I spend 40+ hours a week doing programming for work, I want games and challenges that pull me away from that so I continue to have a life outside of my job.

For what it's worth, I hate leetcode with a burning passion, have no real interest in math, and yet I personally find Advent of Code quite fun and enjoyable.

Same, I've been coding for 40 years and I still learn plenty every year.

Re: Advent of Code 2024

#385
post #378

Earlier quoted context omitted.

Claude will do it for you.

What is the point in doing a programming challenge if you aren't learning anything

Depends if you're really stuck on a problem. I'd rather learn by getting a look at how it's done, even if the code is incorrect, than be completely suck with no idea why or what to do.

Re: Advent of Code 2024

#386
post #149

Earlier quoted context omitted.

Only year I ever completed it it took eight months. I’m not seeing my name on a leaderboard any time soon.

Oh yeah, me neither. The competition is far too intense. What takes me hours takes the competitors minutes.

I actually made somewhat of an effort this time, made sure I was awake in good coding shape when the problem was released. Had a scaffold set up for running the code based on previous years. And I'm a pretty decent all-round coder, should be by now.

Ended up at around spot 6500.

Boggles my mind to even imagine what it would take.

Re: Advent of Code 2024

#387

Earlier quoted context omitted.

It ate my life for a few years in a row, I even managed to finish on Christmas eve twice. Now I don't even look, it turns from fun to stress rather quickly.

I just do the puzzles until it stops being fun. For me that's usually around day 14.

Goes up and down for me, some I enjoy a lot, some are mostly painful details to get right.

Re: Advent of Code 2024

#388

This years challenge for me: write it in C without the standard library or an allocator. Has to be runnable on an STM32 with 32kb of SRAM. I tried doing it in Assembly two years ago, ended up spending hours and hours writing an Assembly standard library, then gave up and switched to Rust...

Good luck! Personally, I'm still going with CL but decided to try it in all the languages I "know" for the first day. Including C which doesn't have hash tables (inb4 hsearch)... what a pain, let me tell you. https://git.sr.ht/~q3cpma/aoc2024/tree/master/item/01 If you could post a repo link so I can look at some of the progress, I'd be grateful.

- bsearch + qsort is a great way to implement associative tables

- you can implement a hash table in C in about 125 LOC and reuse it.

- hash tables are not the only way to solve problems. hammer/nail

Re: Advent of Code 2024

#389
post #222

Earlier quoted context omitted.

There are some "filter" days for sure, usually those are when the solution needs a major leap in your approach such as concurrency, dynamic programming, or geometry equations.

It's usually not concurrency FWIW, it's almost always algorithmic in nature. On a modern machine, even highly concurrent* code would only execute 10-20x as fast and you could just wait a bit. One common AoC trick is that you can brute-force part one (e.g. O(n^2) complexity or worse), but part two scales up `n` to make that intractable. *ignore my sloppy conflating of concurrency and parallelism

I very much enjoy the cat and mouse game of assumptions regarding part 2, it always makes me happy when the second part is just a simple adaptation of the existing solution.

Re: Advent of Code 2024

#390
post #215

Earlier quoted context omitted.

It ate my life for a few years in a row, I even managed to finish on Christmas eve twice. Now I don't even look, it turns from fun to stress rather quickly.

I re-read the intro and the fact it mentions leetcode and the like was enough for me to decide that it's an ultimately pointless endeavour for me. I have no interest at all in competitive programming or maths; I spend 40+ hours a week doing programming for work, I want games and challenges that pull me away from that so I continue to have a life outside of my job.

I have enough side projects on the back burner as it is. I even picked up a data processing one over thanksgiving.
Post reply on HN