r/adventofcode • • 13h 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?

27 Upvotes

22 comments sorted by

54

u/smallpotatoes2019 13h 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.

26

u/GrumDum 12h 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!

13

u/smallpotatoes2019 12h 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.

6

u/fett3elke 12h ago

Or in Excel

2

u/shagieIsMe 6h 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.

5

u/johnpeters42 8h ago

from functools import cache

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

3

u/otteydw 5h ago

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

2

u/fett3elke 12h ago

His / Her solutions are a work of art!

24

u/Previous_Kale_4508 11h 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. ๐Ÿ˜

4

u/JorganPubshire 1h 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

8

u/topaz2078 (AoC creator) 10h 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 8h ago

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

1

u/AutoModerator 13h 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 6h 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 6h 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/chic_luke 5h 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.

1

u/terje_wiig_mathisen 11m ago edited 8m 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.

0

u/notger 12h 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 12h ago

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

1

u/Suspicious_Tax8577 10h 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 3h ago

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