- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
"Then how is the code going to run?"
Because the code is reading the power from an attached device, not itself.
Admin
You'd think the poor fella was a GenTran programmer..
Admin
Amatures!
It doesn't handle FILE NOT FOUND.
Admin
Judging from some of the BIOS versions you found in Laptops during the last decade, I wonder if the same dev switched to writing firmware code in C after writing this...
Admin
I hope he wrote a script to generate that.
Admin
[quote user="Shinobu"][/quote]Meanwhile, in VB you don't need := or == since it's always clear from context which is meant. You don't assign in expressions, and a comparison can never be a statement. It makes sense, is clear, you can always use =, and you never get weird bugs from accidentally using = instead of ==.[/quote]
Two defenses of == vs =. During tokenization == and = resolve into two separate tokens whose meaning is unambiguous and does not have to be inferred by context. Consider, for(i=0; i==b; i+=2) what do? This decision resulted in a much simpler and faster compiler.
Second modern compilers will bitch at you if you write if(a=b) so if it causes a problem for you it's your own damn fault. C was never designed with the idea of being a nanny like Basis or Java. You can write 'clever' code and step on your own dick and the language won't stop you.
Third you get used to it, when I typed if(a=b) above I automatically double tapped the = key and had to backspace.
Admin
People who code like this really.. well, how do they even graduate? How do they stay employed? Shouldn't someone just tap them on the shoulder and say, you know, software engineering is just not for you?
Admin
The newspaper is in Bengali, common in eastern India, not common in Hyderabad on the other side of the country. At least troll right.
Admin
Thats not a WTF. He got paid by lines of code.
Admin
You had me at "VB".
Admin
Admin
[quote user="Gibbon1"][quote user="Shinobu"][/quote]Meanwhile, in VB you don't need := or == since it's always clear from context which is meant. You don't assign in expressions, and a comparison can never be a statement. It makes sense, is clear, you can always use =, and you never get weird bugs from accidentally using = instead of ==.[/quote]
Two defenses of == vs =. During tokenization == and = resolve into two separate tokens whose meaning is unambiguous and does not have to be inferred by context. Consider, for(i=0; i==b; i+=2) what do? This decision resulted in a much simpler and faster compiler.
Second modern compilers will bitch at you if you write if(a=b) so if it causes a problem for you it's your own damn fault. C was never designed with the idea of being a nanny like Basis or Java. You can write 'clever' code and step on your own dick and the language won't stop you.
Third you get used to it, when I typed if(a=b) above I automatically double tapped the = key and had to backspace. [/quote]
The same tokenization happens with ALGOL/Pascal/et al's handling of := and =.
And I tend to automatically type := then have to correct it when making one of my rare forays into curly-brace land.
I've always wondered if a colon was hard to type on PDP teletype keyboards (or whatever was used to input the code). Like {} apparently are on some non-US keyboards. And I automatically type := and then have to remove it
Admin
Admin
Admin
This is a stupid and long-winded implementation of a solution much better suited for a lookup table.
Admin
I can only assume that "Nagesh" is another grossly obese burger-munching American with a gun collection and a single figure IQ who thinks India is "somewhere near Hawaii".
Admin
Really, though, it's almost impossible to tell them apart.
Admin
You're almost as funny! ;-)
Admin
made me lough!
Admin
I love code like this. I get a huje jolt of pleasure anytime I can easily collapse 10+ lines of code into 3 or 5 that are even easier to understand.
After that I can think to myself that no matter bad things are, at least they're getting a lot better. :)
Admin
I can easily see something like this happening. "If they're going to measure my productivity by SLOC, then by God I'll give them SLOC!"
Admin
Because regulation has worked out so well in other industries...
This kind of code is what happens in a world where programming is still not recognized as fundamental to a well-rounded, modern education. If it were, employers would know enough to differentiate between completely ridiculous and merely bad work as they generally can when managing other subordinate fields in which they lack complete expertise.
Admin
A place in Programming Pearls is secured.
Admin
We are all treating this developer as an copy-paste idiot, but I can bet that he actually spent a whole day to write a script to auto-generate that bit of code... to avoid copy-pasting! :D
Thas is genius... or madness... you choose.
Admin
This could be drastically improved with about anything.