• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ultimate Comments in coding

 
Greenhorn
Posts: 3
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Today I received the mail with subject line as above.
I want to share that with you all

1.
/// <remarks>
/// The point of this is to work around his poor design so that paging will
/// work on a mobile control. The main problem is the BindCompany() method,
/// which he hoped would be able to do everything. I hope he dies.
/// </remarks>


2.
// 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.


3.
// Magic. Do not touch.

4.
return 1; # returns 1

5.
/* This is O(scary), but seems quick enough in practice. */

6.
/*
* 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.
*/


7.) and here comes my favourite......






//When I wrote this, only God and I understood what I was doing
//Now, God only knows

Please share if you could have written some code comment like that.

Best Regards,
Yogita

 
Ranch Hand
Posts: 331
Python Ruby Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
lol

@Yogita, Welcome to JavaRanch

// TODO : Add Comment Here
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you like things like these, then have a look at The Daily WTF.
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Funny
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It's funny from a third party point of view. Having encountered code like this -- it is far from funny. Generally, it means... the code is complex. the code is poorly written. the code barely works. the code is not documented. etc...

Henry
 
Yogita Kahadane
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Sumit , Jesper

Yes Jeanne, even i found it very funny

Hey Henry,
Jokes apart,
@Having encountered code like this -- it is far from funny. Generally, it means... the code is complex.
If we look the other way round,yes,providing simple solution is real deal
Well ..such comments are harldy entertained

Cheers,
Yogita
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
// It is what it is.
 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yogitha,
share your code comments

 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found these comments on a common library application, made by an architect

/**
* You need to set provider name before accessing this. Dont ask me why it is so !
*/

/**
* This should now work eeesshshhuppp !
*/

I know this is meaningless drivel and all but I am not joking about those comments. The code by itself was not bad and it was fun reading the comments.
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found this type of comment in one of the site I was working on (in a js file)

/* Who wants some whiskey? I want it!! Here you go!

Woo Hoo, amazing whiskey */

And after that all the variable names and function names had whiskey in them. One of the variable was amazingWhiskey. There were a lot of other comments like this one but they were kinda offensive so ...
 
Deepak Bala
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote:I found this type of comment in one of the site I was working on (in a js file)

/* Who wants some whiskey? I want it!! Here you go!

Woo Hoo, amazing whiskey */

And after that all the variable names and function names had whiskey in them. One of the variable was amazingWhiskey. There were a lot of other comments like this one but they were kinda offensive so ...



At work ? wow.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only I can remember of is a class which I had no clue what its purpose was, and whose comment is :

/**
* Nice!! Creation date: (00/09/01 11:28:37)
*
* @version $Revision: 1.4 $
* @author $Author: XXXX $
* @author YYYY
*/
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


This is also my first Orkut profile photo
 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
on a serious note, I have seen people doing so to obfuscate the code.

and yes

//When I wrote this, only God and I understood what I was doing
//Now, God only knows


that's the best
 
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In code I was maintaining I found the following (after two days of tracking down an error):

/**
congratulations, you finally found the method that is causing all the problems

**/
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I can never forget this comment

We had to check various version in VSS to check what was actual code, which was deleted

Shailesh
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I once read this comment in a co-workers code after he left the company.

/* Temporary workaround until <some other team> delivers their fix (which is never gonna happen) */
 
Ankit Garg
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of my friend got screwed because of this. He used to send SMSs to friends using 160by2 site. Since he didn't wanted to keep that site open for too long (since it was not allowed in the office), so he used to type his SMS in the code and used to copy paste it into the site and send it. But once he forgot to delete one SMS from the code and submitted the code. When his supervisor found that SMS, he was called by the boss and scolded. Now he cut pastes his SMSs (people never quit )...
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/* The below lines are deleted by XXXXX*/
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of my favourites which I saw in one of the applications:

// This code is added by me, today.

 
My favorite is a chocolate cupcake with white frosting and tiny ad sprinkles.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic