• Savaticus (unregistered) in reply to John Bigboote

    The scariest part of this is that the function only outputs a close table tage and then calls onether function who in the hell writes code like that? My guess is that all of this was written by a point and click programmer. I shudder when reffering to them as a programmer. This guy needs to spend some time behind the scenes using some good ol' WYGIWYG tools.

     

    For the uninnitiated:

    WYGIWYG = What You Get Is What You Get. Example: Vi, notepad, emacs

  • Solo (unregistered) in reply to ben
    Anonymous:

    What on earth does CSS have to do with any of this? The first paragraph might as well discuss the mating habits of the aardvark for its relevance to the code.

     

    It means, as opposed to good design where content is kept separate from layout by leveraging the power of CSS (I like the verb leverage, it's very enterprisey) the following example does the exact opposite. It uses code with obfuscation to output HTML in the most unmaintanable fashion possible.

    The first paragraph introduces the notion of 'best practices' and the rest of the post explains the WTF.

    The real WTF now is that I'm interested in mating habits of aardvark.

    Captcha: poprocks, indeed.
     

  • (cs)

    you see so many posts around the net about how you shouldn't use frontpage for your webpages because it'll produce crappy code, or don't use the save to .htm feature of ms word because you'll end up with so much rubbish... but seriously, as bad as FP and MSword are for html, I've never seen them do anything like this before.

  • Dan (unregistered)

    I think I just vomited a little in my mouth. 

     

    Yech.

     
    -D
     

  • l337 |-| /\ >< >< 0 R (unregistered) in reply to Savaticus
    Anonymous:

    The scariest part of this is that the function only outputs a close table tage and then calls onether function who in the hell writes code like that?

    Nonono, there's nothing wrong with that! You see, once upon a time, that was ugly code, but now it has been refactored with A LOT of "extract method"s. Do you see the beauty of it now?



    --

    Why can't I copy-paste the CAPTCHA? 

  • Alex (unregistered) in reply to ammoQ

    The code it outputs still looks like normal HTML... no obfuscation here. No one will see that ASP code anyway.

  • (cs)
    Anonymous:
    Anonymous:

    Just curious - if this was a Java/C++/C#/... IDE, you could just ctrl-click your way from one 'function' to the next, regardless of the useless names.

    Does such a beast exist for this sort of 'code'?

    I built a tool that does this. If anyone wants a copy, contact me a [email protected].

    So, did you find the tool usefull, when writing the webpage and keeping track of Box.asp-BoxB66.asp? :)

  • (cs) in reply to Jeff S
    Jeff S:

    I actually kind of disagree ... I think that most of the time, the person creating the WTF is working a hell of a lot harder than the person simply using best practices.  That's kind of the very definition of what a WTF is:  doing things that are simple in a very unnecessarily complicated and convoluted way.

    It's more like this: the person creating the WTF is at first too lazy to do it right, and then forced by deadlines and higher-ups to work much harder to get it to work at all.... And then doesn't learn from this experience, of course.

  • Rob (unregistered) in reply to R.Flowers

    I know this isn't an English usage website, but I always love seeing people criticise other people for their "incompetency". I'd do something to combat it, but I suffer from impotency in the face of their ignorancy.

  • Ishai (unregistered)

    Are you sure they didnt just want to draw a sheep?

  • (cs) in reply to R.Flowers
    R.Flowers:

    I'm used to seeing WTFs that are the result of

    • laziness
    • incompetency
    • ignorance

    But to do this...  It actually would require hard work, and maybe reams of notes, to produce a simple web page.

    It's simply the result of an inability or unwillingness to take a step back, look at an idea you've had, and realize as well as admit to yourself that it's complete rubbish. Some people witll go to great lengths to rationalize to themselves why their rubbish ideas are great. There's most likely a system behind the box numbers, and whoever came up with it thinks it's essential that the "box" names contain this (most likely rather unimportant, like the order in which they were written) information. Oh, and of course it's a "modular design", that's great too!
     

    I once saw someone post a benchmark that was pretty damn obfuscated, which used some sort of extreme hungarian notation, with all variables consisting solely of type, size and other technical information, a counter and NO semantic information. That guy though it was the best thing since sliced bread.

  • Still coding in C++ (unregistered) in reply to cconroy
    cconroy:

    > look

     You are in a maze of nesty little boxes, all alike.

    > wtf?

     Talking to yourself is a sign of impending mental collapse.

    > wear goggles

     They do nothing. 

    > hide under desk

     It is dark. You are likely to be eaten by a grue, or possibly a project manager.

    > quit

     If only it were that simple. You are in a maze of nesty little boxes, all alike...

    Oh, that is truly funny (speaking as someone who is old enough to have actually played Adventure on a mainframe...)

  • (cs) in reply to cconroy
    cconroy:

    > look

     You are in a maze of nesty little boxes, all alike.

    > wtf?

     Talking to yourself is a sign of impending mental collapse.

    < snip >

    Asshole.

     1st you make me ROTFLMAO.

    THEN I have to TRY to explain why I am laughing so hard to my non-computer, much less programming-literate wife!

    ( after a 10 minute set-up, she laughed too )

    ( I think it was a pity laugh... )

  • (cs)

    Wow! It's like I've gone back to MS Commerce Server 2000 all over again!

    (MS Commerce Server 2k was "Classic" ASP, and used an include called "HTML_Lib.asp", that was filled with functions that looked like this:

    Function RenderTextBox(ByVal sName, ByVal sValue, ByVal iSize, ByVal iMaxLength)
    	Dim htmInput
    	
    	htmInput = "<input maxlength=" & _
    		    DoubleQuote(CStr(iMaxLength))
    	End If
    	htmInput = htmInput & " name=" & DoubleQuote(sName)
    	
    	If Not IsNull(sValue) Then
    		htmInput = htmInput & " size=" & DoubleQuote(CStr(iSize))
    	End If
    		
    	If Not IsNull(iMaxLength) Then
    		htmInput = htmInput & " value=" & DoubleQuote(sValue)
    	End If
    	If Not IsNull(iSize) Then
    		htmInput = htmInput & " />"
    	RenderTextBox = htmInput
    End Function
    

    It was hell, I tell ya!
  • Olddog (unregistered)
    Alex Papadimoulis:

    <font color="#000099">function</font> BoxB66()
        response.Write (<font color="#990000">"</table>"</font>)
        <font color="#009900">'response.Write ("</td></tr>")
        'response.Write ("</table>")</font>
        <font color="#000099">call</font> BoxBEnd()
    <font color="#000099">end function</font>

    Can't help but notice all the end tags. 

    I suspect this was an (overly) designed effort to support *upgrading* from HTML to XHTML at some future point. The developer probably started out with an include file for each </tag> but soon realized the performance hit, and started constructing shortcut includes that embodied specialized nested tables, based on page geometry. ...Thus a proliferation of nested-tag closure files. 

    I also suspect that a matching opening <tag> file exists for each nested configuration.

    I've used tag libraries that functionalize common HTML tags which facilitate building HTML dynamically effectively. For instance - in a loop where the number of cells or rows of a table is unknown. However, all the tag functions were contained in a single file.

    But this...specialized nesting... is a goofy approach.  

     

  • ridingmybike (unregistered) in reply to John Bigboote
    John Bigboote:

    What's the generally-accepted programming term for the idea that a process that begins in one file or function should complete within the same file or function?

     
    It's called structured programming. And I agree with you :)

     

  • (cs)

    It's like something you'd see in a Lovecraftian horror story.  I mean, it was surely generated by a poorly designed code generator, but still.

  • Lizbyrd (unregistered) in reply to Ishai

    Anonymous:
    Are you sure they didnt just want to draw a sheep?

    This comment is brilliant. Truly brilliant.
     

  • Dean Swift (unregistered) in reply to cconroy

    Be careful. A comment similar to that spawned mudsh.

  • rob_squared (unregistered) in reply to KattMan
    Anonymous:

    <font color="#000099">function</font> BoxB66()

    Wow, shall we call this the BINGO programming pardigm?  All you need is boxO78 inside G65 withing N57 contained from I34 inherited by B12 and you will have a working one cell one row grid.  Want two rows, you need box G71 instead.  Of course none of this will be commented and you are only allowed to stick boxes together in the order they are called by the random box picker.

    Captcha=random as in randomly add boxes until you spell BINGO

    No, this is worse than bingo.  I can tell that you've never played it from thinks like having the number 78, or G having 65.  At least in bingo, certain numbers are only under certain numbers.  For bingo, its 1-75, with 15 numbers allocated to each letter.  B=1-15, I=16-30 and so on. 

  • anonymous (unregistered)

    Humm... a bunch of functions? 

     

    You can do that: 

    $ cat  includes/box*.asp > includes/toolbox.asp

     Remove the includes and add

    <!--#INCLUDE FILE="includes/toolbox.asp" -->

     I have a problem here, but maybe is rooted on the original article. 

  • (cs)

    Hahaha!

    Nezt time they'll think twice before forcing me to work on boxing day! 

  • (cs) in reply to rob_squared

    The verbosity of HTML combined with all the readability of assembly. Compiled assembly. Viewed as bitmap images.

     Brillant!

     

    On a more serious note, a sensible way to produce this kind of code would be to:

    1. Steal the code from your competitor

    2. Run it through a parser, generating a syntax tree

    3. From the syntax tree, generate one function for each node in the tree, one file for each original function and another container file for each original file.

    4. The competitor now has no chance in hell of proving that this code is stolen from them, but I guess some string constant put into the generated HTML that says "Copyright (C) The Other Company" might still be left in there for the sake of truthiness!

    (Insert frivolous amounts of printing and putting on wooden tables before and/or after any or all steps, at will)
  • Ownage Personified (unregistered) in reply to Ishai

    Anonymous:
    Are you sure they didnt just want to draw a sheep?

    From a box?

    Or from a hat?

     

  • Program.X (unregistered) in reply to olsner

    Tables for formatting. Urgh!

     

  • (cs) in reply to KattMan
    Anonymous:

    <font color="#000099">function</font> BoxB66()

    Wow, shall we call this the BINGO programming pardigm?  All you need is boxO78 inside G65 withing N57 contained from I34 inherited by B12 and you will have a working one cell one row grid.  Want two rows, you need box G71 instead.  Of course none of this will be commented and you are only allowed to stick boxes together in the order they are called by the random box picker.

    I wonder if this code was generated by civil cervants because they tend to use the same kinda obfustication. You need form 310a-61x7 if you have already filled in form 7231b6 unless you haven't filled in form 299g-87237k1-g36 in which case you should use form 42-n3728-f3f ...

    I also don't see why boxes are numbered like box0, box1, boxF... I would definately opt for more characters like box00, box01, box0F... In that way you can have up to 256 boxes and still have a nice alphabetical order.

    By the way, I have seen code like this in my time ...

    function startTable() {
       print "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
    }
    function endTable() {
       print "</table>";
    }

    ... snip ...

    <b>Here is some data</b><br />
    <?php
    startTable();
    ?>
    <tr>
    <td>blah</td>
    <td>blah</td>
    <td>blah</td>
    </tr>
    <tr>
    <td>blah</td>
    <td>blah</td>
    <td>blah</td>
    </tr>
    ... snip ...
    <?php
    endTable();
    ?>
    <!-- more html -->

    Coditor

  • (cs)

    This WTF is like matryoshka dolls, because there is a smaller WTF inside the big one : BoxB66 is closing a table, then the cell enclosing the table, then the line enclosing the cell, then ... a table!

    A table tag inside another table tag : a common little webby WTF inside this boxes WTF.

    Alex seems to have invented  the "matryoshka WTF"

     

  • PC Paul (unregistered) in reply to biziclop

    Hahaha!

    Nezt time they'll think twice before forcing me to work on boxing day! 

     

    You know, I think you've got it.

    On another thread - I vaguely remember the original 'Wooden table, take picture' WTF but I can't find it in the archives - anybody got a link for it?

     

     

  • flangeArtist (unregistered) in reply to J

    "If only they had used FrontPage"???  If only they wanted to make it EVEN worse!

  • Anon (unregistered) in reply to Rob

    I want to be an ignorancer when I grow up.  Think of the power.

  • J Random Hacker (unregistered) in reply to Rank Amateur
    Rank Amateur:

    But the boxes are numbered in hex. Doesn't that prove the original developer was a real programmer to whom we all must bow down?

    --Rank


    No. Real programmers use octal.

  • Asif Youcare (unregistered) in reply to J Random Hacker
    Anonymous:
    Rank Amateur:

    But the boxes are numbered in hex. Doesn't that prove the original developer was a real programmer to whom we all must bow down?

    --Rank


    No. Real programmers use octal.

     

    Ah the Honeywell 316 - with near-ASCII too.

     

  • BruteForce (unregistered) in reply to savar

    Nothing big though yet still enough to have seen some radical approaches to programming.
    And all you really have to get up to snuff on is vector and matrix algebra. (And there are lots of books that approach them from a gamedev view so its easier than the pure mathematicians approach). And to make it even better, you dont even have to know math do do game dev stuff. Sure, you wont be on the geometry or rendering team, but someone has to do the networking, server and level editor. :)

  • Fluffy the destroyer of Worlds (unregistered) in reply to BruteForce
    Fluffy:

    Nothing big though yet still enough to have seen some radical approaches to programming.
    And all you really have to get up to snuff on is vector and matrix algebra. (And there are lots of books that approach them from a gamedev view so its easier than the pure mathematicians approach). And to make it even better, you dont even have to know math do do game dev stuff. Sure, you wont be on the geometry or rendering team, but someone has to do the networking, server and level editor. :)

     

    I wonder where my quote went.

    Well, in reply to the dude that asked what I'd worked on and generic stuff on game dev.

  • C (unregistered) in reply to Savaticus
    Anonymous:

    The scariest part of this is that the function only outputs a close table tage and then calls onether function who in the hell writes code like that? My guess is that all of this was written by a point and click programmer. I shudder when reffering to them as a programmer. This guy needs to spend some time behind the scenes using some good ol' WYGIWYG tools.

     
    For the uninnitiated:

    WYGIWYG = What You Get Is What You Get. Example: Vi, notepad, emacs

    WYGIWYG? I always prefered the  expression YAFIYGI (You asked for it; you got it), with the 'tough' implied. If a 'programmer' cann't handle a YAFIYGI tool, they cann't programme.
     

     

  • blob (unregistered) in reply to Lizbyrd
    Anonymous:

    Anonymous:
    Are you sure they didnt just want to draw a sheep?

    This comment is brilliant. Truly brilliant.
     

    It was so good I'm reading it now. 

  • 4tehwin!!! (unregistered) in reply to Coditor
    Coditor:

    I wonder if this code was generated by civil cervants because they tend to use the same kinda obfustication. You need form 310a-61x7 if you have already filled in form 7231b6 unless you haven't filled in form 299g-87237k1-g36 in which case you should use form 42-n3728-f3f ...

    Coditor

     more likely created by a monty python character....

     <font size="1">Humphrey: I do wish you'd listen, Wymer. It's perfectly simple. If you're not getting your hair cut, you don't have to move your brother's clothes down to the lower peg. You simply collect his note before lunch, after you've done your scripture prep, when you've written your letter home, before rest, move your own clothes onto the lower peg, greet the visitors, and report to Mr. Viney that you've had your chit signed.</font>

  • boxes of what? (unregistered)

    boxes? I see no boxes!

  • anonymous (unregistered) in reply to boxes of what?

    Anonumous user wrote:

    Anonymous:
    boxes? I see no boxes!

     

  • Alex (unregistered) in reply to anonymous

    Unfortunately for serious web developers, developers like the OD who obviously haven't understood how to use  HTML and CSS appropriately have nothing better to do than develop such nonsense.

  • (cs)

    talking about obfuscation, you should take a look at GXPortal and its parent and child applications GeneXus and GX Theme Editor...

    just look at the code it generates (GXPortal homepage is a good sample) and drool at the state of the art obfuscation, coupled with 1998 state of the art HTML and over-redundant generated CSS to encourage a state of the art boxes-of-boxes approach. 

    and all this in a nice thirty-something thousand dollars package ^_^

  • marco (unregistered)

    i could have been blind and predict they are using VB. It was out of the question.

    After one mid-sized VB project some months ago that i had to take care of, i now truly can stand up and laugh at any VB Coder. Not because of prejudice, but because of proof.

    I forgot the syntax, so keep it if you have corrections... :D

    -- snip---

    Dim Integer(20) intarr Console.WriteLine("Length: " & intarr.Length)

    -> Length: 21

    --snap----

    best regards

  • Ian (unregistered)

    Ok, I think this is a 50/50 chance I saw this being built by my coworker back in 1999.  It was at a large company and it was ASP.  This guy, for some reason, thought that he should build all the html functionality within the asp vb code.  He gave us a presentation of his code, which he had spent quite some effort building, and we all just rolled our eyes.  "Who would want to maintain this monstrosity?"  "Why did he 'reinvent' asp html?"...

     I left that contract after 6 months and the last I heard the whole team had been fired except for him because no one could maintain his code and his system was deemed an essential reporting application.
     

  • (cs) in reply to marco
    Anonymous:
    i could have been blind and predict they are using VB. It was out of the question.

    After one mid-sized VB project some months ago that i had to take care of, i now truly can stand up and laugh at any VB Coder. Not because of prejudice, but because of proof.

    I forgot the syntax, so keep it if you have corrections... :D

    -- snip---

    Dim Integer(20) intarr Console.WriteLine("Length: " & intarr.Length)

    -> Length: 21

    --snap----

    best regards



    Someday, possibly after the heat-death of the universe itself, people will realize that the plural of "anecdote" is not "data"

    I suspect that once that happens, we'll all be better off.

  • (cs) in reply to anonymous
    Anonymous:

    Anonumous user wrote:

    box0:
    box4:
    boxF:
    BoxB66:
    Anonymous:
    boxes? I see no boxes!
    BoxBEnd:
    box:

     


    <font face="tahoma,arial,helvetica,sans-serif">Fixed that for you... You wouldn't want to confuse <font face="tahoma,arial,helvetica,sans-serif">him </font>as to which box you're refering right?



    </font>
  • (cs) in reply to xrT
    xrT:
    Anonymous:

    Anonumous user wrote:

    box0:
    box4:
    boxF:
    BoxB66:
    Anonymous:
    boxes? I see no boxes!
    BoxBEnd:
    box:

     


    <font face="tahoma,arial,helvetica,sans-serif">Fixed that for you... You wouldn't want to confuse <font face="tahoma,arial,helvetica,sans-serif">him </font>as to which box you're refering right?
    </font>

     

    How about a little out-of-the-box thinking? 

  • FIA (unregistered)
    Alex Papadimoulis:
    <!--#INCLUDE FILE="includes/box0.asp" -->
    <!--#INCLUDE FILE="includes/box.asp" -->
    <!--#INCLUDE FILE="includes/box2.asp" -->
    <!--#INCLUDE FILE="includes/box3.asp" -->
    <!--#INCLUDE FILE="includes/box6.asp" -->
    [ ... snip ... ]
    <!--#INCLUDE FILE="includes/boxF.asp" -->

     

    Wow, with all these boxes we just need a hotline to the banker and we've got ourselvs a gameshow.

     "I'm ready for the question Noel..."
     

  • Axel (unregistered) in reply to John Bigboote

    Yes, no-one shoud ever split a function / class into multiple files. That is just wrong. Like not thinking of splitting >1000 line code into seperate classes.

    Perferably, one file shuld also contain only one programming language, something that seems impossilble in web design.

    Which makes me happy never to have done a web project for money....

  • Axel (unregistered) in reply to gonchuki

    gnaaah! I'm blind. I will disable the view source function in my firefox immediately. Nothing good can come from this...

    I was almost happy with 
    document.write('<img border="0" src="'+ x800x0[pickRandom(4)] + '" />');
    but, but
    <input type="hidden" id="W0014W000600010002W0003" name="W0014W000600010002W0003" value="Hgxpc007"/><table cellpadding="0" cellspacing="0" width="100%"><tr><td > <table id="W0014W000600010002W0003SFCONTENT" ...
    ...

    Arghhhh the humanity!

    CAPTAHA: whiskey ... now that you mention it ...

Leave a comment on “Boxes And Boxes Of Boxes”

Log In or post as a guest

Replying to comment #:

« Return to Article