Which reminds me: I inherited a pile of crap code that actually worked fairly well. The original programmer (forced into it) didn't know how to use a switch() statement and what he implemented was a complicated state machine with if () else if () else... nested very, very deep! The nested if,if,if statements got soo deep that at one point I added a comment that if the code reached that location the engine must be on fire (it was a generator controller).
A couple of years later they resurrected the project and of course reviewed the code and found my comment. I got in a lot of hot water over that one. My recommendation for others who find themselves in a similar position of inheriting crap code, go ahead and make comments like that, but somewhere in the header document that you inherited it from and make dam sure that future reviewers know your story. Reviewers will or should learn that is under suspicion.
' ==================
' Date : 24/12/2002 - MERRY BASTARD CHRISTMAS!
' Author : Chris Shepherd
' Description : Send trades to Bloomberg
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
10 years later i was back doing the same thing. This led to my coding standard being "keep it simple enough to be able to understand it on Christmas Eve with a terrible hangover".
Frontend Engineer, Coffee Glutton, Quality Lover
▫◽◻⬜◻◽▫
My name is Tiago Marques and I am curious. I try to learn more about everything, and seek solutions to the problems around me.
I had a code that was exactly number 5... I did write... but I didn't really understand all the flow... But the fact was that worked! So... I guess my "subconscious is that good" 🤣🤣🤣🤣😂😅
#10 Someone actually reads xkcd: xkcd.com/221/
It's also a pure function
Good! #2 If You Get Here...
Which reminds me: I inherited a pile of crap code that actually worked fairly well. The original programmer (forced into it) didn't know how to use a switch() statement and what he implemented was a complicated state machine with if () else if () else... nested very, very deep! The nested if,if,if statements got soo deep that at one point I added a comment that if the code reached that location the engine must be on fire (it was a generator controller).
A couple of years later they resurrected the project and of course reviewed the code and found my comment. I got in a lot of hot water over that one. My recommendation for others who find themselves in a similar position of inheriting crap code, go ahead and make comments like that, but somewhere in the header document that you inherited it from and make dam sure that future reviewers know your story. Reviewers will or should learn that is under suspicion.
One of the favorite ones I've seen:
this.parent = null; //Become Batman
A lot of them from here: stackoverflow.com/questions/184618...
Christmas eve 2012 I was asked to look at some Excel VBA code I had written many years previously. This comment was at the top of the code:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' SendTrades
' ==================
' Date : 24/12/2002 - MERRY BASTARD CHRISTMAS!
' Author : Chris Shepherd
' Description : Send trades to Bloomberg
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
10 years later i was back doing the same thing. This led to my coding standard being "keep it simple enough to be able to understand it on Christmas Eve with a terrible hangover".
some more funny comments : medium.com/@sAbakumoff/157-million...
Wow, some of those are amazing :D
Is it weird if I also feel a bit scared that developers actually have to deal with that kind of work?
Haha, really nice 😁
I had a code that was exactly number 5... I did write... but I didn't really understand all the flow... But the fact was that worked! So... I guess my "subconscious is that good" 🤣🤣🤣🤣😂😅
Some of my favorite source code from the past week
