1. 4. 2020 • 3 min read
Validated: Sep 2024
As you know, comments are an integral part of the source code. Usually, these lines are very useful for understanding the logic of the code; however sometimes, if we are lucky, there are some truly hilarious ones that can be found. Let’s explore together one thread at stackoverflow.com and see how creative developers can really be:
If you’re writing a part of the code and know that the maintainer won’t be anybody else but you, the best way how to prevent yourself from being upset in the future is:
A lot of us, developers, love Star Wars (sorry Star Trek fans), we can’t stop ourselves from using sentences from the movie in the code...
long long ago; /* in a galaxy far far away */
Sometimes, the author of the code will warn you in advance. If you listen to him/her, you’re safe, otherwise, you may have a lot of sleepless nights. Can´t say the author did not warn you!
/*
* You may think you know what the following code does.
* But you dont. Trust me.
* Fiddle with it, and youll spend many a sleepless
* night cursing the moment you thought youd be clever
* enough to "optimize" the code below.
* Now close this file and go play with something else.
*/
In a huge monolithic application, there can be a lot of useless code. Using GIT can definitely save your day but this developer has decided to be safe rather than sorry.
// I am not sure if we need this, but too scared to delete.
Are you familiar with that strange feeling in your belly when doing something not entirely correct? Well, if you have it while programming, supportive family is all you need.
// I dedicate all this code, all my work, to my wife, Darlene, who will
// have to support me and our three children and the dog once it gets
// released into the public.
When you’re working long enough on optimizing part of the code only to figure out that you can´t, it is good to know you were not the only one and that there will be probably someone after you.
//
// Dear maintainer:
//
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
//
// total_hours_wasted_here = 42
//
These were our choices but if you know another ones, please let us know at support@codeac.io.
If you are too familiar with sleepless nights fixing some code over and over again and see similar comments across your projects, don’t lose hope and try Codeac.
User Banang
// Dear future me. Please forgive me. // I can't even begin to express how sorry I am.