23
Found my old Python scripts from 3 years ago and cringed so hard
I was cleaning out my Google Drive last week and stumbled on a folder called 'first projects' from 2021. I opened up this script I wrote to calculate my monthly expenses and it was just 300 lines of if statements, no functions at all. Like I literally had separate blocks for rent, groceries, and gas instead of using a loop or even a list. I remember being so proud of it back then, showing my roommate how it worked. Fast forward to last month when I redid that same idea in maybe 40 lines using pandas and a CSV file. It honestly made me realize how much you pick up just by sticking with something, even if you feel lost at first. Has anyone else looked back at their early code and felt that mix of embarrassment and progress?
3 comments
Log in to join the discussion
Log In3 Comments
the_jana29d ago
Started digging through my old code from a similar time and found a script I wrote to rename photos from my phone. It was literally 200 lines of if-elif chains checking file extensions like .jpg and .png one by one instead of using a simple os.path.splitext() call. I even had a separate function for each file type that did the exact same renaming logic just copied and pasted. My roommate at the time asked why I didn't just loop through the folder and I got defensive about my "elegant solution." Now looking back I see the cringe but also remember how excited I was when that thing actually worked and didn't crash.
2
knight.felix29d ago
Oh man, that hits way too close to home. I did the exact same thing with a file organizer I wrote back when I was learning. Had a 150 line block of if statements checking file types and calling separate copy-pasted functions. My buddy kept asking why I didn't just use a dictionary mapping extensions to actions, and I got all hot and bothered saying my way was "more clear." Looking back, it was a total mess but I was just so proud that it actually ran without erroring out. @the_jana I think a lot of us have that one old script that makes us wince but also reminds us how far we've come. The best part is realizing that being excited about your janky solution is what kept you going long enough to learn the better way.
3
riley_wood8429d ago
Man I feel that... it's rough looking back but that feeling of getting something janky to actually work is what makes you keep going.
1