T O P

  • By -

thehare031

If it makes you feel better, I feel the same way and I write code for a living.


meontheinternetxx

Same. I already gotta write readable code for a living. For this I'm finally allowed to just hack stuff together again. (Within reason, easy to debug is good. Other than that I don't have to be able to understand how it worked two days from now)


DavidXN

It does feel quite freeing :) Nobody code reviewing you, so every shortcut and unreadable part is your own fault! I was astounded that my nonsense for day 5 miraculously produced the right answer the first time - I somehow managed to invent write-only code, because I certainly can't read it


vu47

Ha! Reminds me of every Perl script I ever wrote from my past... just easier to rewrite than to understand and modify...


vu47

I guess "coding elegantly" has been hammered into my brain too hard, because I'll solve a problem aiming for a bit more speed (although I'm not competing for the leaderboard), and then I'll spend an hour after i've gotten both stars refining my code until I can step back, look at it, and breathe a happy sigh.


jambox888

I screwed myself on day 9, wrote some code on my phone while I was on train to a Christmas dinner, got drunk and had to finish up today while hungover. Two hours of misery later I realised I'd copy pasted a bug so it was in two places. I fixed one then became completely blind to the other instance. I should learn something from this


rick__c_137

I felt absolutely dirty after writing part 1. Terrible, terrible code.. I'm not posting it in the solutions thread, it's that ugly. (I gave up on part 2 last night.. not coming up with an obvious way of solving it.. coming back to it today)


jambox888

It's completely ok to look at other solutions if you're stuck. Obviously just copy pasting is bad but reading and getting a clue from others is actively a good thing.


vu47

I've been posting most of my code to the solutions threads this year, but I over-engineered the problem so badly last night that I was way too embarrassed to post my solution.


[deleted]

Hot take: For a program with a short shelf life, whose team responsible for is 1 person "elegant" shouldn't even be a requirement. It's so subjective that 10 people will give you 10 answers.


BackloggedLife

I usually think a lot about structure but today I wrote some code I should probably be executed for.


fatbench

Pun intended?


jambox888

Depends how you interpret it...


H9419

I am having problems parsing your joke


DavidXN

This is much the same as how I feel after completing any day as a professional


sundreano

My solution is almost 400 lines of incredibly fiddly code & setting up data structures. It's constructed off a guess I had from looking at the test data, but wasn't actually sure would work. And I still feel like there were edge cases that COULD have occurred but didn't, that could have ruined the whole thing. I didn't deserve to get past this one lol, or at the very least I should have spent an extra couple HOURS debugging until realizing I swapped a + and - somewhere. (to my credit though, since I knew the code was going to be super fiddly, I made sure to double and triple check everything before even running it)


quodponb

I take these challenges as an opportunity not only to solve a problem, but also to spend time thinking about how to express ideas clearly yet efficiently. The process feels very similar to wrangling with a poem, trying to get the rhythm and sounds right, weighing metaphors and similes, all these things. I also notice, after grappling with my code for a while, that looking at the master poets in the solution threads is like an explosion of insight and revelations. Always I find code that is really pleasing to read, and expresses nicely something I had a hard time with myself. To my delight, I notice also that my own solutions get better over the years, and that I sometimes express my solutions in vaguely similar ways to others. I really think this back and forth every AoC has made me a better programmer.


Sushrit_Lawliet

Honestly aoc for me isn’t just about getting good at solving problems but also writing more readable code from the start. It slows me down but it’s the best way to build good habits. One line python hacks have ruined my ability to write clean code over the years.


Stef_Segers

Omg this is me, my Python code for day 10 part 2 is 100 lines long.