When you look at code you wrote last year

698 points · 19 comments · view on lemmy.world

19 Comments

vk6flab@lemmy.radio · 43 pts · 1y (1 reply)

Accurate, except the bottom right panel only happens in very limited circumstances, hardly ever after a year has passed.

Source: I've been writing software since 1983 or so.

Carighan@lemmy.world · 7 pts · 1y

Yeah same, also I don't usually need a year to think that. The next day often works. 😅

Horrabin@programming.dev · 36 pts · 1y (5 replies)

This is probably more accurate:

-Who the fuck wrote such a shit!

-WHO???

-...

-Oh... it was me...

fayoh@sopuli.xyz · 27 pts · 1y (4 replies)

Me at a previous workplace.

-This is a piece of shit, who is the code owner of this module.

  • Ah, it's me ("inheriting" code ownership when someone left was common)

  • Who did this change

  • Ah, it was me

  • Surely I just made a minor change to this line here, who wrote the function.

  • it was me, it was me all the way down

Fits the general theme of the thread as it was not giving any trouble for a year before being found.

antimidas@sopuli.xyz · 22 pts · 1y (3 replies)

The more frustrated you are when running git blame the more likely the command turns out to be a mirror.

ulterno@programming.dev · 5 pts · 1y (1 reply)

Last time that happened to me, it was a mirror, but also not.

I had moved functions from one file to another without changing the contents. As a result, all those lines referred to me.

And since I started thinking, I found this

antimidas@sopuli.xyz · 2 pts · 1y

Good link that, I'll have to add those flags to my list of aliases

Horrabin@programming.dev · 4 pts · 1y

This is where the programmer's way to humbleness starts :-D

stebo02@lemmy.dbzer0.com · 21 pts · 1y (3 replies)
[ removed ]
Appoxo@lemmy.dbzer0.com · 5 pts · 1y (2 replies)

Try to write as if you are explaining the functionality to an unrelated 3rd party like a new hire.

scutiger@lemmy.world · 4 pts · 1y (1 reply)

Yeah, write it for the person who has to replace you when you inevitably get laid off so that your company can hire someone for half your salary.

Appoxo@lemmy.dbzer0.com · 2 pts · 1y

Don't be a dick to your (current) co-workers.

DacoTaco@lemmy.world · 11 pts · 1y

Me during code reviews of other people

Reptorian@programming.dev · 9 pts · 1y

Sometimes, I just rewrite my code until it is good enough. Other times, I leave it to my memory, so I can figure it out later. And others, I'm just not happy about it, like the times I did bigbin2dec and it would only work well with something like thread-ripper.

UnfortunateShort@lemmy.world · 8 pts · 1y

*yesterday

danc4498@lemmy.world · 5 pts · 1y

There’s an exponential amount of time between each panel. 1 hour, 5 hours, 2 days for the answer.

diemartin@sh.itjust.works · 4 pts · 1y

s/year/week/

MystikIncarnate@lemmy.ca · 3 pts · 1y

To be fair, this is also me when I look at a network setup years later. (I do IT with a specialty in networks)

spartanatreyu@programming.dev · 3 pts · 1y

This is why you're meant to comment your code.

Your code tells you "what", your comments tell you "why".

Here's a good review of comments in the redis codebase: https://antirez.com/news/124

stubing@programming.dev · 1 pts · 1y

testing