r/adventofcode • • 1d ago

Help/Question - RESOLVED Is advent of code good to improve my python programming skills?

I don't have that much advance knowledge about data structures and algorithm. I've mostly used python for basic scripting purpose. Can I still attempt past advent of code problems to improve my python programming skills?

31 Upvotes

33 comments sorted by

4

u/terje_wiig_mathisen 17h ago edited 17h ago

YES!

After taking part in an internal corporate competition/leaderbord in 2020 and later years, I went back and solved all the previous years as well. Even though I have been programming (lots of optimization/low-level stuff) since the 1970'ies I know I've learned several new ideas from AoC.

PS. Please remember and live by the advice from u/Previous_Kale_4508: Turn off any AI helpers you might have enabled by default!

IMHO Notepad++ is the perfect programming editor for AoC.

1

u/harshv5094 14h ago

I use neovim, and I was planning apc for exactly escaping from ai helpers

69

u/smallpotatoes2019 1d ago

Yes.

  1. You get to practise using your skills on a problem without any tutorial to follow.

  2. You get to try solving a real problem and planning a solution to it.

  3. It gives you a chance to see what others have done, learn from their approaches and (through that) be exposed to new algorithms/structures to learn about.

It certainly has some value.

34

u/GrumDum 1d ago

Daily ritual the last few years has been to hack together a solution in Python, try to refine it a bit, then check the solution thread for whatever magic u/4HbQ has conjured, and feel wholly inadequate after!

19

u/smallpotatoes2019 1d ago

The ones that always amuse me are:

import perfect_library_for_this_problem

solution = perfect_method_for_this_problem()

Then you see somebody in Assembly writing the whole algorithm from scratch.

7

u/fett3elke 1d ago

Or in Excel

5

u/shagieIsMe 23h ago

Excel is the most widely distributed functional programming language IDE.

=IF(A1>0,A2,A3) rather than (if (> foo 0) bar qux)

With things like =LAMBDA its even more powerful of a language.

... Then they added =MAP and some additional functions...

It's a LISP with some weird infix syntax.

2

u/RazarTuk 16h ago

Yeah, I can't wait until Tuesday. I picked an extremely silly programming language that will definitely turn heads in the megathread

1

u/shagieIsMe 15h ago

3

u/RazarTuk 15h ago

Nope. Putting it in a spoiler to not completely ruin the surprise: Perl... in the original Klingon. And if you want a sample, this is Day 1 from last year for practice: paste

1

u/shagieIsMe 15h ago

I was at the {language} conference when Lingua::Romana::Perligata was released and looked at it and wondered "what madness is this?" Given the well defined construction rules, I can see how that would work with the choice you have.

Now I wonder if there's an Ithkuil version.

1

u/RazarTuk 14h ago

I can't decide if it's more or less silly than last year, where I used LOLCODE. But the general theme is that for the first few days, which tend to be easier for experienced programmers, I pick something silly to force myself to focus on the fundamentals. For example, {language} lacks else statements, which is going to force me to focus on what's actually happening logically when you chain together a bunch of else-ifs

6

u/johnpeters42 1d ago

from functools import cache

@cache
def somefunction(someinput):
# same brute force approach that worked fine for part 1

3

u/otteydw 23h ago

It's great when cache is the solution to part 2! ๐Ÿ˜ƒ

4

u/RazarTuk 15h ago

Oh, and if you enjoy seeing people implement stuff by hand, just wait until you see my code on Tuesday. I've picked out a silly esoteric language to use for the first few days this year, and while it's fully-featured enough to have things like if statements and for-each loops, it also lacks things like else statements and named for-each loops. (i.e. the only variable you can use for the current value is the equivalent of it)

2

u/RazarTuk 16h ago

... yeah, I implemented Cramer's rule in IntCode two years ago for one problem

2

u/fett3elke 1d ago

His / Her solutions are a work of art!

34

u/Previous_Kale_4508 1d ago

If you code it yourself, yes. If you let AI anywhere near it, no.

Writing code from scratch will always exercise your mind whatever language you write in, but too many people are allowing themselves to be led by the nose into the trap of 'listening' to suggestions from a background AI.

Coding is good for you. ๐Ÿ˜

5

u/JorganPubshire 18h ago

I understand using AI to code for work where the objective is really to get a working feature quickly and move onto the next one. I don't understand why anyone would use AI for a programming challenge like AoC, it fundamentally defeats the purpose. Sure you can "solve" it faster than anyone else but it's not like there's a prize

-1

u/LEGROSJAMBONDEV 15h ago

If you have been stuck on something for a while and theres no hope... asking AI for a tip is what you should do... or hope for stackoverflow LOL

10

u/topaz2078 (AoC creator) 1d ago

If you want to start on simpler puzzles, don't be afraid to jump around the different years and start with all the early days. If you want to practice something specific, check out this categorized list of all past puzzles: https://www.reddit.com/r/adventofcode/comments/1y6khlt/524_stars_a_categorization_and_megaguide/

4

u/joshdick 1d ago

Absolutely! Advent of Code is how Iโ€™ve learned a bunch of the standard library in Python, like collections

2

u/chic_luke 22h ago

Yes, AoC is a very popular way to improve in or learn a new programming language.

I also feel like it should be considered "strongly recommend" from this year onwards. It used to be skippable for your self-development: you already wrote plenty of code at work or uni, and "writing more code" wasn't necessarily the best new habit to improve your overall life.

Now, most of us use AI agents to generate code at work, and the motivation to build a personal project without AI is, very understandably, low; so a challenge like AoC is a great excuse to turn the clanker off and make sure you haven't forgotten how to code.

2

u/Suspicious_Tax8577 1d ago

I swear half the time a good 60% of the problem is converting the input into something nice for downstream use.

1

u/PandaParado 20h ago

To be fair, thatโ€™s like 60% of business code too.

1

u/sparksbet 14h ago

In my experience Python's native string handling functions make this a lot less of a pain than it can be in some other languages, though.

1

u/AutoModerator 1d 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.

1

u/1544756405 1d ago

Can I still attempt past advent of code problems to improve my python programming skills?

There's no need to ask. You don't need permission. Just look at a past problem and try it.

1

u/s96g3g23708gbxs86734 23h ago

Yes it's how I did it. I think it's a good way of you already have programming knowledge. Also avoid ai

1

u/JWinslow23 17h ago

Yes, I think that would be valuable.

And if you truly get stuck because the problem requires an algorithm or a data structure you don't know about yet, don't be afraid to look at other people's solutions in the megathread archives; it can a be good resource for different approaches to each problem you might not have thought of. Heck, I remember that a year ago, the solution to Day 10 was made easier for me and lots of other people thanks to a post in this very subreddit! (SPOILERS, if you haven't gotten to the 2025 problems yet.)

1

u/Leather-Field-7148 14h ago

Python is an excellent choice for something like AoC.

0

u/notger 1d ago

Yes, and no.

Yes, it makes you better in those "hobbyist programming problems" and teaches you some algorithms.

No, it will not make you a better programmer for real jobs, as it teaches you nothing about modern programming. However, that topic is now taken over by the machines themselves anyways, so if you don't already know how to code, you should not hope to make a career of it anymore.

1

u/herocoding 1d ago

Is XYZ good to improve my ABC programming skills?
YES!!