• (cs) in reply to Buddy
    Buddy:
    Once had to do an on-line survey for a large client. The major distinctions - irregular hierarchy, temporal dependencies, major and minor differences by division and geography, bilingual with unilingual subversions, regular and short versions, extremely complex branching, and added to that, five separate contests. All of this unified into a single equally complex real time on-line reporting interface.

    All of this layered organically onto an initial project of much simpler scope. The client blew through years of change requests in months. Did we ever say "No" to the client? Not once. We were whores, they knew it, and we knew it.

    The resulting beast was a masterpiece, akin to one of Hieronymus Bosch works, beautiful as a whole, but grotesque in its details. To maintain it was to slowly feel your soul, sanity and sentience ebb away as you became one with the Evil.

    So many after me have cursed me and my creation, that surely in my Hell awaits the Beast and its faithful minions -- the client and the ever present never ending change order queue.

    Umm, Facade Pattern. (On top of the project of "much simpler scope." And assuming that your requirements were not insane, which I rather doubt. In which case, how fast can you run a forty-state dash?)

    Better luck, and less wasted effort, next time. Assuming you're worth it. Plz Send meh teh evdienz.

  • Noremac (unregistered)
    TFA:
    Surely, he'd be able to find the files he needed to look at after that.

    Don't you know you should never look at 'files' at work. And stop calling me Shirley.

  • Nick Young (unregistered)

    Correct me if I'm wrong (not an asp developer), but isn't the real WTF here going to be that you've got so much Disk I/O that under any reasonable load the application is going to crumble under the pressure?

  • Cheong (unregistered)

    IMO, seeing that many includes for ASP is rarer than PHP pages.

    In an average size PHP project, it's not uncommon to see hundreds of .inc files... just that the nested level in this story is still uncommon.

  • FatherStorm (unregistered)

    sadly... My boss, who can code classic ASP but has never taken a actual programming class, has written sites like this. His solution to not knowing about fuctions is to use includes as fuctions. Also to create a new DB connecton for EACH query. and never close them. and recreate the connectionstring EACH time. we just ported to a new box...
    pity me.

  • Andrew (unregistered)

    42

  • 008 (unregistered)
    <Added to list of include files> <!--And grab me a drink while you're at it!--> include beer-74.asp
  • Herby (unregistered)

    All of this reminds me of QUITE a bit of HTML email. I get a bunch of my email in text form (not displayed by the browser). Just to say a couple of words so much JUNK is added. If you want to see the verbiage that gets produced attempt to look at the "plain text" version of an email. It ends up being almost 100x of the "real text" that gets transmitted.

    All in all HTML and by reference CSS should be banned for life, and a death penalty should be imposed for their use.

    Bring back "plain text"!!

  • b0ttomfeeder (unregistered) in reply to DaveK
    DaveK:
    cparker:
    Addison:
    Trust me, after using find for an hour solid you pretty much want to punch a hole through your monitor.

    And who the HELL thinks it necessary to have that many includes? Seriously. Makes me want to punch a baby.

    Anger management, anyone?

    Anger management makes me want to punch a hole through a baby!

    In soviet russia, Baby punches hole through you.

  • Franz Kafka (unregistered) in reply to Nick Young
    Nick Young:
    Correct me if I'm wrong (not an asp developer), but isn't the real WTF here going to be that you've got so much Disk I/O that under any reasonable load the application is going to crumble under the pressure?

    Probably not; IIS can cache all those files, so they only load once. It's still a maintenance headache.

  • scav (unregistered) in reply to starlite
    starlite:
    this kind of stuff looks an awfull lot like MFG/PRO, a progress based manufacturing software suite.

    In one of my debugging sessions, I made a similar script. it traced all includes recursively and wrote them to a file. I even made it so that it would only trace into each include only once.

    I had forgotten about Progress, and you just brought back a lot of traumatic memories.

    Like: inclusion is done with stupid { } syntax, an include can contain substitutions to be inserted into the file as it is included, the difference between &scoped-define and &global-define, ...

    Come on, post some Progress WTFs, you must have hundreds if you work with MFG/PRO

  • Rhialto (unregistered) in reply to VrIgHtEr
    VrIgHtEr:
    ! ! !

    Guess my IP will be banned now...

    Is your Internet Protocol different from my Internet Protocol?

  • parta (unregistered)

    This reminds me of when I did a recursive include in coldfusion to solve a website navigation problem..

  • John Sourcer (unregistered) in reply to MR
    MR:
    make ASP a little more object oriented (or something) the same way you might fake it in JavaScript

    Ignorance is bliss:

    http://javascript.crockford.com/javascript.html

    Is JavaScript object-oriented? It has objects which can contain data and methods that act upon that data. Objects can contain other objects. It does not have classes, but it does have constructors which do what classes do, including acting as containers for class variables and methods. It does not have class-oriented inheritance, but it does have prototype-oriented inheritance.

    The two main ways of building up object systems are by inheritance (is-a) and by aggregation (has-a). JavaScript does both, but its dynamic nature allows it to excel at aggregation.

    Some argue that JavaScript is not truly object oriented because it does not provide information hiding. That is, objects cannot have private variables and private methods: All members are public.

    But it turns out that JavaScript objects can have private variables and private methods. (Click here now to find out how.) Of course, few understand this because JavaScript is the world's most misunderstood programming language.

    Some argue that JavaScript is not truly object oriented because it does not provide inheritance. But it turns out that JavaScript supports not only classical inheritance, but other code reuse patterns as well.

  • (cs) in reply to Zylon
    Zylon:
    DaveK:
    cparker:
    Addison:
    Trust me, after using find for an hour solid you pretty much want to punch a hole through your monitor.

    And who the HELL thinks it necessary to have that many includes? Seriously. Makes me want to punch a baby.

    Anger management, anyone?

    Anger management makes me want to punch a hole through a baby!
    With BRAWNDO you'll be able to punch holes in TEN THOUSAND BABIES!
    WHAT?! TEN THOUSAND???!?!
  • (cs)

    Clearly the original developer thought includes worked in ASP just like they do in C++.

  • Shill (unregistered) in reply to Addison
    Addison:
    Richard:
    And he couldn't find order.display.2.CostCenter.inc.asp through a file search why? Not saying that its the culprit, but its a pretty good place to start looking...

    Sigh. Those who do not understand the power of a find/grep, and all that

    It's not about being able to use the find functionality of your development environment. It's about having to jump around 100 times in order to get anything done. And while a find makes that simpler it certainly doesn't make it bearable. Trust me, after using find for an hour solid you pretty much want to punch a hole through your monitor.

    And who the HELL thinks it necessary to have that many includes? Seriously. Makes me want to punch a baby.

    A guess now we know why things like this happen:

    http://www.wtvh.com/home/related/34891569.html

  • (cs) in reply to halcyon1234

    /me wishes for the blackout panic sunglasses from HitchHiker's Guide to the Galaxy.

    /me gouges eyes out as he transforms into a SteelDragon to fly away

  • Occasional ASP debugger (unregistered) in reply to Shill

    Sorry, that is not funny, and a tasteless comment. Please leave this board and don't come back.

  • Occasional ASP debugger (unregistered) in reply to Occasional ASP debugger
    Occasional ASP debugger:
    Sorry, that is not funny, and a tasteless comment. Please leave this board and don't come back.
    This was referring to the post two above with the link to the news story.
  • (cs) in reply to ParkinT
    ParkinT:
    It's a fractal.

    Best comment ever.

  • HitItHarder (unregistered) in reply to Steenbergh
    Steenbergh:
    And the most sorry thing is, my current assignment isn't all that different than this code snippet.

    I come from ASP.NET, backed by VB. Always write code with Option Strict ON explicitly defined at the top of my files.

    But in this classic ASP app you can see includes working on variables defined in the main page, calling functions from even other includes, who do exactly the same.

    Makes debugging a p@in in the @ss...

    <%Option Explicit%> should always be used in 'classic' ASP I generally find when I don't see it that the code will have been written by a dick.

  • RiF (unregistered) in reply to Konrad
    Konrad:
    What makes this even worse (if it was ASP) is that ASP does not support conditional inclusion.
    There are ways to do it, if you use your imagination ;-)
  • Øystein (unregistered)

    It must be the not so widespread "Include-file oriented programming".

  • Brian White (unregistered) in reply to LightStyx
    LightStyx:
    //first... edit... second =\

    ASP should die... well at least the old version of ASP, I'm having to go through one of our applications made by entirely ONE person 8 years ago and there's so much inline SQL and VB.... it's not even funny. BAD CONSULTANT! BAD BAD CONSULTANT! Overpaid and lazy!

    Not an ASP problem. Our ASP site is all stored procedures. Whenever I'm reading a book on .Net where they show examples of doing a database call and they build up in-line sql I just shudder. Which is again, not a .Net problem, just a coding problem.

  • Brian White (unregistered)

    variables.code.lifesuck.inc.asp

  • (cs)

    And to think I scrolled through that quagmire only to find that there are no hilarious problem resolution antics.

    Shame on you WTF (and you too Scott A)

  • Shill (unregistered) in reply to Occasional ASP debugger
    Occasional ASP debugger:
    Occasional ASP debugger:
    Sorry, that is not funny, and a tasteless comment. Please leave this board and don't come back.
    This was referring to the post two above with the link to the news story.

    What I find tasteless is people joking about punching babies. My comment was not meant to be funny.

  • Cookie (unregistered)

    Just to do the inconceivable and come up with an on-topic comment:

    This sort of thing is why I usually use magic comment tags to document dependencies and include the entire list in the correct order in the main file. And yes, generating that list can be done automatically using a small shell script.

    Ok, at about a page not that small, and it was awk, but hey. Yes, it accepted both magic tag comments and regular include statements. It also helps to regularly review the dependency requirements, but arguably that's part of code refactoring which should be an ongoing effort on large and/or old enough projects anyway.

  • abcdefgh (unregistered)

    or maybe his own "tree-generation" code was whacked? :p

  • chkno (unregistered) in reply to dkf
    dkf:
    We need a UML tool just to visualize the include graph!
    UML tool, hua? This shell script worked just fine for me:
    awk '
      BEGIN { print "digraph {" }
      { match($0, /^ */)
        level=RLENGTH/2
        stack[level]= $1
        if (level > 0 && !seen[stack[level-1]"@"$1]) {
          seen[stack[level-1]"@"$1] = 1
          printf "\"%s\" -> \"%s\"\n", stack[level-1], $1
        }
      }
      END { print "}" }' |
    unflatten -l20 -f    |
    dot -Tpng > includedag.png

    Result (warning: 21997x2747 image)

    WTFs visible from here:

    • Every file that includes catalog.display.product.files.inc.asp also includes catalog.display.productADD.inc.asp.

    • order.display.2.inc.asp and order23.display.2.inc.asp have a largely overlapping set of includes related to billing. Moving this list of includes into an order.display.billing.inc.asp or somesuch, and including that from both order.display.2.inc.asp and order23.display.2.inc.asp would simplify the include dag.

    • Similarly for Object2.0a.obj.inc.asp and Object2.1.obj.inc.asp including a bunch of Storage stuff.

  • (cs) in reply to Scott

    In general, writing reusable web applications, where the same code base will be installed onto multiple sites, is difficult. Most developers are never involved in such development as the vast majority of web development is for a single installation or website. Doing this type of development in ASP Classic is even more difficult IMO because it requires even more discipline than ASP.NET to do it correctly as evidenced by the include hell in this WTF post.

  • slevdi (unregistered)

    Without seeing what is actually in the include files I can't be sure, but guessing from the naming convention used, the designer is overcoming the lack of MVP capability in Classic ASP by putting methods into these include files and then wrapping them with a class definition, thus:

    Class PageView

    <!-- #include="includefilename.asp" -->

    ...ditto ad infinitum... End Class

    The includes would have subs that managed the presentation only, with data supplied by a Data object passed via Session scope:

    Sub DisplayPage() ...output html here... End Sub

    Calling like this:

    Dim pageView set pageView = new PageView() select case action case "DisplayPage" call pageView.DisplayPage() case "AnotherDisplayPage" call pageView.AnotherDisplayPage() case ... end select

    Or maybe not.

  • (cs) in reply to offended
    offended:
    LightStyx:
    Chrisos:
    Seems OK to me, why code, when you can have one or two includes in the code and everything is magically just there!

    Clearly, if you can't undestand the magic and/or maintain massive trees of information in your head, you should get out of the kitchen... or something.

    It's all BFM - Black F***king Magic!

    Can I get an apology from the commenter? In this day and time, you don't sit around a message board, where you have diversity, and refer to black f-ing magic.

    http://www.youtube.com/watch?v=20a-exAW6qc

    3 months late with this.

    NO! You will not get an apology because that whole situation is just stupid, silly, and just plain idiotic.

    It's like saying I want the sound of a car horn to be changed because people refer to it as "HONK" which then in term means HONKY which further means all white people yell at others when they others are in their way.

    Black magic is a term that is well over 600 years old and has absolutely NOTHING to do with color and on top of that. Stop with all of the PC bulls**** and spend some of your time doing something constructive. And further more I'm sick of people using the term "racist" which is a socially engineered term which clearly ignores the fact that WE'RE ALL THE SAME RACE!

    Addendum (2009-03-30 12:31): That video still makes me LOL

  • Sargo Darya (unregistered)

    Hey guys,

    I wrote a PHP function wrapper library. It has every function of PHP in a single file so you can include a single function without overloading the server <- WTF???

    Seriously... even a bad content management system doesn't have that much of includes.

  • Danny (unregistered) in reply to LightStyx
    LightStyx:
    offended:
    LightStyx:
    It's all BFM - Black F***king Magic!

    Can I get an apology from the commenter? In this day and time, you don't sit around a message board, where you have diversity, and refer to black f-ing magic.

    http://www.youtube.com/watch?v=20a-exAW6qc

    3 months late with this.

    NO! You will not get an apology because that whole situation is just stupid, silly, and just plain idiotic. [...]

    Successful troll is successful

Leave a comment on “Choose Your Own Include File”

Log In or post as a guest

Replying to comment #:

« Return to Article