• LoR (unregistered) in reply to woohoo
    woohoo:
    Looking at issues like that, one gets the impression that the above statement should not read

    "Why do it wrong when the right way is just as easy?"

    but rather

    "Why do it right when the wrong way is just as easy?"

    (Which is in fact near to a sarcastic german saying: "Warum einfach, wenn es umständlich auch geht?" = "Why keep it simple when you can do it long-windedly?")

    ;o)

    That's the original quote, yes, but I think the article's reversal was intentional.

  • dkf (unregistered) in reply to Paul
    Paul:
    Do I win anything?
    A round of therapy, perhaps.
  • (cs)

    "Re: Seven Twisty Little Code Files, All Alike"... Do I detect a subtle reference to Dunnet? Props!

  • Grassfire (unregistered) in reply to sf
    sf:
    FredSaw:
    andrewbadera:
    Tim B:
    Here's one in our app:

    Gender

    Unknown Male Female Unisex Combined Other

    So? Thanks to the myriad of ongoing legislation in this area, the company has to deal with pretty much every reasonable permutation and possibility. Perhaps "Combined" isn't a great word, but is "Hermaphrodite" any better?

    My day job is with an insurance company. This kind of thing is standard.

    If hermaphrodite is covered by "combined" and there is also an "unknown" option, then what is indicated by "other"?
    For that matter, if someone is "unisex" what choices are there other than either male or female? Unless that's equivalent to "unknown" but we're sure they're not a hermaprodite.

    I must know what kind of application this is. Please tell us.

    I used to work on a system that was used by a variety of charities, etc who delt with the homeless / people of special needs.

    It had a gender list similar to that one, with a few extras, including "Eunich", "M2F Trans", "F2M Trans", etc.

  • (cs)

    My personal favorite ASP Classic WTF technique is when the developer uses partial markup in an include file. In other words, they start a table tag for example and expect that the code in which the file was included will complete table tag. That makes that "linear fashion" craptastic to follow.

    If you want to really enhance your fun, you have other developers use include files from other sites via virtual directories. That makes maintaining and refactoring the code a super peachy experience. For bonus pain, add references to "Foo.asp, Foov1.asp, Foov2.asp, Foo.aspv3..."

    Mmm...ASP Classic. Feeding the world through spaghetti for over 10 years.

  • Anonymous Coward (unregistered) in reply to Thomas

    You can debug ASP - why isn't OP doing that? Then he can work out exactly what is going on.

    If he needs to work out which include file(s) is/are being loaded, there's a great tool called Filemon (or Process Monitor now) that can tell him that.

    And you don't have to append a querystring to flush the server-side ASP template cache. IIS subscribes to Windows file change notifications, so there should be no issue these days (unless your content is perhaps stored on some 3rd party, non-Windows NAS that doesn't implement file change notifications properly. The client-side cache may need to be emptied, but most clients properly respect Expires headers these days.

  • DC (unregistered) in reply to Anonymous Coward
    Anonymous Coward:
    You can debug ASP - why isn't OP doing that? Then he can work out exactly what is going on.

    If he needs to work out which include file(s) is/are being loaded, there's a great tool called Filemon (or Process Monitor now) that can tell him that.

    And you don't have to append a querystring to flush the server-side ASP template cache. IIS subscribes to Windows file change notifications, so there should be no issue these days (unless your content is perhaps stored on some 3rd party, non-Windows NAS that doesn't implement file change notifications properly. The client-side cache may need to be emptied, but most clients properly respect Expires headers these days.

    Agree, breakpoints rule and there are so many ways of finding out what happens.

    And another point: "Over the years I've re-written a number of the smaller applications he wrote. Usually because the users wanted new functionality, and I didn't want to (or couldn't) delve into the classic ASP code that they were made of." This is a huge WTF: so because one doesn't want to understand the code, one goes and just rewrites it. And handles another batch of bugs that were dealt with some time ago. "Smart".

  • Ego (unregistered) in reply to dpm
    dpm:
    the drop-down year went from 1920 to 2005
    That's fairly stupid right there, having 86 items in a drop-down menu, but I'm sure we've all seen much worse. My question is, who has seen an *incredibly* stupid drop-down? What did it load?

    My favorite drop down contained the data of all radio broadcasts of the day using ";" to seperate the fields. It had style="display:hidden" A 200 line java script found the 3 next broadcasts from the the hidden drop down and copied the data for those three into a table.

    On the same page there was also an identical drop down for tv broadcasts. It would have been silly to use the same java script functions for both drop downs so another 200 lines handled it.

  • Jeff (unregistered)

    Is that like "classic" GW-BASIC? I got hired a couple years ago to rewrite a moderate (125 KLOC) ASP project in PHP... not because PHP is necessarily "better" than ASP.NET (which this, again, wasn't). Rather, the manager gave two reasons: "First, we've had three guys in trying to kill a bug and nobody's been able to kisolate it. Second, every other department in this company is gearing up for ISO 9000 and I don't want to be laughed at by everybody who knows what a flaming piece of crap we've built critical business processes around that we can't possibly document maintenance procedures for."

    The manager and I were the only ones in the room who weren't twentysomething and/or FOB. Nice to see adult supervision returning to the IT marketplace....

    (CAPTCHA: "Appellatio". Is that an interesting mix of appellation and fellatio?)

  • streklin (unregistered) in reply to DC
    This is a huge WTF: so because one doesn't want to understand the code, one goes and just rewrites it. And handles another batch of bugs that were dealt with some time ago. "Smart".

    It may not be a WTF that he re-wrote them. It depends on how badly they were written/maintained. I know I've had to rewrite at least one old style asp app where I work because the "genious" that proceeded me introduced so many errors into it that the amount of time it would have taken me to (a)Carefully Read through the code and hunt out what it used to do compared to what it now does (my predecessor had managed to disable half the functions :P) (b)Fix all the errors, and then (c) add in the required functionality, would have been far longer than re-making the thing would have been.

    My point is that sometimes, a rewrite is required - but only sometimes of course.

  • Manuel (unregistered)

    On Error Resume Next

  • Jacko (unregistered) in reply to FredSaw
    FredSaw:
    andrewbadera:
    Tim B:
    Here's one in our app:

    Gender

    Unknown Male Female Unisex Combined Other

    So? Thanks to the myriad of ongoing legislation in this area, the company has to deal with pretty much every reasonable permutation and possibility. Perhaps "Combined" isn't a great word, but is "Hermaphrodite" any better?

    My day job is with an insurance company. This kind of thing is standard.

    If hermaphrodite is covered by "combined" and there is also an "unknown" option, then what is indicated by "other"?

    Michael Jackson

  • tinkerghost (unregistered) in reply to dpm
    dpm:
    the drop-down year went from 1920 to 2005
    That's fairly stupid right there, having 86 items in a drop-down menu, but I'm sure we've all seen much worse. My question is, who has seen an *incredibly* stupid drop-down? What did it load?
    Years for a birthday - 1940-2010 --- as [option value=1940]1940[/option] [option value=1941]1941[/option]

    Worst dropdown ever: pair of company/location dropdowns. Company was fine, selecting autopopulated the location dropdown via ajax ... worked fine until someone loaded WesternUnion into the system --- 9K+ locations in an ajax populated dropdown .... things go boom

  • (cs) in reply to streklin
    streklin:
    This is a huge WTF: so because one doesn't want to understand the code, one goes and just rewrites it. And handles another batch of bugs that were dealt with some time ago. "Smart".

    It may not be a WTF that he re-wrote them. It depends on how badly they were written/maintained. snip

    My point is that sometimes, a rewrite is required - but only sometimes of course.

    And sometimes you have to rewrite it because the original app didn't actually, y'know, work at all. There's no point in reusing code that doesn't do anything.

  • Craig F (unregistered) in reply to tk.
    tk.:
    streklin:
    This is a huge WTF: so because one doesn't want to understand the code, one goes and just rewrites it. And handles another batch of bugs that were dealt with some time ago. "Smart".

    It may not be a WTF that he re-wrote them. It depends on how badly they were written/maintained. snip

    My point is that sometimes, a rewrite is required - but only sometimes of course.

    And sometimes you have to rewrite it because the original app didn't actually, y'know, work at all. There's no point in reusing code that doesn't do anything.

    There is a time and place for everything. And "colourful" stories don't always stop to include all the details.

    The rewrite of the other system happened because the original system was a 2 page classic ASP program (but which actually had MANY files/database rows of code to generate content), and the new system had requirements that expanded it well beyond this. Rather than bolting on new functionality to a crappy framework, it was decided that I should start from scratch.

    As for debugging, I will agree that my own personal WTF is that I don't understand Classic ASP or how to do anything other than Response.Write "Hey, I'm inside the if statement".

  • My Name My Name My Name My Name My Name My Name My Name (unregistered) in reply to yimms
    yimms:
    Of course there's more than one copy of the file, you've gotta have source control or u could lose all your work...
    Of course there's more than one copy of the file. The concept is called "backup."

    Of course, you need to make sure that all copies of the file are on the same hard-disk partition.

  • greg (unregistered) in reply to andrewbadera
    andrewbadera:
    Tim B:
    Here's one in our app:

    Gender

    Unknown Male Female Unisex Combined Other

    So? Thanks to the myriad of ongoing legislation in this area, the company has to deal with pretty much every reasonable permutation and possibility. Perhaps "Combined" isn't a great word, but is "Hermaphrodite" any better?

    My day job is with an insurance company. This kind of thing is standard.

    <pedantry>The list as given works for GHz-level RF connectors. For insurance, "unisex" would be deleted and "combined" would be replaced by "artificial person" (i.e., corporation). </pedantry>

  • <Maybe Anon?> (unregistered) in reply to dpm
    dpm:
    the drop-down year went from 1920 to 2005
    That's fairly stupid right there, having 86 items in a drop-down menu, but I'm sure we've all seen much worse. My question is, who has seen an *incredibly* stupid drop-down? What did it load?

    www.monster.co.uk has a drop down list in their search that contains a tree of the list of categories. Once you expand the tree, you can tick selection boxes inside the tree, all in the selection box.

  • Anonymous (unregistered) in reply to Paul
    Paul:
    An inhouse CMS that read a 30,000 row table from the db and displayed all the unique integers IDs twice, in two separate drop-downs ... the page took several minutes to display and was updated on any change to any of the fields on the page, including selecting any of the items in the drop down ... not only that, the db was queried and the 30,000 rows retrieved anew on every refresh.

    Do I win anything?

    Do I get bonus points for writing it myself?

    "Only" about 3,000 rows in each dropdown menu, which was pulled from db. What makes this better (and by better I mean much much worse) is that it is duplicated 20 times on the page.

    I was led to believe the 3,000 would be more like 50-100, maybe 200-300 after many years of operation, which made it an ugly but acceptable solution since it was incredibly user friendly and quick to implement (on an over-budget project). When I got the call the during first month of use that it was taking 3-4 minutes to load the page and saw that it had already hit 1000, and didn't have the budget to rewrite, I changed what had previously been 50 per page to 20 per page and left it at that...

    Moral: Do not pick an ugly solution, ever. If it means you'll be spending more time and making the project cost more, just do it right and find somebody to push blame onto.

  • TopicSlayer (unregistered) in reply to Tim B
    Tim B:
    Here's one in our app:

    Gender

    Unknown Male Female Unisex Combined Other

    Biological specimen inventory application? Although, I would think that scientists would desire more specific terms than "combined" and "other".

  • Dave (unregistered)

    Nothing like designing your code base for some future contingency you can't quite think of at the present.

    Do you think he got a higher function point count and his manager was happy ?

  • Musa (unregistered) in reply to Dave

    [quote user="Dave"][quote user="Bobbo"][quote user="Craig F."]I didn't want to (or couldn't) delve into the classic ASP code[/quote]

    He got out of having to deal with old, dead, useless code and concentrate on .net. It might be annoying for whoever's left holding the baby, but that's their problem. Classic ASP is a crock, whereas .net has the advantage of being a nice environment with many well paid positions using it.[/quote]

    Well, that depends on how the .Net code is written. I've been involved in maintenance of .Net projects at my old company and my new company. At the former company several developers quit because of that code (same business logic everywhere and making one change did affect the other). Here, at new company, insert/update/delete statements are found on all report pages and hard-coded to a 3rd party's machine; datasets/adapters, etc not named correctly and db design is a mess.

    So I'm saying not all .Net is good code

  • ELIZA (unregistered) in reply to TopicSlayer
    TopicSlayer:
    Tim B:
    Here's one in our app:

    Gender

    Unknown Male Female Unisex Combined Other

    Biological specimen inventory application? Although, I would think that scientists would desire more specific terms than "combined" and "other".

    At a guess, it could be restroom facilities: Unknown: Facilities planned, presently unknown gender Male: Male toilets Female: Female toilets Unisex: Unisex toilets Combined: Male and Female toilets sharing same entrance \ eg \ Male \ | \ L_Female \ | \ toilet entrance \ NOTE: I have seen this done many times Other: Segragated on a basis other than gender, exempli gratia disabled toilets or babies changing rooms.

  • Blade (unregistered)

    LOL, I like the subject's reference to the classic adventure game Colossal Cave. :D I'm surprised nobody else saw it yet!

Leave a comment on “Seven Twisty Little Code Files, All Alike”

Log In or post as a guest

Replying to comment #:

« Return to Article