Brilliant Logic
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
Well I am sure a designer would read that as... if a is looking at b while on the other side of the bushes b is entering a from behind do something else do something else ALTERNATIVELY The designer knows not how to apply multi lines commenting?
I may or may not be responsible for my own actions
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
No this is just a more esoteric way of commenting out code. //do something is the stuff being commented out and //do something else is now being done instead. I think this is obvious, isn't it? Cheers! :-D
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
I dont believe your designer wanted it that way, but a comparison to a NAN is always false. I am using a similar NAN-Check if (x != x) ... gets true if x is NAN
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
I think I just threw up a little in my mouth.
-
I dont believe your designer wanted it that way, but a comparison to a NAN is always false. I am using a similar NAN-Check if (x != x) ... gets true if x is NAN
-
if(x.isNaN()) (Java) if(double.IsNaN(x)) (C#)
modified on Wednesday, May 4, 2011 1:53 PM
if(isNaN(x)) // JavaScript.
[
S<T>::f(U) // Out of line.
](http://msdn.microsoft.com/en-us/library/8yk3t00s(v=vs.71).aspx)
-
I dont believe your designer wanted it that way, but a comparison to a NAN is always false. I am using a similar NAN-Check if (x != x) ... gets true if x is NAN
Then surely one will want to do:
if(a > b && a <= b && a != b && !isNaN(a + b)) { /*...*/ }
:rolleyes:
[
S<T>::f(U) // Out of line.
](http://msdn.microsoft.com/en-us/library/8yk3t00s(v=vs.71).aspx)
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
laugh all you wish, but that's not to far fetched from something some of the tiddlywinks I had classes with would do. Might be why I have a job and they don't but, that's another issue...
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
LOL, that's fantastic. Designers are like women, you can't understand!
Dr.Luiji Trust and you'll be trusted. My Blog : The Code Is Art
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
This a standard design pattern (SDP) used by Governments, NATO, UN etc in deciding when to take action when civilians are being killed or persecuted "No matter what - don't doing anything" Clearly the designer is very well read and is destined for great things. Note: The design pattern is also used in banking to calculate if the bonus should be a. Very large or b. Just embarrassingly large. Athough it has to be admitted the design pattern is somewhat flawed as no banker has ever been embarrassed!
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
Should we assume that it wasn't done intentionally as a temporary bypass?
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D
Doesn't apply to Javascript, but in languages that allow separately overloaded operators, this could have a (nefarious) significance.
-
if(isNaN(x)) // JavaScript.
[
S<T>::f(U) // Out of line.
](http://msdn.microsoft.com/en-us/library/8yk3t00s(v=vs.71).aspx)
the unequality test is more portable i actually used it in CUDA, afterwards i found out there exists an isnan(x) builtin function now porting to other languages is more easy
-
Found this in JavaScript code from one of our designers
if(a>b && a<=b)
{
//do something;
}
else
{
//do something else;
}:-D