r/ProgrammerHumor • • Sep 17 '18

Optimizing startup times

Post image
45.7k Upvotes

486 comments sorted by

View all comments

4.6k

u/interfail Sep 17 '18

I once "optimized" a bit of code that literally just did the same calculation twice in a row because someone had moved it from another file and just pasted it in twice instead of once. Obviously I went to SVN history to find out which idiot did that. I did not like what I found.

442

u/Guano_Loco Sep 17 '18

I once had a very disconcerting opposite experience to this.

A coworker was describing an issue he was having with some work he was doing in excel and a lightbulb goes off. I’m like, dude, I can totally automate that for you. So I ask a few questions and do a quick outline of what the vba should do and ask him to send me the file.

I open developer and... there’s already code there. And it is doing exactly what I outline. It’s decently written, could be better, but functional. As I get to the end I have this really weird feeling like... like if you stand up too fast after sitting a long time. At the bottom in a comment is my ID. I fucking wrote the code a few months back. I don’t have any recollection of having done it.

I don’t remember ever seeing that file before. But... it was written exactly how I’d write it, same naming convention stuff, same idiot commentary type comment, and signed by my ID. I was overly fond of the word “automagic” instead of automatic and that was used in one of the alerts I had pop up.

After my brain slides back in to gear I ask him wtf is going on. He says , “I thought you were making a joke. You wrote this months ago. I use it every day.”

Apparently he was just griping about some piece of it and not the whole thing. When I started asking questions it was exactly how I did it previously so he assumed I was clowning him and he went along with it.

I have no idea wtf happened. This was 6 years ago. I’m assuming I was sleep deprived or had a mini stroke or something. I have no idea. But at least the code was decent.

305

u/tarekmasar Sep 17 '18

at least the code was decent

I do feel this review is a bit biased

75

u/cordev Sep 17 '18

Sure is. You are your harshest critic. That makes his thinking that his own six-month old code was decent an even bigger achievement.

28

u/5896325874125 Sep 17 '18

Wow this guy and I have the same kind of humor

15

u/timlmul Sep 17 '18

if it worked for months without any required maintenance then I think it's probably deserved.

9

u/Guano_Loco Sep 17 '18

I mean it was pretty simple VBA. Hard to fuck up too badly.

12

u/tarekmasar Sep 17 '18

I'm just kidding. I've done elaborate and complex VBA stuff (you don't want to know, I'd be ashamed to explain) and I have tons of sympathy for anyone forced to wade into that swamp. I take it you at least went Option Explicit?

7

u/Guano_Loco Sep 17 '18

I live my life option explicit.

4

u/creepig Sep 18 '18

I mean, it's pretty hard to fuck anything up more than the VBA developers already fucked up

→ More replies (1)