The Daily WTF
-
public boolean checkFalse(Boolean bool) { if (bool.booleanValue() == Boolean.FALSE.booleanValue()) { return Boolean.FALSE.booleanValue(); } else { return Boolean.TRUE.booleanValue(); } }
-
BOOL AcceptAdjustment( int AccountNumber, int AdjustmentCode, char* Comments, BOOL IsAdministrative ) { // ensure that Adjustment code is valid for non-admin adjustments if ( IsAdministrative == FALSE ) { //... } //... // audit administrative adjustment if ( IsAdministrative == TRUE ) { //... } //... // check if adjustment should be applied to aggregates as well if ( IsAdministrative == 2 ) { // ... } //... }
-.-
-
how code looks to a real coder:
if(booleanValue) { //complete task }
how code looks to newbs:
if(booleanValue == true) { //complete task }
how code looks to the moron/crack addict:
function boolean figureBoolean( boolean bool) { if( (booleanValue == true) && true) { return true; else if( (booleanValue == false) && !false) { return false; } else return figureBoolean( (rand() % 2) == 1); } if (figureBoolean (myBoolValue == true)) { //complete task }
-
OMG, WTF
-
Das ist ja mal richtig geil
mfg
v R
-
Das hat doch niemand ernsthaft geschrieben, oder?
Was für Psychopaten...
-
das ist noch viel besser: http://www.c-plusplus.net/forum/viewtopic-var-t-is-116673.html
-
if(wert == 0) return 0; else return wert;
-
wtf schrieb:
das ist noch viel besser: http://www.c-plusplus.net/forum/viewtopic-var-t-is-116673.html
-
template<char c> struct p { static void ng() { static char const foo[] = { 'p', c, 'n', 'g' }; std::cout.write(foo, 4); } }; p<'e'>::ng();
-
try { // [lots of code that accesses database thru helper functions...] } catch (Exception e) { if (e.Message == "Cannot insert duplicate key row in object 'ProjectIDCode' with unique " + "index 'adx_Projects_ProjectIDCode'.\r\n" + "Unexpected error inserting Profile.\r\n" + "The statement has been terminated.") { lblError.Text = "This code is already associated with another " + "Project, please select another code."; return; } else { throw; } }
-
isActive = (isActive == true) ? true : false;
-
Power 0ff schrieb:
isActive = (isActive == true) ? true : false;
Haaa haaa!!
<- ich bin registriert!
Ausserdem, so was schreib ich nicht.
bool garbageCan = blockHead() != 0 ? true : false;
Na und?
-
Power Off schrieb:
Power 0ff schrieb:
isActive = (isActive == true) ? true : false;
Haaa haaa!!
<- ich bin registriert!
Ausserdem, so was schreib ich nicht.
bool garbageCan = blockHead() != 0 ? true : false;
Na und?
Du bist der echte, oder? naja, nun weis man wenigstens wie die ganzen daily-wtfs entstehen...
-
WTF?????????????????????????????
Bye, TGGC
-
[cpp]
bool garbageCan = blockHead() != 0 ? true : false;
// macht man freundlicherweise zu
bool grabageCan = blockHead();
[/cpp}MfG SideWinder
-
// macht man freundlicherweise zu bool garbageCan = blockHead() != 0;
-
// macht man freundlicherweise zu bool garbageCan = !!blockHead();
aber wozu?
-
garbageCan schrieb:
// macht man freundlicherweise zu bool garbageCan = blockHead() != 0;
Auch wenn's logischer ist, grade beim Ueberfliegen von viele Code kann meine Loesung besser lesbar sein.
Ausserdem fallen Fehler wie
bool garbageCan = blockHead() = 0; // Fehler?
dann sofort auf:
bool garbageCan = blockHead() = 0 ? true : false; // Fehler!
Das nennt sich: Gekennzeichneter Boolescher Ausdruck.
-
Power Off schrieb:
Das nennt sich: Gekennzeichneter Boolescher Ausdruck.
das nennt sich Gekennzeichneter Müll.