- 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
Not C - as I found out when I tried to use it :-) Why it is missing from C I don't know :-(
Admin
That's NAND xor NOR. You don't need both to be functionally complete (so "and" is overkill), and if you have both it wouldn't be at the most basic level (so "xor" instead of "or").
Admin
That's acutally one of the things I find fun about my job; taking some crap code and refactoring it into something good. makes me feel I've made our little world slightly better.
Admin
My standard answer to most questions from the age of 14 to 17.
Admin
both?
Admin
Yep, there's no better feeling than rewording code without actually changing it.
Admin
Admin
... You know what? Use
(a + b) & 1
, and we'll call it a day.Admin
can't not = MUST (ie, can't avoid) CAN misunderstand = can misunderstand (or not) (but this doesn't appear in Matt's sentence) not trying to unachieve = meaningless, unless "unachieve" means something, which it doesn't. But suppose it meant "not achieve". Then "not trying to unachieve" would mean "not trying to not achieve", which would mean a state of near total unconcern as to whether the thing was achieved or not. "I'm not trying to not achieve the goal" says nothing about whether I'm trying to achieve it or not - it only means I'm not trying to fail.
So Matt's sentence "I can't not misunderstand what he was not trying to unachieve" actually would mean "I have to misunderstand what he didn't care about whether he achieved or not", but only if "unachieve" meant something in English.
Which is even worse than today's posting. Congratulations, Matt.
Admin
If it makes you feel better, remember that your own DNA is also full of junk code from sundry sources and has no comments.
Admin
Admin
Actually, the way I'd code this is:
First change statusIsNotValid to statusIsValid, then:
if (statusIsValid) { // ... perform validation ... }
Admin
This is the refactored version. The original version was
Admin
;-)
Admin
Dear frits,
In case you can’t tell, this is a grown-up place. The fact that you insist on using this ridiculous expression clearly shows that you’re too young and too stupid to be using thedailywtf.com.
Go away and grow up.
Sincerely, Bert Glanstron
Admin
And "no visible impact" is a best case scenario.
Admin
actually you just need nand, you can mimic nor using it ;)
Admin
Plausible - since we're making up words, why not?
So, "I must misunderstand what he was't actually trying to undo"? Still gibberish to me. Part of the problem is that you've got a null reference for "understand" "I understand what he didn't say" maybe makes sense in a poetic context, but not if you try to read it literally. With the extra layer of negation in there, it's hopeless.
But the real problem is that English doesn't actually negate in a boolean fashion, especially with modal verbs. Try to negate "I have to do X", and you have two choices: "I !(have to) do X" or "I have to (!do X)". So trying to construct this sort of thing is actually a lot harder in English than it is in code.
Admin
Duh. That's so yesterday.
Admin
Unpossible.
Admin
Or to put it the other way around: C is pretty good at chasing away idiots who'd go on to become incompetent coders :)
Admin
Actually our own DNA seems to get refactored all the time and only seems to stick around when it's needed. http://en.wikipedia.org/wiki/Noncoding_DNA
Don't refactor for it's own sake but if your in the code anyway then clean it up for the next person.
Admin
Yes, but your own DNA is the result of evolution. God save us from code which has evolved rather than being designed and coded properly.
Admin
Whooshhhh! (hand flying over head)
Admin
Well, I'm glad it's not just me. Sometimes I feel like the only sane person in a asylum of lunatics...and that's usually a bad sign.
Admin
Admin
We refactor when you can make no changes and accomplish the same result?
Admin
Or a great "Boolean question" (parse it with punctuation..)
If that that is is is not that that is not not?
Admin
That is non-non-non-non-heinous!
Admin
Everyone else read this statement and thought "it probably is Java, but bertram specifically added the word 'guarantee' to his sentence, I wonder why? oh it must be because even though it is likely Java it cannot be absolutely proved".
Apparently you read it and thought.. "ooh, nice bait.. I want to be trolled". Since you are obviously trolling yourself, I think that justice has been done.
Admin
I think you are misunderestimating yourself.
Admin
Indeed. I did C/C++ programming for roughly ten years, and then switched to Java. Sometimes I think back and fondly remember the C/C++ days, until I remember seeing this gem:
#define private public #define protected public
Then the good old days remind me why I love being a Java programmer.
Admin
I guess you rookies have only seen discrete booleans.
Admin
Dear campkey,
In case you can’t tell, this is a grown-up place. The fact that you insist on using this ridiculous expression clearly shows that you’re too young and too stupid to be using thedailywtf.com.
Go away and grow up.
Sincerely, Bert Glanstron
Admin
Wow, I don't think I've ever seen a meme die from overuse quite that fast. Zero to pathetic in twenty-four hours, prety good.
Admin
TRWTF is using Boolean instead of Strings
Admin
Im n ur intertubez, deletin' ur memez
Admin
"Don't do what Donnie-Don't does. They could have made this clearer." - Bart Simpson
Admin
-(((sqrt(-1) * i) ^ 2) - 2) or "featured comment!"
Admin
Logical OR :-)
I remember my logic teacher telling the class that logicians spend half the time at conferences arguing with the catering staff about the meaning of "cooked breakfast OR continental breakfast" on menus (emphasis added ;-)
Admin
"If status is valid, skip validation"
[/thread]
Admin
Refactoring worst case: you introduce new bugs because you took it upon yourself to change something that is invisible to everybody who pays your salary. Investment: greater than zero. Return on investment: zero.
Admin
Admin
Here are the minimum states needed for a universal boolean: boolean { true, false, fileNotfound, NULL, fish, 0, 1, f, t, F, T, True, False, TRUE, FALSE, Y, N, Yes, No, YES, NO, maybe, Maybe, MAYBE }
Admin
FTFY.
Admin
Admin
Tell me about it - I'm dealing with Salesforce. Pity me.
Admin
I'd be scared to fix that code, I'm not 100% I know what its intent is.
Admin
Admin
Apples