Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Funny Codes

 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's see who can write the funniest code. Here's mine



(If any one says that bunks field is not initialized or girls variable is never declared, I'll kill him/her)
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's better if you can move this topic to here
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If any one says that bunks field is not initialized or girls variable is never declared, I'll kill him/her

No, I was about to say that girls will never be cute comparing them with "==" instead of equals()
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I was about to say that girls will never be cute comparing them with "==" instead of equals()

So you're saying girls are like strings?
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's ok, but don't forget to call Garbage Collector System.gc(); inside the while(girls == "Cute") loop.

 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No one saw that it's an endless loop. That's because girls are always Cute
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ankit Garg:
No one saw that it's an endless loop. That's because girls are always Cute


Then replace == with =

[ December 13, 2008: Message edited by: Treimin Clark ]
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Treimin Clark:


Then replace == with =



But then the code will not compile as the expression will not be a boolean expression
 
Treimin Clark
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ankit Garg:

But then the code will not compile as the expression will not be a boolean expression


Aaaaaa! Did you mean that the existing code will compile?
Are you really talking about programming

Hope you like boolean girls
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fortunately, it's not that simple. If you check the API, you will see that Person (superclass of Boy and Girl) has a getCuteness(AccessLevel a) method that returns a unique CutenessProperties instance based on the caller's access level. Once you have this, you need to analyze the attributes using an instance of your own (private) Evaluator, which employes a virtual chaos emulator to generate a subjective realtime indicator. The entire process is typically a daemon thread looping in the background, and it cannot be interrupted. Note that these are native methods, so their behavior is platform dependent. This might seem like a complex pattern, but if you don't follow it, you're likely to serialize a shallow copy, which will eventually cause your system to crash.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope you like boolean girls

Never met one, but I think they'd make life less enjoyable, even if at times a little easier.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fortunately, it's not that simple. If you check the API, you will see that Person (superclass of Boy and Girl) has a getCuteness(AccessLevel a) method that returns a unique CutenessProperties instance based on the caller's access level. Once you have this, you need to analyze the attributes using an instance of your own (private) Evaluator, which employes a virtual chaos emulator to generate a subjective realtime indicator. The entire process is typically a daemon thread looping in the background, and it cannot be interrupted. Note that these are native methods, so their behavior is platform dependent. This might seem like a complex pattern, but if you don't follow it, you're likely to serialize a shallow copy, which will eventually cause your system to crash.



Watt?!!!

Is that a general "advice" or your idea of a funny code?

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You keep using that word. I do not think it means what you think it means.
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This whole conversation smells like geeky now
 
Arvind Mahendra
Ranch Hand
Posts: 1162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

how I felt after reading Marc's code
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arvind Mahendra:
how I felt after reading Marc's code


It's not Marc, it's marc (shiftless )
 
Abhinav Srivastava
Ranch Hand
Posts: 354
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:

So you're saying girls are like strings?


Or maybe they come with Strings Attached
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm soooo waiting for one of the female ranchers to wander in on this conversation <reaches for popcorn>.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic