aspose file tools*
The moose likes Meaningless Drivel and the fly likes Ultimate Comments in coding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "Ultimate Comments in coding" Watch "Ultimate Comments in coding" New topic
Author

Ultimate Comments in coding

Yogita Kahadane
Greenhorn

Joined: Jul 07, 2009
Posts: 2
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


SCJP 5.0
Sumit Bisht
Ranch Hand

Joined: Jul 02, 2008
Posts: 329

lol

@Yogita, Welcome to JavaRanch

// TODO : Add Comment Here
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14432
    
  23

If you like things like these, then have a look at The Daily WTF.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31074
    
232

Funny


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19070
    
  40


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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Yogita Kahadane
Greenhorn

Joined: Jul 07, 2009
Posts: 2
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
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2864
    
  11

// It is what it is.
Muse Ran
Ranch Hand

Joined: Sep 17, 2008
Posts: 317
yogitha,
share your code comments



Tomorrow will surely be a new day!!!
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

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.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

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


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

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.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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

[My Blog]
All roads lead to JavaRanch
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1



This is also my first Orkut profile photo


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Himanshu Kansal
Ranch Hand

Joined: Jul 05, 2009
Posts: 257
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


Experience and talent are independent of age
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

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

**/
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081



I can never forget this comment

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

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Suresh Thota
Ranch Hand

Joined: Sep 24, 2003
Posts: 152
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) */


SCJP 1.6
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

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 )...
Kashyap Hosdurga
Ranch Hand

Joined: Sep 19, 2005
Posts: 91
/* The below lines are deleted by XXXXX*/
Raghavendra nandavar
Ranch Hand

Joined: Jun 26, 2005
Posts: 231
One of my favourites which I saw in one of the applications:

// This code is added by me, today.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ultimate Comments in coding