- 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
Comment c = ""; c = c + "What "; c = c + "The "; c = c + "Fuck?";
Admin
Syntax error.
Admin
Wow.. that has to be one of the best WTFs in a long time... wow.
Admin
Even better, holding the string in Session() while trying to concat the whole monstrosity together.
Ouch.
Admin
Oof. Thats quite the... code.
Admin
Holy Cow! (RIP:)
Admin
My eyes!!! The goggles, they do NOTHING!!!
Admin
That needs to be up for an award.
Admin
Apparently someone
a) doesn't have write access to the style database, or doesn't know he has write access to the style database,
b) was working on a system which Many Moons Ago had plans for users to set their own styles, but those plans have been scrapped,
c) cannot create actual CSS files,
d) doesn't believe in Join() or local variables.
... WTF?
Captcha: doom (what I want to play with this person, my infammo chaingun against his 1-shot-per-clip pistol)
Admin
Let's see, that's:
approx 100 string concatenations outside the main loop approx 10 string concatenations inside the main loop * numRows approx 8 string concatenations inside the inner loop * numFields in what should be a join
for a grand total of waaay-too-many!
barfs
Admin
No syntax error if we assume C++ and
class Comment : public std::string {};
Admin
Jesus. The code makes no sense, and even the CSS makes no sense - "tdWhiteBdr" and "tdBlackBdr" is exactly how style sheets are NOT intended to be used.
This is a true scrap-and-rewrite case, not even worth trying to salvage.
Admin
There are so many things wrong here I don't know where to begin. Session variable to join the whole style together? UGH. What a disaster.
Admin
I've seen this before too, unfortunately. In this other case it was actually HTML, and they had the guts to not only put it into a database, but to concatenate it with ASP variables and document.write() calls before using Response.write to send the whole thing to the client.
Imagine, for a moment, if you will, trying to read HTML that is escaped for inclusion in Response.write AND document.write() all at the same time. :shudder:
Admin
The thing is... I could see myself at one time thinking, "hey, wouldn't it be great if we could abstract away some of the CSS code. Maybe put the class names in a table."
I'm pretty sure I'd have stopped long before it got this bad, though.
Admin
Oh My God! [image]
Admin
Where the hell are my googles? Aaaah, no, this is not possible, I hope the man who wrote this is long dead.
Admin
Oh my! I hope the man who wrote this is long dead. Otherwise I would have him explained: What the f*ck?!
Captcha: waffles, yeas I could eat some!
Admin
There is nothing good or redeemable in that code. Could you imagine coding out 10k worth of CSS using that mess? I would certainly want to be paid by the hour, and spend about 30 minutes drinking hard liqour in a decontamination tank trying to forget about the horrible abortion of code I'd just foisted on the world.
I think one of the more horribler things about the code is that it looks like they perhaps learned a little bit about CSS, but not enough to get away from a table-based layout (on non-tabular data). They also didn't take the time to learn any CSS shorthand.
Admin
Nice, reminds me of the eComm/CRM app I was responsible for maintaining when I started my career as a web dev. We had a Styles table that had a field for every single CSS property, so every style created by a user was stored as a row with individual values set in each field.
Of course, this was the same app that would paste an entire form page's content in a <input type="hidden"> so you can store what the user had typed on the previous form page(s).
Admin
It's possible that the development team got a new server and they were stress-testing it.
Admin
I really would rather die than work with CSS code that bad.
Admin
Whoever wrote this code is a <strong_language>Fucking</strong_language> Moron
Admin
Maybe he overloaded the '+' operator in the Comment class
Captcha: ninjas - sweet
Admin
All I said when I read that was "What the flippity??"
That's not just a monstrosity... it's a total aberration to the human brain because no one in their right mind would think that even remotely logical!
-- Seejay
Admin
FAIL
Admin
Holy shit! I can emphatize with the OP, I'm dealing with a similar situation. Only in my case, someone decided it was a good idea to write out the head and body tags and the go through the entire Control collection (ASP.NET) and add each Control manually. Ugh
Admin
Cry. Delete. Rewrite.
Admin
I bet this code got past the reviewers because he "cool-cammed" it.
Hey why are you saving it in a server variable? Look at his nice font! Ohh. Ahh.
Admin
I use the s = s + "..." ... some times in shell scripts when you need to build a path or whatever and when you might expect to need to change the order. And just for readibility, too.
That way, even in vi or notepad it's a simple edit to reorder:
set CLASSPATH = %CLASSPATH%;c:\apps\xerces\bin... set CLASSPATH = %CLASSPATH%;c:\apps\xalan... etc.
But clearly this dude was deranged.
Admin
I read this site all the time but never comment.
That's the first post that's moved me to comment.
Simply... wow. That just messes with your head far too much.
Admin
Admin
So, aside from this being horrible (aka fantastic WTF!), it doesn't even produce a working style sheet! WOO!
Admin
My god this is bad.
This is a good example of why separating code and content is a good idea. It's amazing that some people still haven't learnt about templating languages...
Admin
haha, I did something similar a long, long time ago.
We had an admin section where admin users could change colors online. I stored the colors in a table on the SQL server and wrote out a big <style> block at the top of each page. Though the query to build the code was just a simple loop, and all the static CSS was in a separate file.
Admin
Ugh. I agree with all of the afore mentioned reasons why this is just... ugh (bad use of css, misuse of session etc.)
Although I do admit to having produced something as mangled(but not as ... bad..) after I had to write perl-cgi output to generate an email newsletter. Not so hard eh? 2 hrs later it was done and had a nice css stylesheet to look purty. Then it was discovered that Lotus Notes (uh. internal newsletter and guess what our email system is?) likes ignoring most aspects of stylesheets. Back to inlines with all sorts of sticky conditionals (if value > 5 make table cell blue etc.)
So perhaps this wasn't the intended design (if you can call it that) but rather what it ended up as after some "just get it working" hacking.
Of course we all go back and fix it later right? :/
Admin
So tblCSSClasses contains CssClasses.. and other things!
Admin
C++ does not inherit constructors. Comment's constructor does not take parameters. Comment c = ""; will not compile
read Stroustroup book before trying to be funny with C++
muhahaha :)
Admin
Admin
Admin
It'll contain styles assigned either to classes or Id's, at a guess.
Admin
Admin
Yes, but if we assume a custom class that does not inherit from string then a constructor:
Comment(const char *String)
will compile this code just fine.
Admin
Absolutely the best WTF we've seen lately...
Admin
Just saw this:
trim(rsCSSDetail("PropertyName") & " ")
WTF!?!?! Append a space and then trim it?
Admin
This is yet another reason why I occasionally fall on my knees and thank God that I do not develop Web applications.
Admin
This may be ignorance, but I have never understood how CSS and "table-based layout" are alternatives to each other. Even when using "table-based layout," I am likely still using CSS for something.
To me, CSS seems to have one huge flaw. I do not understand why the styles are applied hierarchically. If I apply a green, 1px solid border to something, very rarely do I want that setting to "cascade" to that control's child controls.
I like the ASP.NET 2.0 "themes" system, which allows one to apply named styles to server-side controls without causing any "cascading." I wish client-side styles were more like that.
captcha: dubya (wtf?)
Admin
regarding the tdWhiteBdr and tdBlackBdr classes...
aside from the fact that they could have just done the four border styles in one line why exactly is css "not intented to be used" this way? is it just that they don't lock it into the "td" element?
Admin
Admin
too late! he made an empty class. we can see it clearly!