- 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
I really think this is way beyond Peter, more of a Paula principle: "see how brillant I am".
I once worked for a silicon valley company briefly (help desk software). The original code was written for unix by one of the founders, who was considered a genius (but not by most of the employees). On occasion he would edit some random code in the code repository without telling anyone, I suppose to keep his hand in. Of course it never compiled and generally caused random failure and much swearing by the real engineers.
Admin
I notice how its only after i create my RSS reader that you decide todo this, hehe
i know what hte WTF here is, integrating JS into an SQL statement, opening it upto real issues, if only people would learn to seperate code/content/visuals in a way that is understood by 90% of developers, but only about 30% actually do it that way
nice CAPTCHA, paste (on a pink background too, mmm makes me think of having crab sandwiches now)
Admin
If he were really clever he would have compressed the code by lumping frequent blocks of text together and then parsed the results with regular expressions.
Admin
Wow, I didn't know Satan could use a computer. How's it going?
I think a lot of these "programmers" have bad enough coding practices on their own without you placing these kinds of ideas in their minds!
Admin
|| is used for oracle. Apparently SQL = Oracle. I guess I have been wrong for a very long time!
Admin
HTML is XML :-)
Admin
Number 2 isn't that uncommon in fixed structure-based APIs. Number 3 isn't unheard of in silly APIs. Along those lines, we have to work with a SOAP-based web service, where all the actions take one parameter and return one value. Both the parameter and return are XML documents with the useful information in them. So, I can use a SOAP toolkit to handle the web service, but still have to use a XML package to process the arguments. All they're missing is the wooden table.
Admin
It was hardware specific to the M25PX0, a 3-wire SPI chip, specifically compiled for a 16LF88 and burnt into the Flash. If someone managed to get out an iron and some solder and change the chips, then they deserved what they got. ;)
I'm going to add a disclaimer onto my signature. That's twice that I've looked silly due to my...background.
Admin
Clever is good.
Convoluted is very very bad.
A neat trick doesn't just do something in a complicated way, it does it in a simple and powerful way. A clear 1 line statement beats an almost clear 10 line function, but both beat an obscure 1 line statement.
Admin
It's such a fine line between stupid, and clever.
-- David St. Hubbins
Admin
Alot of people seem to be suggesting using SQL to create HTML is a WTF. However big companies like Oracle do it look at Oracle application server. You would create all your HTML in PL/SQL.
Admin
PL/SQL is not that same like SQL.
Admin
Actually || is the official SQL standard concatonation operator... any DB that lets you use + is doing it as a favor so as not to confuse the programmer types.
Admin
Technically, HTML is not XML. XHTML is XML. HTML has some tags which break the rules of XML. For example, <img> tags don't need to be closed in HTML, but all tags need to be closed in XML.
Admin
This makes me think of common trait of witnessed across many domains.
There are three general levels of competence as somebody progresses in the knowledge of a particular domain.
Admin
What's your point?
Admin
Dude...........its TDWTF. That was way, way too logical.
Admin
Furthermore, in PHP, the concatenation operator is full stop, not plus (which is an arithmetic, not string, operator) ... just telling this to keep them programmer types on their toes; someday someone might decide they won't allow arithmetic operations on strings anymore :)
Admin
This is nothing...last place I worked had an entire web content management system written in perl.
Admin
And now, to make a metaphor out of this for no damned reason other than it pleases me to do so and might get a laugh.
If the problem is "Put this nail in this wooden board"...
The beginner will use a hammer and will take several swings to drive the nail in completely.
The Intermediate (Worst Case) will decide to use a 10-pound sledgehammer and will get the beginner to hold the nail so it doesn't move. It will only take a few swings to drive the nail in completely..and three broken fingers, two sets of x-rays and a cast.
The Intermediate (Best Case) will pick up the sledgehammer, realize it is too big and will grab a hammer after checking with his boss (the Master) but will probably still get the beginner to hold the nail. It takes two smacks to sink the nail.
The Master tells the beginner to get a hammer and drive the nail with one swing. He'll then look at his watch, decide it's been about 2 minutes since his last coffee break, and will leave to get a cup of java.
Admin
>>2 - The Nod -- Creative, as in, using a single 32-bit integer variable to store two 16-bit integers.
>>3 - The Raised Left-Eyebrow -- Very creative, as in, combining all function arguments into a single pipe-delimited string
>IMO 2 is by far more tricky than 3. 3 is almost normal in the age of HTTP and XML
Admin
I've already seen that kind of SQL where I work :P
Admin
<font face="tahoma,arial,helvetica,sans-serif">Sometimes I'm guilty of achieving #2 (sometimes even #3) in my attempt to 'cleverness' and 'neat trickiness' but I never dared to do this outside my pet projects. Though sometimes when I review these codes something will struck me and then, "Man, what was I thinking?"
</font>
<font face="tahoma,arial,helvetica,sans-serif">I agree, that's what the REAL neat trick is.
</font>
Admin
Oracle uses || to concatanate strings. Check out the I-Hate-Oracle Club forum on this site for an idea of how much fun Oracle is to work with.
Admin
But is it "tear" as in "ripped to tiny little shreds" or "tear" as in "weeping uncontrollably".
--
Colin
Admin
But is it "tear" as in "ripped to tiny little shreds" or "tear" as in "weeping uncontrollably".
Since thats "or" you're using and not "xor" the answer is yes.
Admin
I hope that finally convinces everyone using Apple WebObjects that you don't need to separate database, application and output...
One of the best WTF's i've seen in a while!
Coditor
Admin
Oh dear! I expect some of your code has been on here! Bet you spend about 20 hours a day maintaining your one dimensional code.
Hope I never join your company and I hope you never leave - sounds like they need you!!
Admin
<font size="2">nevermind.</font>
Admin
HTML is SGML.
XHTML is XML.
captcha: awesomeness - Score 6: Works as coded right after being put on a wooden table...
Admin
and XML is SGML btw.
Reminds me of...
.. Clark loves Louis
..Louis loves Superman...
...Clark is Superman.
Admin
No, HTML is SGML not XML.
Admin
That's why where I work, we gave the owner read only permissions on the repository. That way he can play all he wants, without doing any actual damage.
Admin
That is the great thing about the English language. It contains a rich vocabulary; offering many choices to explicitly express yourself, yet it is full of ambiguity.
English is a Crazy Language
Admin
Oh come on.. that's hardly clever!
What you need to do next is 'optimize' it all, instead of creating the HTML when you pull the data out.. you need to insert data with the HTML already mixed in.
You want a design change or to change a URL? "Sorry boss, we'd have to change the html in 14,000,000 rows to do that... give us 6 months or so and
everything will be in the company font".
I've seen it a few times already, and it makes me cringe just to think that people are allowed near any sort of rdbms.
Admin
Nope. Last time I checked, SGML didn't allow />.
Admin
No it's not. I use bitmasks all the time. 3 is not normal and is generally not used except by clever programmers. Sure, "1934|somestring|true|true|etc..." works fine in most cases, but what happens if one of the strings has a |?
It's also much worse than a string array.
Admin
http://www.w3.org/TR/NOTE-sgml-xml-971215M
Admin
...and then they hit up the san francisco night scene
Admin
Yeah, stop spreading ugly rumours about Louis. He's just going through a confusing time right now. When he's ready, he'll tell us whether he's gay or not. And either way, he's still our friend.
Admin
You mispelled unions?
Admin
I've done 3 fairly often in file I/O (since a file is basically a single string, delimiter splitting is a good answer for a lot of simple stuff), and also in Java applets (reading arrays from <param> tags is only acheivable this way afaik). I've only occasionally used 2, the messing around to get at the data usually takes away any advantage (even not counting the maintenance issue if you don't document yourself). I think the only time I've used this technique in any sort of anger was:
I dunno, this WTF isn't so bad. The mixing of database 'real data' and HTML is very shallow, as this query is called from the PHP; the 'correct' way would be to get the data and then make up the HTML in PHP (right?), so at least everything is where it should be (in the interface layer, i.e. the PHP), even if it's munged together in a mildly WTFy way.
Admin
Cry baby! Cry?
Admin
See, that's the beauty of The Cleverness Scale. A prerequisite for a 1 is "Gets the job done". A score of 1 means the code is only as clever as it has to be. Heck, it's even "efficient".
Admin
Now that is a wtf!
And I thought Perl using a '.' for concatentation was bad...
Admin
Admin
The reason developers like to build flexibility even into simple applications is because we all know that requirements change like the wind. End users/business users will look at a finished product and say, "It's great, but it would be even better if it could do X!" As developers, we understand that the average individual does not understand how software is engineered, and that adding requirements late in the game can require months of reworking, so instead of whining about it, hopefully we just learn to make things flexible and maintainable.
Admin
Javascript can be pretty, when you write it as you'd write... say... python.
No it's not, it's an abomination unto Tim Berners Lee.
Indeed, and this statement also applies to the web pages themselves
HTML and Javascript are different web pages, the former is the data, the latter is the behaviour, mixing them together results in blobs of ugly and unmaintainable horror.
Technically, HTML is an SGML application which is the less-braindead ancestor of XML. And the <img> tag is self-closing, it's always closed period. And that's very far from the only difference between HTML and XHTML (you could also talk about minimizable attributes, elements that really don't require to be closed such as <p> or <li> or case sensivity).
No, closed empty tags such as <img /> are completely invalid in SGML. Thus XML is at best incorrect SGML, and feeding XHTML to HTML parsers relies on "bugs" in the parsers to work.
Admin
Still better than awk's use of a space for concatenation.
Admin
Hmm... let's see:
- given that this is PHP, and CONCAT() and DATE_FORMAT() are standard MySQL functions (although using "+" for concat is I think a typo of the anonimyzer here), it looks likely that MySQL is the DBMS in question.
- "managing data for "93% of all health care facility inspections"
There is the real WTF. The horror.
Next we will find that MySQL was responsible for 93% of the data for fresh vegetable packing plant inspections. The whole spinach scare is starting to make sense.
Using MySQL for lightweight non-critical web-oriented databases: fine. Using it for mission-critical data which could affect one's health and life: wrong wrong wrong.
Why is the IT industry constantly trying to use the wrong tool for the job?