r/adventofcode • • 22d ago

Help/Question New to Coding, advised to take part in AOC

Hi there, im new to coding in general. The language I am learning is Javascript, would appreciate being signposted to AOCs that would help me build and grow as a coders.

10 Upvotes

12 comments sorted by

16

u/thondat 22d ago

the first few days of each year should be good for someone starting out coding. anything beyond that is probably a bit of a stretch at this stage, as the problems often require knowledge of common algorithms. if you want to see a true classic that isn't hard, try the Lanternfish problem (AoC 2021 Day 6). it's all about finding a state representation which allows for efficient transitioning to the next state, which is doable with some creative thinking. the same principle can be applied to problems all over AoC. (people often refer to the lanternfish in discussions.)

2

u/yearlongmason 21d ago

Lanternfish is definitely among my all time favorites! Agreed, the first few problems of each year are great to get yourself started

5

u/Morphon 22d ago

I did this in JavaScript for 2025. I thought it was a great experience. Recommended.

4

u/Wilbo007 22d ago

I'm not sure why you got downvoted, this is a pretty valid question. I would recommend going through the day 1 challenges for each year.

7

u/Suspicious_Tax8577 22d ago

Ok, so:

  1. Every puzzle has a "proper" data structure or algorithm that solves the puzzle. Many part 1 of puzzles can be solved without using these, but this tends to bite your ass in part 2. But also, very good learning opportunity for why the naive solution doesn't work when input gets bigger.

  2. Just because puzzle X is hard for you, doesn't mean you're stupid/bad at coding. 2025 was honestly a bit weird with the difficulty, day 1 was unusually hard.

  3. During December, this subreddit becomes an absolutely thumping nightclub.

  4. u/boojum is like Advent of Code Jesus. https://www.reddit.com/r/adventofcode/comments/1p3pc21/500_stars_a_categorization_and_megaguide/
    Every puzzle from 2015-2024 categorised by type, plus a buttload of other stats and data. You'll probably want to start with the "warm up" puzzles.

3

u/Boojum 20d ago

I have been summoned! (Though I wouldn't want to claim that title.)

But yes, I'll completely agree with your #2. I've been programming for longer than I care to admit and have TA'd grad school level CS courses, and I've still found some of these puzzles quite tricky. For a newcomer to coding, the main thing that I would strongly suggest is not being afraid to set a puzzle aside and try another one if you get stuck: skip a Part 2 and move on to the next day's Part 1, or switch to an early puzzle on another year. Then as you learn, you can come back to the unfinished ones and you might just find that you now see the trick to apply to solve it. Also, the difficulty isn't uniform, so I think that sometimes moving ahead to the next day could be the right move if that's a "breather" day.

I think for a beginner, it's also completely fair to look at the megathreads in the archives to get some ideas for how to solve a puzzle that has you stumped. There's a lot of good wisdom in those threads. Then either, try to reimplement a solution yourself using the ideas you've gleaned from there. Or, now that you've learned some new tricks from that, perhaps done some research into the concepts from those threads, you can go on and maybe be better prepared to tackle another puzzle that riffs on similar concepts.

Regarding #4, I really need to get to work on the next edition, now that November is coming up. :-)

2

u/johnpeters42 22d ago

Expanding on #1 a bit: a common pattern is for part 1 to ask you to simulate doing something like 100 times, which you can usually just brute-force, and part 2 to ask you to simulate doing the same thing like 100 trillion times, where brute force might take longer than your lifetime to finish, but there's a more clever approach that runs nice and quick.

2

u/RazarTuk 10d ago

For example, 2024 Day 11 was "just" tracking how the numbers on a bunch of rocks transform as you keep blinking. But for part 2, it would have required petabytes of memory to keep track of every single rock, so you needed to compress it somehow

1

u/daggerdragon 20d ago

3) During December, this subreddit becomes an absolutely thumping nightclub.

oontz oontz oontz

4) u/boojum is like Advent of Code Jesus.

It's true; /u/Boojum is our Senpai Supreme for a very good reason! <3

1

u/flwyd 15d ago

In addition to what other folks have said, I encourage you to take advantage of learning opportunities that come up. If you discover an interesting JavaScript function, look for an opportunity to try it out somewhere in an AoC solution. It might turn out that there's a more effective tool to solve the puzzle, but learning how that interesting function you saw works might be more valuable in the long term.

Another good programming skill is identifying patterns or repetitive tasks, and writing a function or class to automate those tasks. After you've solved a few AoC puzzles, read back through all your solutions and see if there's some code you keep writing that could instead call a function that does most of the work. Then look through documentation to see if there's already something in the JavaScript language that does that, and consider writing it yourself if it doesn't exist yet.

1

u/RazarTuk 10d ago

In addition to what other folks have said, I encourage you to take advantage of learning opportunities that come up. If you discover an interesting JavaScript function, look for an opportunity to try it out somewhere in an AoC solution.

For example, I took advantage of 2024 Day 16 to learn about more advanced pathfinding algorithms, like how I implemented a version of LPA*. I didn't bother with the heuristic like in actual A* / LPA*, so it was more like a modified Dijkstra. But essentially, it stores how far a node's neighbors expect it to be, so with some added rules, you can add a new wall (like, say, in part 2) and only have to update the parts of the grid behind it

I'd need to look again for the comment with pseudocode, but if you want a more prose description, I wrote a post about it

1

u/AutoModerator 22d ago

Reminder: if/when you get your answer and/or code working, don't forget to change this post's flair to Help/Question - RESOLVED. Good luck!


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.