• Jaybles (unregistered) in reply to Yaos
    Yaos:
    :10bux:

    This isn't the SomethingAwful forums...

  • the foo bard (unregistered)

    Wow.. . So many comments, I didn't see the last line and realize that he was redirecting. It looked like he just logged the error.

  • anonymous (unregistered) in reply to seriously
    seriously:
    Bob:
    See:

    http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23108345.html

    how did you know that existed? that's kind of nuts

    Google.

  • Lurker (unregistered) in reply to Yaos

    Do you have stairs in your house?

  • anonymous (unregistered) in reply to Gary

    the one on experts-exchange still references questions.aspx.cs. Is that a mixed VB-C# Application? Yuck.

  • Whiskey, Eh? (unregistered) in reply to Goo
    Goo:
    So, in essence, If someone has an Starfleet Engineering mentality, who thinks they can't live without a secondary backup, it'll get fixed.

    But those secondary backups are always offline anyway.

  • memama (unregistered) in reply to re:me
    re:me:
    I didn't take it as the application itself was a tutorial on programming, rather that it is something like a CBT app.
    That changes the picture completely. If it is indeed a Cock and Ball Torture application, previous data MUST be taken into account, or it would risk overstretching.
  • Ben (unregistered) in reply to memama
    memama:
    re:me:
    I didn't take it as the application itself was a tutorial on programming, rather that it is something like a CBT app.
    That changes the picture completely. If it is indeed a Cock and Ball Torture application, previous data MUST be taken into account, or it would risk overstretching.

    Not at all. The scrotal tissue used by the fine folks at expertsex-change is guaranteed to meet the most stringent elasticity requirements.

  • Mr Paper Kilt (unregistered) in reply to EmperorOfCanada
    EmperorOfCanada:
    An example would be one I saw who solved a series of rather hard spacing problems between FF and IE when they needed to solve the problem of IE people not being able to log in.

    Maybe that WAS his solution to the IE spacing problem.

  • (cs) in reply to what are you talking about
    what are you talking about:
    google it you fucking moron.
    I don't see how this helps.
  • Herby (unregistered)

    At least there is a comment! I've seen stuff that only has:

    // ...

    And this was in a definitive book on the language at hand. Kinda like "and exercise left to the student".

  • Anon (unregistered) in reply to what are you talking about
    what are you talking about:
    seriously:
    Bob:
    See:

    http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23108345.html

    how did you know that existed? that's kind of nuts

    google it you fucking moron.

    That seemed unnecessary. Feel like a big man do you?

  • (cs) in reply to Luis Espinal
    Luis Espinal:
    what are you talking about:
    seriously:
    Bob:
    See:

    http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23108345.html

    how did you know that existed? that's kind of nuts

    google it you fucking moron.

    Easy tiger.

    Man, that's funny.

  • Tim McCormack (unregistered) in reply to DCRoss

    It helps because this thread is fourth in the search results now. (Well, if you quote the phrase.) And that thread tells you to Google it!

  • PaulK (unregistered)

    When all is said and done... more is said than done.

  • highphilosopher (unregistered) in reply to Maurits
    Maurits:
    TRWTF is using Response.Redirect("default.aspx") rather than Response.Redirect("./"). default.aspx should never be linked to or redirected to explicitly, just implicitly. (Posting to default.aspx is another matter due to IIS's insane "no posting to a default document" rule.)

    Actually TRWTF is that he wrote a freaking short story in comments. Freakin english students coding! I always said that was a bad idea. Oh yeah, and the other WTF is that you managed to nitpick that out of this whole situation. It's like you walked up to a 50 car pileup on the freeway and said, "Well, it looks like this car has an old set of wiper blades." Really? Really. Really?

  • you're all wrong (unregistered)

    he's actually avoiding the "exceion"

  • PinkyAndTheBrainFan187 (unregistered) in reply to Luis Espinal
    Luis Espinal:
    what are you talking about:
    seriously:
    Bob:
    See:

    http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23108345.html

    how did you know that existed? that's kind of nuts

    google it you fucking moron.

    Easy tiger.

    No. Warranted.

  • Koo Kee (unregistered) in reply to tentux
    tentux:
    Something tells me that resetting the server will probably result in a lost session making the whole rant unnecessary in the first place.
    A "session" is an imaginary concept, an abstraction of one particular (in this case, broken) way of designing a web site. Yes, some implementations of "sessions" break when a server goes down. Since the web is 7x24, those implementations are guaranteed to produce unnecessary frustration for your site visitors, and are, therefore, Defective By Design.

    On the other hand, if you let the browser remember the answers (using hidden fields, URL parameters, cookies...) they won't be lost unless the browser goes down, which, generally, isn't considered within the scope of the server programmer's responsibility.

    And if it really matters there's no law saying you can't store the info redundantly at both ends.

    So just shrugging your shoulders and saying "bah I lost the session, too bad" is a loser's excuse.

  • Aussie Contractor (unregistered)

    /*

    • Due to time constraints, I will not be writing a comment today */
  • anon (unregistered) in reply to what are you talking about
    what are you talking about:
    seriously:
    Bob:
    See:

    http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23108345.html

    how did you know that existed? that's kind of nuts

    google it you fucking moron.

    When I Googled "it you fucking moron" I just ended up back here. Are you sure that's what you searched on?

  • Axl (unregistered) in reply to Ken B.
    Ken B.:
    I think what he really meant to say is:
    /*
     * I get paid using the LOC method of productivity,
     * so I need to come up with more "L"s.
     */
    /*
     * I get paid using the LOL method of productivity,
     * so I need to come up with more "cats".
     */
  • tentux (unregistered) in reply to Koo Kee

    Well a web session is the reality we live with and we design around the fact we have a fundamentally stateless application architecture to deal with.

    Storing masses of information on each page is a solution, but if you're anything like me you would shudder when you first saw a massive 'viewstate' in ASP.NET web pages. ASP.NET MVC at least has moved away from that state of affairs. And yes, I'm well aware you can store state server-side on seperate servers, hell cluster them if needs be. But you'd still be able to write a comment along the lines of catch(AsteriodHitAllMyDataCentersSimultaneouslyException){...}. There's a point at which we should stop making things resilient as the investment in high-availability could out-weigh benefit. Sometimes even programmers have to consider whether the time and their employers money is worth spending on a feature.

    And I consider the fact the browser crashing and requiring a bunch of HTML/URL/Cookies in order to maintain a session in the first place a system that is Defective By Design. That's the web, it's been defective from its inception to the present day.

  • (cs) in reply to Steve A
    Steve A:
    Try Catch is for sissies!

    There is no Try Catch, only Do Catch.

  • (cs) in reply to CodeNinja
    CodeNinja:
    At least it's well commented.

    At least it's, well... commented.

    FTFY

  • (cs)

    I've been in positions where I've done comments something like this. Never quite as elegantly, but it was always in response to someone who complained because my code "wasn't sufficiently well-commented".

    Sometimes it took the form of pasting the entire design document into the program to satisfy someone's need for looking things up in the code base.

  • da Nurse (unregistered) in reply to da Doctah
    da Doctah:
    I've been in positions where I've done comments something like this. Never quite as elegantly, but it was always in response to someone who complained because my code "wasn't sufficiently well-commented".

    Sometimes it took the form of pasting the entire design document into the program to satisfy someone's need for looking things up in the code base.

    You, Sir, are a buffoon!!

  • EmperorOfCanada (unregistered)

    I just Googled "Fucking Moron" but only found a picture of an angry commenter.

  • oheso (unregistered) in reply to tentux
    tentux:
    Well a web session is the reality we live with and we design around the fact we have a fundamentally stateless application architecture to deal with.

    Storing masses of information on each page is a solution, but if you're anything like me you would shudder when you first saw a massive 'viewstate' in ASP.NET web pages. ASP.NET MVC at least has moved away from that state of affairs. And yes, I'm well aware you can store state server-side on seperate servers, hell cluster them if needs be. But you'd still be able to write a comment along the lines of catch(AsteriodHitAllMyDataCentersSimultaneouslyException){...}. There's a point at which we should stop making things resilient as the investment in high-availability could out-weigh benefit. Sometimes even programmers have to consider whether the time and their employers money is worth spending on a feature.

    And I consider the fact the browser crashing and requiring a bunch of HTML/URL/Cookies in order to maintain a session in the first place a system that is Defective By Design. That's the web, it's been defective from its inception to the present day.

    QFT.

    If it's not a mission-critical application, then spending time trying to preserve state over a server reset would be a RWTF. He's logged it, he's redirected to the home. I suppose he could try for an error message for the user, but there's not really a good stateless way to ensure that happens, now, is there?

    Apart from a bit of rambling and self-justification, what, really, is the WTF here?

  • Mumba-Jumba (unregistered)

    We need to catch exception of exception! Maybe even exception of exception of exception... God I hate exceptions...

  • CMMI Snob (unregistered)

    The real WTF is that he used experts-exchange - is he doing college assignment?

    captcha: genitus - pus ridden erection

  • Simon (unregistered)

    Hmm... I wonder whether the programmer is named Wally... http://www.dilbert.com/strips/comic/2009-12-03/

  • TC (unregistered)
    • Takes a dump on your Exception *
  • Anon (unregistered) in reply to CMMI Snob
    CMMI Snob:
    The real WTF is that he used experts-exchange - is he doing college assignment?

    TRWTF is certainly experts-exchange and the way they try to get you to sign up to see the answers that are right there at the bottom of the page anyway. And that it's been like that for years. At least they had the sense to change their domain to put that hyphen in there.

  • PITA (unregistered) in reply to seriously
    seriously:
    Bob:
    See:

    http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_23108345.html

    how did you know that existed? that's kind of nuts

    Seriously?

  • Richard (unregistered)

    I like the fact that he can't even spell "exception" right!

    // "Nine tenths of programming is handling the exceion,
  • bricon (unregistered)
    1. Response.Redirect("profit.aspx");

    // Typically I like to minimize the amount of // redirects in my code. However honestly, I'm // feeling that there are a couple of potential // problems that could arise in my implementation // of the code and I want there to be some // thought about what should happen here if the // application happened to shit 'corns. // To make a long story short, I'm going to take // the easy way out and just redirect myself to // the profit.aspx page if there is any trouble. // Yes, makes me feel a little dirty, but due to // budget constraints I must move on...

    1. PROFIT!
  • (cs)

    Tutorial programs not dealing with edge cases counts as a WTF now? I think that makes every tutorial program ever written a pile of WTFs.

  • Brian White (unregistered) in reply to oheso
    oheso:
    tentux:
    Well a web session is the reality we live with and we design around the fact we have a fundamentally stateless application architecture to deal with.

    Storing masses of information on each page is a solution, but if you're anything like me you would shudder when you first saw a massive 'viewstate' in ASP.NET web pages. ASP.NET MVC at least has moved away from that state of affairs. And yes, I'm well aware you can store state server-side on seperate servers, hell cluster them if needs be. But you'd still be able to write a comment along the lines of catch(AsteriodHitAllMyDataCentersSimultaneouslyException){...}. There's a point at which we should stop making things resilient as the investment in high-availability could out-weigh benefit.

    QFT.

    If it's not a mission-critical application, then spending time trying to preserve state over a server reset would be a RWTF. He's logged it, he's redirected to the home. I suppose he could try for an error message for the user, but there's not really a good stateless way to ensure that happens, now, is there?

    Apart from a bit of rambling and self-justification, what, really, is the WTF here?

    Am I the only programmer who works at a company using a database backed session? Data shouldn't be stored in your web servers, and a web server crash should be as close to invisible as possible.

  • David (unregistered)

    Im trying to think of a case where the server resets and loses your session and saving the session data elsewhere would enable the transaction to continue, and failing.

    Surely if the server bombs out, then all bets are off?

  • (cs) in reply to Brian follower of Deornoth
    Brian follower of Deornoth:
    One of my former colleagues took this technique to the logical conclusion: he wrote only comments, and no code at all. It transpired this was because he didn't know anything about the language he was ostensibly coding in. The ghastly truth was revealed on the day of the code review; he didn't turn up, and was never seen again.

    They were beautiful comments, though.

    If that's true, you should submit it for the front page.
  • Neil (unregistered) in reply to Maurits
    Maurits:
    TRWTF is using Response.Redirect("default.aspx") rather than Response.Redirect("./"). default.aspx should never be linked to or redirected to explicitly, just implicitly. (Posting to default.aspx is another matter due to IIS's insane "no posting to a default document" rule.)
    If you go back far enough (IIS4 I think) they didn't even allow query strings on default documents so I had to turn off default documents and do all the work in the directory listing denied error page instead.
  • NorgTheFat (unregistered)

    Aaah, nothing worse than comments in code that don't mean anything, and/or try to make excuses for bad coding practices.

  • Mike (unregistered) in reply to Whiskey, Eh?
    Whiskey:
    Simple explanation: he is being paid per line of code written. Somehow, in his company, that includes comments.

    Almost-as-simple explanation: he is being paid per line of code written. Somehow, he was under the impression, that includes comments.

  • Skilldrick (unregistered)

    Is it just me or does that writing sound like it came out of one of the books in the library in Myst?

    I realized the moment I fell into the fissure that the book would not be destroyed as I had planned. It continued falling into that starry expanse, of which I had only a fleeting glimpse. I have tried to speculate where it might have landed, but I must admit that such conjecture is futile. Still, questions about whose hands might one day hold my Myst book are unsettling to me. I know my apprehensions might never be allayed, and so I close, realizing that perhaps the ending has not yet been written.
  • P. Fermat (unregistered)

    // I have discovered a bugfix, but this comment is too small to contain it.

  • Richard Gomes (unregistered)

    Better a prolific exception handling like this than the "pragmatic" approach of a "pragmatic" colleague I had at Bank of America Merrill Lynch:

    try {
       something();
    } catch (Exception e) { };
    

    Wonderful!

  • Reow (unregistered)

    There is no WTF here, and Tim should be condemned for rebuking a developer who left a decent comment. I do my best to write self-documenting code (I follow SOLID and a number of other design practices, I name my methods and variables meaningfully, etc, etc), consequently, I don't write many comments. When I do write comments, they tend to be verbose and they explain a design decision (like the one in question here). I go one step further though - I provide my name and phone number with the comment. It's been said that developers should leave their forwarding address, and I agree with this - if you're ashamed of your code or unwilling to justify/support it, get out of the business.

Leave a comment on “Avoiding the Exception”

Log In or post as a guest

Replying to comment #:

« Return to Article