• Rob (unregistered)

    <% = frist %>

    Sorry... someone had to try.

  • fats geronimo (unregistered)

    Finally a good use for VB: JavaScript generation.

  • SCSimmons (cs)

    I just took over maintaining a web application very much like that.

    Fortunately, I'm a supervisor, and I can delegate unpleasant tasks.

  • Friday (unregistered)

    Oh God. Clasps hands to mouth I'm first!

  • BlackBart (unregistered)

    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??

  • grzlbrmft (unregistered) in reply to Friday
    Friday:
    Oh God. *Clasps hands to mouth* I'm first!
    Try again last week.
  • Severity One (cs)

    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.

  • the script kiddie (unregistered)

    TRWRF is that the variable is called strHTML not strJavascript

  • Studley (unregistered)

    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?

  • dpm (cs)

    You always know that you're using solid, dependable, problem-free code when you see a boolean variable for "leap year" being calculated manually.

  • justsomedude (unregistered) in reply to Friday
    Friday:
    Oh God. *Clasps hands to mouth* I'm first!

    Swing and a miss!

  • Captain Oblivious (unregistered) in reply to BlackBart
    BlackBart:
    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??
    The problem is that the "solution" does send JavaScript to the browser, and it does so every time the user goes to a page. If they simply put the JavaScript in a .js file and referenced that file in the HTML, the browser could download the JavaScript once and cache it. Or, they could write VB that would run on the server so no code would have to be downloaded to the browser. The "solution" ends up simply compounding the problem they were trying to avoid in the first place.
  • Adam (unregistered)

    So does vbscript and asp not support some sort of include function?

  • DOA (cs)

    PHP doesn't look so bad now, does it?

  • Max Cavalera (unregistered) in reply to Studley
    Studley:
    12 Sepultura

    um, dois, três, doze!

  • Gary (unregistered)

    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:

    <script language="Javascript" type="text/html" src="checkDateFunction.js"></script>
    <script language="Javascript" type="text/html" src="isNumericFunction.js"></script>
    
  • skington (cs)

    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.

  • Gary (unregistered) in reply to Gary
    Gary:
    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:
    <script language="Javascript" type="text/html" src="checkDateFunction.js"></script>
    <script language="Javascript" type="text/html" src="isNumericFunction.js"></script>
    

    text/html ... duh. application/javascript of course.

  • Gary (unregistered) in reply to skington
    skington:
    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.

    javascript has types, it just silently casts them and doesn't enforce them.

  • Lamentations (unregistered) in reply to skington
    skington:
    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.
    Well, if you ask me, a language that doesn't have types (which is incorrect, btw) is a perfect candidate for Hungarian Notation. That would be my standard workaround for a language that that does not implicily state how a variable is supposed to be used. I've encountered some Python code where everywhere a variable was referenced, the original writer added a comment to indicate how it was supposed to work. The only place he didn't put the comment it was misused, and a runtime error occurred.
  • Power Troll (unregistered)

    I can't decide? TRWTF is ASP, or TRWTF is JavaScript?

  • steenbergh (cs) in reply to skington
    skington:
    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.
    The Notation serves as a reminder to self so that you know what type of value you expect to be IN the variable. I have a lot of experience in Classic ASP and I always do this. I think it's more important in a weak-typed language than in a strong-typed one.
  • Bob Holness (unregistered)

    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

  • Jamie (unregistered)

    TRWTF is using Ruby on Rails in the first place... wait... umm.

  • Michiel (unregistered)

    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.

  • NOT the original, ORIGINAL by (unregistered) in reply to DOA
    DOA:
    PHP doesn't look so bad now, does it?

    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?!

  • Anonymous (unregistered) in reply to Power Troll
    Power Troll:
    I can't decide? TRWTF is ASP, or TRWTF is JavaScript?
    Well duh, TRWTF here is obviously VB.
  • Anonymous (unregistered) in reply to Bob Holness
    Bob Holness:
    ASP, for all its antededents could do some OK stuff in a nicely controlled monoculture.
    You almost sounded smart for a minute, right up until you started making up words.
  • Wonk (unregistered) in reply to Anonymous
    Anonymous:
    Bob Holness:
    ASP, for all its antededents could do some OK stuff in a nicely controlled monoculture.
    You almost sounded smart for a minute, right up until you started making up words.

    Don't misunderestimate him, now.

  • dgvid (cs) in reply to DOA
    DOA:
    PHP doesn't look so bad now, does it?

    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.

  • Kempeth (unregistered) in reply to skington
    skington:
    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.

    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.

  • Spoc42 (unregistered) in reply to Wonk
    Wonk:
    Anonymous:
    Bob Holness:
    ASP, for all its antededents could do some OK stuff in a nicely controlled monoculture.
    You almost sounded smart for a minute, right up until you started making up words.

    Don't misunderestimate him, now.

    All this confustication shows a severe lack of edumacation!

  • Coyne (cs)

    TRWTF is that proprietary VB didn't fail because they were using Javascript. What kind of lame customer control is that?

  • A german *gasp* (unregistered)

    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?

  • boog (cs)

    At least the generated JavaScript will have nice, pretty indenting.

  • Todd Lewis (unregistered) in reply to A german *gasp*
    A german *gasp*:
    Maybe this coder did not have friends?

    Twisting tautologies into questions to sound hopeful is just... depressing.

  • Steve (unregistered)

    This is the first wtf that actually made me say "wtf?"

  • hoodaticus (cs) in reply to dpm
    dpm:
    You always know that you're using solid, dependable, problem-free code when you see a boolean variable for "leap year" being calculated manually.
    Nice!
  • TW (unregistered) in reply to Wonk

    Can't you people recognize a simple typological error when you see one?

  • TW (unregistered) in reply to Wonk
    Wonk:
    Anonymous:
    Bob Holness:
    ASP, for all its antededents could do some OK stuff in a nicely controlled monoculture.
    You almost sounded smart for a minute, right up until you started making up words.

    Don't misunderestimate him, now.

    Oops, my bad.

    Can't you people recognize a simple typological error when you see one?

  • Rajendra Kumar (unregistered)

    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.

  • RootKid (unregistered) in reply to Anonymous
    Anonymous:
    Bob Holness:
    ASP, for all its antededents could do some OK stuff in a nicely controlled monoculture.
    You almost sounded smart for a minute, right up until you started making up words.
    So it took you a full minute to read the four words: "ASP, for all its"?
  • @Deprecated (cs)

    I'll bet that's how the jquery/jquery-ui "custom downloads" work.

  • NOT the original, ORIGINAL by (unregistered) in reply to @Deprecated
    Comment held for moderation.
  • Mcoder (cs) in reply to Kempeth
    Kempeth:
    skington:
    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.

    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.

    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...

  • Anonymous (unregistered) in reply to Rajendra Kumar
    Rajendra Kumar:
    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.

    Honestly Rajendra, have you not finished your calendar library yet? You've been working on it since June 2010, do you need some more codez plz? You just let me know good buddy. I can see that your calendar library is going to be the awesomest!
  • dkf (cs) in reply to Mcoder
    Mcoder:
    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...
    Depends on whether you're using the implicitly-typed system to coordinate components in some other language, or manning up and writing everything in one language. The latter is dumb.
  • CaptainOblivious (cs) in reply to Gary
    Gary:
    text/html ... duh. application/javascript of course.
    I think IE still doesn't understand the application/javascript MIME type. I've always needed to use text/javascript for IE. Oh, and I did already point out that you could reference .js files.
  • Quietust (cs) in reply to Gary
    Gary:
    Gary:
    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:
    <script language="Javascript" type="text/html" src="checkDateFunction.js"></script>
    <script language="Javascript" type="text/html" src="isNumericFunction.js"></script>
    

    text/html ... duh. application/javascript of course.

    Try "text/javascript". Oh, and drop the 'language="Javascript"', since that's been deprecated for well over 13 years.

  • Signature Guy (unregistered)

    I agree with whatever Quietust just posted above.

Leave a comment on “Functionally Functional”

Log In or post as a guest

Replying to comment #:

« Return to Article