- 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
This isn't a WTF, or at least not a WTF on the programmer's part. Clearly, they were being paid for every X characters written, and this is just how they paid for their new car.
Admin
What the actual fuck, why would you do this?
Admin
there is only one truth, admit it
Admin
Directive: Everything must be language-specific.
Admin
Sure, you're quite right. There is, indeed, only one truth.
The hard part is knowing what it is.
Admin
return !true;
Admin
This is not a very good abstraction. What about languages that don't distinguish between true and false? They cannot be represented by generalized coding like that:
public boolean getLanguageSpecificBooleanValueForFalse() { return !getLanguageSpecificBooleanValueForTrue(); }
Admin
There is true and untrue and ununtrue but there is no false, unfalse nor ununfalse. If you are in 1984 then doubleplusuntrue is possible.
Admin
It's just that you misunderstood the name of the methods. When the name says LanguageSpecific, it means Java, not the international language. True and false absolutely are the Java language specific Boolean values for true and false. I realize this may sound circular at first, but think about it and it will make perfect sense.
(Early April Fools.)
Admin
Excel uses locale specifics in its formula language ;)
Admin
Good morning, everyone!
Who saw the sunrise, this blessed morning?
https://bit.ly/2DZjc8W
Admin
Localizations are for UIs - supporting foreign languages means showing the user "Apellido" instead of "Last Name" on a label. It doesn't mean changing the name of the variable in the class or the name of the column in the database.
This makes perfect sense, as CoyneTheDup points out, even if it is a little fluky.
Admin
You can't handle the truth!
Admin
https://github.com/OrbitalEngineers/April-1-Too-Ate-Teen-Committee
Admin
From what I remember, the old XLS format stores all its formulas compiled into reverse(?)-Polish notation and shows them in human language at run-time. I can't remember how XLSX/XLSM does it.
Admin
"Funny" Karl Marx: https://medium.com/@mad_edward_viii/funny-karl-marx-3192fde422fd
Admin
Well, we have two possible WTFs here:
(1) As you say, this could be intended for internationalization of text, for display on a radio toggle or something, in which case it's wrong for returning an actual boolean value rather than a string with an appropriate translation.
(2) They actually are using it for boolean logic, in which case whoever was responsible for this should be "promoted" to a new position that doesn't involving touching any sort of software requirements, deisgn, or code ever again.
Admin
I wonder how this programmer "internationalizes" decimal numbers?
Admin
Why is the FILE_NOT_FOUND part hidden by a "..." ?
Admin
Maybe they'd been raised on one of those computer languages where true and false are rather slippery concepts. Or they spoke a human language where it is very rude to say yes or no directly?
Admin
Internationalize this:
https://twitter.com/ha_king_on_hi/status/978682806845849601
Admin
This is needed because in hsilgnE true is eslaf and false is eurt.
Admin
dossier non trouvé
Admin
It's not !true...
Admin
Although the idea of defining all kinds of custom Boolean types seems strange, it's not at all unusual if you work in networking.
In SNMP, the standard "TruthValue" type is 1 for TRUE and 2 for FALSE. (See https://tools.ietf.org/html/rfc2579#page-5). I assume this is a user receiving zero will treat it as an error (no value or something similar) instead of as false.
I've also worked with domain-specific languages where enumerated values get auto-generated methods to produce string values (for UIs and debugging) that match the constants. So an application may have many different Boolean-equivalents (true/false, yes/no, on/off, etc.) to be used as appropriate for various sections of the user interface.
Admin
I dont like the solution given but someone has obviously worked with excel that for some reason exports true / false to JA / NEJ (<- in swedish) and only accepts 1 / 0 when importing...
Admin
It's Boolean. We have 3 possible WTFs. The two you listed, and:
(3) There is no test for 'false' - only 'not true'. Which means 'false' and 'file not found' are the same test.
Admin
Maybe with a ',' instead of a '.'?
Admin
It's Twue. It's Twue.
Admin
But what's the language-specific boolean value for Schrödinger's cat? FUR_NOT_FOUND?
Admin
I once had to deal with an old PHP app, where booleans where string 'v' [vrai] or 'f' [faux]. I let you imagine the rest of the code. Worst app I ever work on.