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.
Have you submitted this to [url= http://www.thedailywtf.com]thedailywtf[/url]?
It takes talent to come up with something like that.
> 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?
> 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?
> > 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. :)
> 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.
> 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...
> 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)
> Take off, hoser.I am your father, Luke. Give in to the dark side of the force, you knob.
> > 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 ?
> 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...
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.
> 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.
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.
> that's very special :-)
I just saw one the other day that was something like this:
SomeObject myObj = null;
if (myObj == null) {
...
}
> > 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.
> > 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!
> > 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
dried apricots are the best.