- 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
FTFY CONGRATULASHUNS! U HAS CHEEZBURGER
Admin
I have two of those
Admin
What about the pepsi pepsi?
Admin
I'm more interested in hasing the "asdfghjk" bit...
Admin
And if they went to all the trouble of hitting the middle row of a standard qwerty keyboard, what had the l done to offend them?
locurlicenseucesss I suspect is the result of a find-and-replace gone wrong, a clbuttic mistake ...
Admin
Location license success...?
This might be easier if we know WTF
mynum
was or$Q
was! D:Admin
Supercalifragilisticexpialidocious.
Admin
I've done that on occasion if it adds to the readability. Sometimes there's code nearby that has similar logic and why make the reader flip their mental state?
Admin
I've done it when the expression is more clear in the positive than in the negative. :) There's reasons to break every rule, right?
Admin
always nice when boolean NOT goes in the "too-hard" bin
Admin
Drunk programming?
Admin
I've done something like this a few times:
switch (value) { case valueX: case valueY: // these are OK, keep going break; default: // block/validate/whatever }
Addendum 2020-07-01 12:22: (and yet again I forget how to tag it to preserve line breaks, but anyway you probably get the idea)
Admin
https://xkcd.com/323/ ?
Admin
For languages that use an ! instead of having a 'not' keyword, the empty if is more readable.
Admin
It can, on occasion, more readable. Or is that "too-hard" to understand?
Admin
Two spaces at the end of a line preserves the line break, but you can also indent with four spaces for a code block!
Admin
I'm with @CHUDbert, that is a very drunken comment. You can tell because it looks like Perl.
Admin
Covfefe
Admin
I get real bad without sleep. Real bad. Twitching, distorted vision. Sometimes I just drop, like a light switch going out.
Admin
Wrong.
Consider the semantics. You are presenting two alternatives. One does nothing and has a useless comment, and the other takes an action.
Not to mention that the "validate" clearly doesn't, which is also terrible semantics. I presume it throws an exception or footles a global flag or something.
With markdown trepidation …
This assumes a programming style. Add a lambda for validation and pass it in as a parameter to RequiresValidation, if you like -- which would now be named IsValidated.
Never write a piece of semantically obscured crap that nobody, including you, will misunderstand in the future.
Admin
(This assumes a "fluent" programming style. No idea what happened there.)
Admin
It's a cool theory. Could be something as boring as replace "ls" or "liss" with "license", that it said LocUrlSuccess (minus the capitalisation). Any better suggestions?
Admin
Never write a piece of semantically obscured crap that nobody, including you, will misunderstand in the future.
If you read that carefully, you know why we get all the crapy code here...
Admin
validate(foo) unless foo.isExemptFromValidation();
Admin
if (!drunk) { drink.add(hardliquor); /* drink.add(mixer); / drink.drink(); / Won't reach: */ sleep(); }
Admin
That worked nicely, not...
Admin
I've occasionally written stuff as
Just so I can rearrange the subclauses more easily.
Admin
If you are writing super high performance real-time code, there can be cases where that is a bit faster....
Admin
Yes - I've had this happen (and caught it). Imagine if you will, an integrated development environment (a real stretch for PHP, I know). Now you start typing and the cursor has mysteriously disappeared and reappeared somewhere else. No idea where, but whatever your typed showed up there. Why isn't what I typed showing up? Let me type the alphabet...Nope still not there.
Hmmmm. code still compiles, let's close and reopen the solution. Ahhh... the keyboard problem is fixed now.
Admin
My friend did this in a project we were working on. I was looking through the code and I found a bunch of if else statements with empty if bodies. I asked him about it and he was just tired though, we've all written silly code when tired
Admin
LOCURLICENSEUCCESSS = locate / load / localize - current - license - success, or maybe load - curl (the program) - ice - non-standard execution (NSE) - cesspools, or local - URL - list - census - european union (EU)... cesspool. Maybe the first S in SUCCESS said, "I'm not worthy! I'm not worthy!", and moved itself to the end.
Admin
This is what happens if you use a language without an unless or guard statement.