TGIF

publicvoid doSomething()

{

boolean flag;

boolean valid = isValid("some text");

if (valid ==true)// text is valid

{

flag =true;// okay to continue

}

else// text is not valid

{

flag =false;// not okay to continue

}

if (flag ==true)

{

// some code...

flag =false;

}

else

{

// some more code that bears a striking

// resemblance to the (flag==true) code

flag =true;

}

}

I found this in 3 separate classes today (verbatim), and yes, they're all subs of the same super. Thank goodness the weekend is upon us.

[1643 byte] By [KelVarnsona] at [2007-11-26 17:07:45]
# 1
that's very special :-)
georgemca at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 2
Have you submitted this to [url= http://www.thedailywtf.com]thedailywtf[/url]?
bckrispia at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 3
It takes talent to come up with something like that.
DavidKNa at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 4

> public void doSomething()

> {

>boolean flag;

> boolean valid = isValid("some text");

>

>if (valid == true) // text is valid

> {

>flag = true; // okay to continue

>

>else // text is not valid

> {

>flag = false; // not okay to continue

>

>

>if (flag == true)

> {

>// some code...

>flag = false;

> }

>else

> {

>// some more code that bears a striking

> // resemblance to the (flag==true) code

>

>flag = true;

>

> }

hai vernson. could u give 2 me codez in 1 JSP?

filestreama at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 5
> hai vernson. could u give 2 me codez in 1 JSP?Streamie,Not that we would ever get tired of you making fun of chaps from the subcontinent, or chav culchah, but how about making fun of, oh, CANADIANS for a change?
DrLaszloJamfa at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 6

> > hai vernson. could u give 2 me codez in 1 JSP?

>

> Streamie,

>

> Not that we would ever get tired of you making fun of

> chaps from the subcontinent, or chav culchah, but how

> about making fun of, oh, CANADIANS for a change?

Sure, just for you my toque-challenged friend. :)

filestreama at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 7
> hai vernson. could u give 2 me codez in 1 JSP?hai fliesteam, pleez mail me to viswananinanathananthananinan@jcurry.com and i am dump the codez now.
KelVarnsona at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 8
> It takes talent to come up with something like that.Apparently, enough talent to be a Sr. Computer Scientist making 2.5 my salary. But I'm not bitter at all...
KelVarnsona at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 9
> Not that we would ever get tired of you making fun of chaps from the > subcontinent, or chav culchah, but how about making fun of, oh, CANADIANS for a change?Take off, hoser.(I think I just dated myself there)
KelVarnsona at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 10
> Take off, hoser.I am your father, Luke. Give in to the dark side of the force, you knob.
kevjavaa at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 11
Brilliant! %
duffymoa at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 12

> > hai vernson. could u give 2 me codez in 1 JSP?

>

> Streamie,

>

> Not that we would ever get tired of you making fun of

> chaps from the subcontinent, or chav culchah, but how

> about making fun of, oh, CANADIANS for a change?

That's Canadiens Eh ?

Aknibbsa at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 13
> Apparently, enough talent to be a Sr. Computer> Scientist making 2.5 my salary. But I'm not bitter> at all...Probably only because no one else can understand his code enough to maintain it themselves...
DavidKNa at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 14
Some people would knock this for having a meaningless method name, but I think it's very fitting. The method does something. Not sure what it does, but it's defninitely something.
hunter9000a at 2007-7-8 23:35:34 > top of Java-index,Java Essentials,New To Java...
# 15
> I think I just dated myself thereDating yourself is legal in Ontario and PEI; everywhere else there is a statute on the books making such behaviour illegal.
filestreama at 2007-7-21 16:58:15 > top of Java-index,Java Essentials,New To Java...
# 16

I read an article in the NYT recently which reported the stat that in the USA the percentage of women who were not married had just surpassed 50%.

In contrast, for some Canadian provinces, the percentage of married adults is going up. For instance, in BC, the percentage is increasing, thanks partly to gay marriages -- about 3.5% of total marriages.

I'm not familiar with the stats on dating yourself.

DrLaszloJamfa at 2007-7-21 16:58:15 > top of Java-index,Java Essentials,New To Java...
# 17

> that's very special :-)

I just saw one the other day that was something like this:

SomeObject myObj = null;

if (myObj == null) {

...

}

CarrieHunta at 2007-7-21 16:58:15 > top of Java-index,Java Essentials,New To Java...
# 18

> > I think I just dated myself there

>

> Dating yourself is legal in Ontario and PEI;

> everywhere else there is a statute on the books

> making such behaviour illegal.

Here in the States, as far as my knowledge goes, you can consummate the relationship, but matrimony is illegal and frowned upon.

kevjavaa at 2007-7-21 16:58:15 > top of Java-index,Java Essentials,New To Java...
# 19

> > that's very special :-)

>

> I just saw one the other day that was something like

> this:

>

> > SomeObject myObj = null;

> if (myObj == null) {

> ...

> }

>

Well, you do know that code gremlins are real, right? So a gremlin could jump in and change the value of myObj at any moment!

warnerjaa at 2007-7-21 16:58:15 > top of Java-index,Java Essentials,New To Java...
# 20
> > I think I just dated myself there> > Dating yourself is legal in Ontario and PEI; everywhere else there is a > statute on the books making such behaviour illegal.No silly, I meant that I just pelted myself with dried fruit. Such a filthy
KelVarnsona at 2007-7-21 16:58:15 > top of Java-index,Java Essentials,New To Java...
# 21
dried apricots are the best.
filestreama at 2007-7-21 16:58:15 > top of Java-index,Java Essentials,New To Java...