- 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
<% = frist %>
Sorry... someone had to try.
Admin
Finally a good use for VB: JavaScript generation.
Admin
I just took over maintaining a web application very much like that.
Fortunately, I'm a supervisor, and I can delegate unpleasant tasks.
Admin
Oh God. Clasps hands to mouth I'm first!
Admin
If they were trying to be efficient and not send any unneeded Javascript to the browser, why did they bother adding CR-LFs to each line??
Admin
Admin
The next logical step would be to store the JavaScript in a database and have a injection-prone mechanism to let the client fetch the JavaScript code from the server.
Admin
TRWRF is that the variable is called strHTML not strJavascript
Admin
While the framework itself is very WTF-y, there also appears to be plenty of pain buried in the functions themselves. Looks like it'll accept 25 Octopuses, 12 Sepultura and 14 Marky~Mark as valid dates?
Admin
You always know that you're using solid, dependable, problem-free code when you see a boolean variable for "leap year" being calculated manually.
Admin
Swing and a miss!
Admin
Admin
So does vbscript and asp not support some sort of include function?
Admin
PHP doesn't look so bad now, does it?
Admin
um, dois, três, doze!
Admin
I think we're missing the point. If we assume that the desired goal is a good one, there is a quite simple pattern for incorporating javascript libraries that you might recall:
Admin
I like how they generate a Date object as the first line of code - and then promptly ignore it. Or how they determinedly use Systems Hungarian Notation in a language that doesn't have types.
Admin
text/html ... duh. application/javascript of course.
Admin
javascript has types, it just silently casts them and doesn't enforce them.
Admin
Admin
I can't decide? TRWTF is ASP, or TRWTF is JavaScript?
Admin
Admin
ASP, for all its antededents could do some OK stuff in a nicely controlled monoculture.
I used ASP to create javascript, but only when it was using queries to put in losts of data for context sensitive controls or where the data could change.
THIS hard coded notion is awful
Admin
TRWTF is using Ruby on Rails in the first place... wait... umm.
Admin
In modern .Net we would off course set up a SOAP webservice for this. And make sure it works only in IE, which shouldn't be too hard.
Admin
True, but it's a really sad that it took a comparison to 'classic' ASP to make it look, well, to put it nicely, not completely shit.
Can we get some variable-variables over here?!
Admin
Admin
Admin
Don't misunderestimate him, now.
Admin
Oh, I bet the coder that wrote this mess would have found a way to write the same thing in PHP. Just change the concatenation operator from "&" to "." and you're halfway there.
Admin
1: Systems Hungarian Notation = The original/good Hungarian Notation Apps Hungarian Notation = The bastardized Version that caused the bad reputation
2: The whole point of HN was to add information on what a variable is supposed to contain when the type system cannot tell you. Which makes Javascript one of the best possible candidates for it.
Admin
All this confustication shows a severe lack of edumacation!
Admin
TRWTF is that proprietary VB didn't fail because they were using Javascript. What kind of lame customer control is that?
Admin
I did something like that when i was experimenting with CGI and perl. 'twas around 1999. I showed that code to a friend, who said "what the **** are you doing that for? at least use here-doc notation". I did.
Maybe this coder did not have friends?
Admin
At least the generated JavaScript will have nice, pretty indenting.
Admin
Twisting tautologies into questions to sound hopeful is just... depressing.
Admin
This is the first wtf that actually made me say "wtf?"
Admin
Admin
Can't you people recognize a simple typological error when you see one?
Admin
Oops, my bad.
Can't you people recognize a simple typological error when you see one?
Admin
Dear Esteemed Professional,
I am very interesting with your beautiful code. Particularly with the CheckDateFunction. I am needful of this exact same function, except for using JSP. Could you pls post this ASAP?!?!
thx, Rajendra Kumar Senior Software Architect Abbas, Corp.
Admin
Admin
I'll bet that's how the jquery/jquery-ui "custom downloads" work.
Admin
No, I'm sure it's much more enterprisey (TM).
Most likely AbbasCorp.Commom.Util.Formatting.String.Concatenate(new AbbasString(Culture.Neutral, 'var date = new Date();'), new AbbasString(Culture.Neutral, '\n'), null, null, null, null), because '&' is just for amatures.
Admin
Well, when the types available to you don't bring enough information about what the variable is about, it's simpler to create another type.
Of course, that assumes you have a type system. Implicit type isn't a WTF on itself, but doing any kind of complex work with it is a major WTF. Hey, I've just put Lisp down...
Admin
Admin
Admin
Admin
Try "text/javascript". Oh, and drop the 'language="Javascript"', since that's been deprecated for well over 13 years.
Admin
I agree with whatever Quietust just posted above.