Now the real WTF here is that this post was supposed to be a reply to a post, not a topic by itself...
Mods, if you are reading (I know you are!), please delete this message.
Guido
Now the real WTF here is that this post was supposed to be a reply to a post, not a topic by itself...
Mods, if you are reading (I know you are!), please delete this message.
Guido
<FONT face=Arial>I think it's not a necessarily WTF but a bug/misconception/mistake and nothing else... We all have these kind of errors while we develop... then fix them by ourselves.... that's the real difference with real-life, production-code, head-aching WTF's... as they, at least for me, mean functionalities and solutions designed and developed outrageously bad, but then for the grace of computing-science (or lack of thereof) end up doing what the wtf-minded designer/developer wanted it to do.</FONT>
<FONT face=Arial>I spent two hours last Monday trying to understand why Hibernate (an awesome Open Source ORM solution for Java) refused to persist two generated object in the same session, i did all kinds of debugging, SQL tracing, code variations, and it was just because I forgot to set a sequence generator in the object mapping file... What's the WTF here? Yeah... spending two or three hours fixing something that wasn't "broken" in the first instance.</FONT>
<FONT face=Arial>Cheers!,
Guido Scalise</FONT>
@Iago said:
You have some extra brackets and curlies there. And I'm pretty sure you don't need all that wasteful whitespace in those expressions - saving a few bytes is more important than being readable, right?
Blame the buggy-almost-WTF'ed HTML Editor [:P]
(Sorry for that, I didn't have the preview feature nor could I edit the post).
Cheers,
Guido
@your mom said:
@mallard said:Translation:while(!done) {
...
if (a || !b || (i > 10)) done = true;
}
while(!done) {
...
done = (a || !b || (i > 10));
}
do {
...
} while (!(a || !b || (i > 10)))
or, (another twist!)
do {
...
} while (!a && b && (i<=10));
all of this, assuming that "done" was originaly false before entering the loop [:P]
the ultimate version would be
if(!done) {
do {
...
} while (!a && b && (i<=10));
}
Cheers!,
Guido