- 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
My condolences.
It's not only greed, poor ethics and ineptitude, but simply advances in technology. What once represented hours of work to craft and optimize to squeeze every last byte and cycle can be rendered obsolete in a year, now even the concept of optimizing is becoming obsolete. I don't really lament the changes; in many ways it's much easier and transparent to convert ideas into working code. Who knows where this will lead, will we eventually not need computer languages at all?
Admin
No one's ever going to see it at this point, but for bitstrings in Caché (the main MUMPS descendant at this point):
http://docs.intersystems.com/cache20101/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_fbit
Admin
Oops, I bit. You won.
Admin
Admin
Worst. Code. Ever.
IMHO the problem is not that it's plain stupid but that it combines an abundance of powerful tools in the worst possible combination. You can't make that stuff up really.
Admin
+1
III especially like this:
(Captcha "odjo".. dyslexic ninja training ground?)
Admin
This is so bad its LOL brilliant!
Admin
The real WTF is that the poster thinks an integer array is more compact than a char array. Even most booleans are word sized and not as efficient as a char array (assuming a c/c++ implementation that is).
Admin
OK so this is not a good example, but I contend that there are cases where string ops can be more efficient than integer ops.
Logic that can be computed via L-Systems, where string mutations are defined by simple grammars, is one such case.
Admin
After reading this and all the comments, all I can say is "Where would you like the tactictal nuclear strike?". My answer would be "Right here in this code!".
These should be removed "with extreme predijuce". The sooner the better!
Admin
There's a difference between having a good work ethic, and throwing yourself on a funeral pyre.
Me, I try to avoid doing work that requires asbestos underpants.
Admin
Considering that the original purpose was to allow non-programmers in the medical field to access and maintain data, the name is appropriate.
When the language was first introduced [I fondly remember working with it back in the 1970's on a DEC PDP-8] it offered an excellent solution to a real world situation.
I wonder what percentage of the people responding were even born in 1972, let alone doing serious programming <sigh>.
Admin
Admin
That's a lovely story, and you tell it so well.
Admin
...says the guy posting on a humor forum during working hours.
Admin
Admin
There once was a man from 1100110011001000001001100110011 Who put all his cats in a 0110011001000001110001100110011 When things became 01100001000001 He went back to the 01000101000001 And put everything else in the 1001100110010000010101100110011!
Admin
I had much the same thought.
Admin
Oops, I was replying to this comment.
Admin
[quote user="Procedural]I propose that we relabel all the "I'd quit" posters that pollute every single darn story as incompetent and lazy prima donnas. Take up gardening or something.[/quote]
I tend to agree. About 6 months ago I interviewed a candidate (I provide this as a service for a number of clients). Things were going reasonably well..not outstanding, but not horrible.
The person then started talking about on-line "technical forums" and provided his handle/avatar for a number of sites (including The Daily WTF). I did some background checks, and confirmed my findings were the actual posts of the client. So many were "bitch and moan" (as well as profane) that the candidate was eliminated from consideration.
Captcha: vindico - what happened to this candidate....
Admin
I think my brain wants to vomit through my eyes.
Admin
I'm guessing that MAYBE these bit strings were used to manually lay out the bits in a simple binary (two-color) bitmap image. Someone generates a text file with 0s and 1s to represent the off and on bits of an image. The text file is then read in and the strings are converted into bit patterns.
I did something like this way back in the DOS days when there simply weren't any tools for designing bit map images.
Admin
Theoretically every flag should have its own column. At least, if you want to have a good schema.
Admin
Yeah! 'Cause real programs never use bitmasks. (Yeah, I know C and C++ don't allow binary constants, but some languages do.)
I can do it but sometimes it's still easier to read them in binary form. We could choose to always use identifiers like 'x' and 'y' and manually convert them in our heads to what they represent, but that doesn't make it a good idea!
Admin
Oh my god, that 81 character string is a product catalog!
$ProductsController = new ProductsController; $arr = $ProductsController->getProducts($dbo, $sql, $_GET); $smarty->assign('results_tpl', 1); if(count($arr['catalog_arr'])>0) { $smarty->assign('catalog_arr', $arr['catalog_arr']); }
It's a good thing catalogs dont change frequently! (heh)
Admin
Kind of like Terminator, only we're being hunted by killer robots that take twelve hours to figure out how to walk across a room.
Admin
Admin
Don't worry Bender... There's no such thing as "two".
(waddia mean "Prove I'm not a robot"? bite my shiny metal...)
Admin
I completely agree with you. We need more programmers who care.
Admin
at the risk of sounding like a tedious troll repeating tired old memes...
I personally think that down at the more sensible sizes of bit field, e.g. an 8 bit or 16 bit register in a microcontroller, it's far far more human readable to specify bytes in your source in binary representation, I say this because it's a real pain if you have to work out what un-setting bit n in a given byte will result in every five minutes.
that said, there's no excuse to ever /store/ the value that way, that's just mental. If your database needs to be human readable/able to be manually edited regularly, then you're Doing It Wrong
Admin
The keyword in such a case is "refactoring"...
Meaning: Find work in a different software factory as soon as possible.
Admin
As for this story: OMG WHY!!!
Admin
Im going blind....
Admin
The real WTF is that multiple field values were encoded into a single database column. This both prevents indexing of the individual values, and ALWAYS results in convoluted code to query it, and as such is a practice that should be avoided.
If your database table has too many columns, something is wrong with your information analysis and the normalization of your database.
This "other way" of encoding the information you speak of is by splitting up the values into several records, which then may be queried by a (human-readable, if you wish) key.
Sure, it will be slow - but when indexed, it will run circles around a query requiring executing dozens of regular expressions per record. Also, you may then query the table by simply issuing something like
SELECT booleantable.keyvalue FROM redacted_table_name left join booleantable on (redacted_table_name.mainkey=booleantable.mainkey) where booleantable.keyvalue='warranty_expired';
It's also much more readable than getting the 43rd character from the boolean field.
Admin
Perhaps their design philosophy was: "Don't sweat it, it's only ones and zeros."
Admin
haHAHAHA.
When I saw the code, I acted on instinct and skipped it all. I don't know what that guy wanted to do but I know what I would leave in his database if I had to accidentally erase it.
001100011010100011110001111000110111000010100011110100011101 111101001111110110101000001011100010110100110011111000001001 101010101011000101011111110000010100101010110010011001111110 011010111111110111111100000101100101100011100000010101111111 011101000010101110101011000010010010111011110111110100001101 110100100001100111110000101001110111010000110100110011100011 001100111010101000000011101110010111010100100111110011011011 110000100111010101011110110001010100011010101000001011001111 101101111011010010010110100011001011011100001011110010101101 101010010011101100011101000001000110011101110110110101011001 101101011001110010110011011101100001100011001111100110000110 010110001110011100001000111000101001011000110010000010101000 011111010000000001000110000100110001000010111011101011000011 000110101111010101111110000011000101110111111000110000011110 011110100000100101110010001000110111110110001110111100011000 010000001110000101100001101000010110011000001010010011010000 100100011110111011000011110111101100010111101010011010101000 010010111101101101011110010101111001111100111011010010100001 110010111000101000011000010011101011010100000111000110000110 010011011100010011101101010100010001001100110010010010000110 000010100101001011101111100010011000011011110010011100110100
Admin
That would have to be 0 terminated binary strings, then!
Admin
Wonderful ^^ They invented involontary obfuscation...
And btw : who is this Akismet keeping me from posting ? THIS IS NOT SPAM ! Hmmm... wait... is it ? oO
Admin
hurray! bring justice to the trolls :)
I use this nickname on fora I rarely visit. I have 1 for atheist-fora, and 1 for technical fora. This way I can choose which nick to 'brag' with.
Admin
Who said always wrong? Anyway, assertion does not equal proof.
Clearly. Now relay that to the OP.
Admin
Hey, what? They use MVC, controller, view templates. It's enterprisey bussiness logic after all!
Admin
Admin
Reading this on my RSS reader that displayed no newlines whatsoever in that code...
I have lost the will to live.
Admin
Well, that was just stupid of him in the first place, regardless of the quality of posts. Some people just don't understand the value of having a personal life separate from a professional life. Some people are just ludus with how much they share online.
Admin
I thought I saw a 2! <shudders>
Admin
That code sample makes me regret having eyes.
Admin
I've had to deal with a binary string before, more than once. I would venture to guess that anyone who has never done so, either doesn't have that much experience yet or has a lot of control over their working environment. But maybe I'm just being pessimistic.
Admin
Here's the inevitable answer for converting 'based' 2 to base 10 in Caché ObjectScript, the most popular MUMPS out there:
Wow, now that's horrible, unreadable code. Whoever could even try to figure out what that does. I'm sure that any C or PHP version of the same code written by the worst programmer in the world must be much more readable by default...
Admin
a WTF written in PHP. never seen that before.
Admin
Now I've seen it I can't UNsee it, can I ? (reaches for revolver)