• Nagesh (unregistered) in reply to Sexy Hexi
    Sexy Hexi:
    And the length of a meter being based on how long a pendulum has to be to swing in one second -- which in turn is not a decimal measure?
    Such a definition of a standard unit of length was proposed several times through the 1600s and 1700s, but it has never been the definition of the meter.

    The original definition of the meter was: One ten-millionth of the meridian of Paris from the North Pole to the Equator, measured at the mean sea level. Later the definition was changed to reference a physical prototype object, and later yet the meter was defined interferometrically and then most recently by fixing the numerical value of the speed of light in vacuum.

    But seconds pendulums were never used. (Local variation in the acceleration of gravity would have made that completely unworkable as a definition even in the 1790s).

  • ColinX (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    The problem here is, as hinted at above, that the if/else if/else chain is badly broken, with every other else if having been replaced by a simple if. This leads the code to grossly misbehave, and I'd imagine that it returns Now() most of the time.

    (simple: it normally fails to remove the incorrect time zone symbol from the string, and therefore the Parse() call will throw an exception, dumping us in the catch, which doesn't do anything.)

    That said, I think that throwing is a good plan in this case, rather than returning an arbitrary value. And if you are going to return an arbitrary value, 25 o'clock on 7 September 1752 is far better than Now().

    For those who don't get it, here is a calendar page for September 1752:

       September 1752     
    Su Mo Tu We Th Fr Sa  
           1  2 14 15 16  
    17 18 19 20 21 22 23  
    24 25 26 27 28 29 30  
    Only for the Pommy Bastards
  • Decimaltrite (unregistered) in reply to Sexy Hexi
    Sexy Hexi:
    Steve The Cynic:
    Neil:
    Steve The Cynic:
    And if you are going to return an arbitrary value, 25 o'clock on 7 September 1752 is far better than Now().
    You might find it hard to return an invalid date. Or you might find that the software gets used in a country where the date is in fact valid.
    Are there lots of countries where 25 o'clock is a valid time?
    I live in Hexidecimalia where we have rationalized all measurement systems. 256 seconds in an hour, 256 hours in a day. No need for minutes, an enhancement which by itself saves over 17 trillion innocent bits per year.

    Of course those backward countries that still use the metric system need to get with the times. Decimal? Excuse me? Something allegedly logical yet based on a number that can't be cut in quarters? And the length of a meter being based on how long a pendulum has to be to swing in one second -- which in turn is not a decimal measure?

    No, the "SI" metric system is a hopeless unfounded mess. Why any civilized nation still uses it is beyond me.

    yes, not dividing by 5 is a far better idea....

    I've never understood why we just don't do everything in base 2520. Then at least we can divide by all single numbers 1-10 inclusive

  • (cs) in reply to noland
    noland:
    Found the true WTF: There's an indentation error at "label 162"! ;-)
    There is no label 162. There is a label62. There is also a label32 with the same indentation error.
  • Mikhail (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    snoofle:
    Neil:
    Steve The Cynic:
    And if you are going to return an arbitrary value, 25 o'clock on 7 September 1752 is far better than Now().
    You might find it hard to return an invalid date. Or you might find that the software gets used in a country where the date is in fact valid.
    In Java, creating a GregorianCalendar with 1752, Sep 7, 25:00 yields: 1752 09 08 01:00:00.000

    Something isn't consistent.

    You must be using CatholicJava rather than AnglicanJava. The 1752 thing is for the UK and the North American colonies (i.e. the territory now included in Canada and the 13 US founding states).

    Or you might be using SwedishJava, which you can test for by looking at the month of February 1712. If you are using SwedishJava, this month will have 30 days.

    Of course, in no version of Java should the GregorianCalendar object be able to parse a date before 1582.

    is wrong. Gregorian Calendar not compatible with Julian Calendar. Of course 25 hour from start of 7th Sept on Gregorian Calendar is 1 hour into 8 Sept.

    Try instead:

    JulianCalendar TestDate = new JulianCalendar(/*DD/MM/YYYY HH:MM:SS*/"07/09/1752 25:00:00");
    GregorianCalendar newDate = GregorianCalendar.convertFromJulian(TestDate);
    TestDate.set(Calendar.DAY, TestDate.get(Calendar.DAY)+1);
    

    Point is, not Gregorian or Julian Calendar changed, so date in both is continues, Gregory only from 24 February 1582. Julius still continue (in theoretical), but not sure whether still used anywhere after WW1

  • Vistor (unregistered) in reply to turist
    turist:
    Joints:
    dkf:
    But TRWTF is when programmers create a vast mess of super-nested conditionals and boolean variables just to avoid a single goto. Yeah, goto can be harmful, but so can the things that people do to avoid it…

    GOTO does not need to be used in modern day languages. Unles s you want to open up a can of worms in your code.

    Not plain wrong, but definitely not true. It depends a little on your idea of a "modern day language" -- most sensible usage of goto i have seen so far was C. But even in C#, I once had a case where goto made the code much simpler and a lot more legible.

    Rule of thumb "avoid goto" is ok, but "ban goto, no matter what" is stupid.

    More broadly...

    The spirit of the law is more importnat than the letter. There seem to be too many "text book junkies" in IT. These are the people that insist something is wrong (or right) because it follows some arbitrary rule. This isn't limited to development, but the whole Software Engineering process (and in fact any processes within IT).
    For example, where I work we have some fairly high-overhead processes to deploy changes, and while I understand the necessity in controlling releases, there needs to be some flexibility in the process to allow reduced overhead for low-impact low-complexity changes compared to major releases. Then again, I could bag ITIL a lot, but I'm guessing that would start a messy punch up (possibly because the places I've worked ITIL has been badly implemented rather than being a bad methodology necessarily).

  • Nagesh (unregistered) in reply to Nagesh
    Nagesh:
    Sexy Hexi:
    And the length of a meter being based on how long a pendulum has to be to swing in one second -- which in turn is not a decimal measure?
    Such a definition of a standard unit of length was proposed several times through the 1600s and 1700s, but it has never been the definition of the meter.

    The original definition of the meter was: One ten-millionth of the meridian of Paris from the North Pole to the Equator, measured at the mean sea level. Later the definition was changed to reference a physical prototype object, and later yet the meter was defined interferometrically and then most recently by fixing the numerical value of the speed of light in vacuum.

    But seconds pendulums were never used. (Local variation in the acceleration of gravity would have made that completely unworkable as a definition even in the 1790s).

    Does Nagesh sometimes forget to change his alias before posting, or does everyone think it's funny to post as Nagesh

  • Oops (unregistered) in reply to Nagesh
    Nagesh:
    Nagesh:
    Sexy Hexi:
    And the length of a meter being based on how long a pendulum has to be to swing in one second -- which in turn is not a decimal measure?
    Such a definition of a standard unit of length was proposed several times through the 1600s and 1700s, but it has never been the definition of the meter.

    The original definition of the meter was: One ten-millionth of the meridian of Paris from the North Pole to the Equator, measured at the mean sea level. Later the definition was changed to reference a physical prototype object, and later yet the meter was defined interferometrically and then most recently by fixing the numerical value of the speed of light in vacuum.

    But seconds pendulums were never used. (Local variation in the acceleration of gravity would have made that completely unworkable as a definition even in the 1790s).

    Does Nagesh sometimes forget to change his alias before posting, or does everyone think it's funny to post as Nagesh
    Oh shit

  • foo (unregistered) in reply to linepro
    linepro:
    Joints:
    GOTO does not need to be used in modern day languages. Unles s you want to open up a can of worms in your code.

    setjmp longjmp

    Try and handle driver exceptions without them...

    Don't you know the difference between going and jumping?

  • (cs) in reply to foo
    foo:
    linepro:
    Joints:
    GOTO does not need to be used in modern day languages. Unles s you want to open up a can of worms in your code.

    setjmp longjmp

    Try and handle driver exceptions without them...

    Don't you know the difference between going and jumping?
    There was never a seminal paper in the field of software engineering with the title Jumping Considered Harmful?

    Some day I want to hear about a programmer hauling out that famous title when his local Pointy-Haired Boss assigns him to "go to the department planning meeting". "But PHB! Go To is Considered Harmful and has been since 1968! Are you trying to get in trouble with the Labor Relations Board for assigning me to hazardous duty without a concomitant salary increment?"

    Then you sit back and wait while PHB looks up "concomitant" on Urban Dictionary.

  • Meep (unregistered) in reply to Tom
    Tom:
    Not only this developer used Goto, which is enough to deserve a slow and painful death, but he wasn't even able to use it properly... why create 88 labels (with no real name of course) when only one would be enough?

    Anyway, VB.NET is a WTF by itself...

    Yet:

    If dt.endswith("GMT-12:00") Then
        dt = dt.replace("GMT-12:00", "-12:00")
        Goto done
    End If
    If dt.endswith("GMT-11:00") Then
        dt = dt.replace("GMT-11:00", "-11:00")
        Goto done
    End If
    ...
    
    :done
    

    Seems like goto is a lot better than the endlessly nested If Thens.

    And the only way to avoid it, if you really have to test one condition after another and can't use a loop or something, is to return.

    But returning in the middle of a function is almost as bad as a goto.

  • Meep (unregistered) in reply to Joints
    Joints:
    dkf:
    Simon Peyote Joints:
    [Goto] does have its place (but mostly only in C).
    It is a primitive used to build control structures. Like many primitives, it's horrible to use it directly. On the other hand, having it lets you built new control structures rather than being stuck with if and while (for, do/while and switch are in many ways syntactic sugar round those two) which, while a set that lets you express any algorithm with enough contortions, are only a fraction of what has been discovered. C doesn't have try/catch/finally (or RAII) so error handling and cleanup are necessarily rather messy. There are a few other fundamental control structures that C doesn't have and which need gotos to model well (e.g., coroutines).

    But TRWTF is when programmers create a vast mess of super-nested conditionals and boolean variables just to avoid a single goto. Yeah, goto can be harmful, but so can the things that people do to avoid it…

    GOTO does not need to be used in modern day languages. Unles s you want to open up a can of worms in your code.

    Multiple inheritance is a can of worms. Multithreading is a can of worms. Spaghetti code is just annoying to read.

  • (cs)

    Now I realize that hard-coded values are bad. And I realize that arrays are no longer taught in our schools.

    But doesn't this seem like something a handful of static arrays and a loop could be used to solve?

    Rather than creating this mother-of-all-WTF's?

    I mean, assuming that there isn't just a simple, better way to do this...

    ...like, maybe, send the XML date in UTC?

  • Norman Diamond (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    Neil:
    Steve The Cynic:
    And if you are going to return an arbitrary value, 25 o'clock on 7 September 1752 is far better than Now().
    You might find it hard to return an invalid date. Or you might find that the software gets used in a country where the date is in fact valid.
    Are there lots of countries where 25 o'clock is a valid time?
    You don't need lots because one is enough. For example if a gasoline stand is open 6:00 a.m. until 1:00 a.m. of the next day, a sign saying 06:00~25:00 puts the message across consisely and unambiguously.

    Or a restaurant might say 19:00~29:00, but if you want to return an invalid date that you picked up there you'll probably have a hard time no matter what time of night it is.

  • Miguel (unregistered)

    Why do on the computer something that is so trivial without one....

    "Please enter the current time in GMT" ?

    If the user fucks it up, it's their own fault

  • MZ (unregistered) in reply to Meep
    Meep:
    Tom:
    Not only this developer used Goto, which is enough to deserve a slow and painful death, but he wasn't even able to use it properly... why create 88 labels (with no real name of course) when only one would be enough?

    Anyway, VB.NET is a WTF by itself...

    Yet:

    If dt.endswith("GMT-12:00") Then
        dt = dt.replace("GMT-12:00", "-12:00")
        Goto done
    End If
    If dt.endswith("GMT-11:00") Then
        dt = dt.replace("GMT-11:00", "-11:00")
        Goto done
    End If
    ...
    
    :done
    

    Seems like goto is a lot better than the endlessly nested If Thens.

    And the only way to avoid it, if you really have to test one condition after another and can't use a loop or something, is to return.

    But returning in the middle of a function is almost as bad as a goto.

    You can make this half as long with no nesting by deleting every "Goto done" and all but the last "End If" and changing all but the first If into and Else If.

    If dt.endswith("GMT-12:00") Then
        dt = dt.replace("GMT-12:00", "-12:00")
    ElseIf dt.endswith("GMT-11:00") Then
        dt = dt.replace("GMT-11:00", "-11:00")
    ElseIf ...
    ...
    End If
    
  • Cheong (unregistered)

    With the words of "retaining the indenting", I can imagine there was a huge pool of nested ifs, and someone tried to tidy up by removing the time zones that's not needed.

    Not exactly a WTF if their source control don't have "ignore whitespace when compare" option.

  • FREioer (unregistered) in reply to MZ
    MZ:
    Meep:
    Tom:
    Not only this developer used Goto, which is enough to deserve a slow and painful death, but he wasn't even able to use it properly... why create 88 labels (with no real name of course) when only one would be enough?

    Anyway, VB.NET is a WTF by itself...

    Yet:

    If dt.endswith("GMT-12:00") Then
        dt = dt.replace("GMT-12:00", "-12:00")
        Goto done
    End If
    If dt.endswith("GMT-11:00") Then
        dt = dt.replace("GMT-11:00", "-11:00")
        Goto done
    End If
    ...
    
    :done
    

    Seems like goto is a lot better than the endlessly nested If Thens.

    And the only way to avoid it, if you really have to test one condition after another and can't use a loop or something, is to return.

    But returning in the middle of a function is almost as bad as a goto.

    You can make this half as long with no nesting by deleting every "Goto done" and all but the last "End If" and changing all but the first If into and Else If.

    If dt.endswith("GMT-12:00") Then
        dt = dt.replace("GMT-12:00", "-12:00")
    ElseIf dt.endswith("GMT-11:00") Then
        dt = dt.replace("GMT-11:00", "-11:00")
    ElseIf ...
    ...
    End If
    
    I'm not no VB.NET exper t(in fact I've never used it), but can't you do something like:
    dt.replace("GMT","")
    
  • (cs)

    Well, in Dido's lovely little song "White Flag" there is this verse:

    I know I left too much mess and destruction to come back again And I caused nothing but trouble I understand if you can't talk to me again And if you live by the rules of "it's over" then I'm sure that that makes sense
    Which is rather appropriate in this case.
  • Jasper (unregistered)

    I wonder what happens if you pass this an input that has "GMT+05:30" as its timezone.

  • Iain (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    Or you might be using SwedishJava, which you can test for by looking at the month of February 1712. If you are using SwedishJava, this month will have 30 days.

    I've always held the opinion that dealing with 18th century dates in Sweden was on par with a land war in Asia or going up against a Sicillian when death is on the line.

    First they embarked on a gradual conversion from Julian to Gregorian of skipping leap days for about 40 years; realized about 12 years into that that they'd already fucked up; converted back to Julian; eventually took the 11 day hit like all the other nations that converted in the 18th century.

  • delenit (unregistered) in reply to Rick
    Rick:
    There comes a point in every programmer's life where you find yourself wondering "Can this possibly be the best way to do this? Should it really be this difficult? Am I actually so special and unique that I'm the first person in the history of history to encounter this problem?"

    If you don't know how to wonder, you are not a programmer. Please step back from the keyboard. Now.

    I don't agree. An intelligent programmer would never write something stupid like this, not even in their early stages. This guy is a dumbass, and even after 30 years of developing, he'll still be a dumbass and write such dumbass code.

  • delenit (unregistered) in reply to Recursive Reclusive

    WTF is that comments are missing at the end of each line.

  • (cs) in reply to Meep
    Meep:
    Yet:
    If dt.endswith("GMT-12:00") Then
        dt = dt.replace("GMT-12:00", "-12:00")
        Goto done
    End If
    If dt.endswith("GMT-11:00") Then
        dt = dt.replace("GMT-11:00", "-11:00")
        Goto done
    End If
    ...
    

    :done

    Seems like goto is a lot better than the endlessly nested If Thens.

    And the only way to avoid it, if you really have to test one condition after another and can't use a loop or something, is to return.

    But returning in the middle of a function is almost as bad as a goto.

    Wrong. There is nothing wrong with calling return from the middle of a function.

    A "break" in the middle of a loop is a goto in disguise however. Yours is more like a break; in a switch which comes from the curious nature of switch dropping to the next case even when it has been handled (a programming WTF).

    This sort of thing can be seen in C code desperate to avoid using goto and nested ifs.

    do
    {
       if( !step1() )
       {
          report_error();
          break;
       }
    
       if( !step2() )
       {
         report_error();
         break;
       }
      // etc...
    } while( false ); 
    
    // closure code
    

    In C++ there is never a need to use goto, as you have proper closures in the form of destructors, as well as exceptions to break out early in the case of failures.

  • delenit (unregistered) in reply to turist
    turist:
    Joints:
    dkf:
    But TRWTF is when programmers create a vast mess of super-nested conditionals and boolean variables just to avoid a single goto. Yeah, goto can be harmful, but so can the things that people do to avoid it…

    GOTO does not need to be used in modern day languages. Unles s you want to open up a can of worms in your code.

    Not plain wrong, but definitely not true. It depends a little on your idea of a "modern day language" -- most sensible usage of goto i have seen so far was C. But even in C#, I once had a case where goto made the code much simpler and a lot more legible.

    Rule of thumb "avoid goto" is ok, but "ban goto, no matter what" is stupid.

    Using the phrase "rule of thumb" is also stupid. WTF that does that even mean? Are you sucking it and then rethinking the problem?

    Yes, it's stupid to use goto, and when I see it, I immediately drop my opinion on the intelligence of the author all the way to zero.

    So, now you know what I think of you.

  • delenit (unregistered) in reply to Meep
    Meep:
    But returning in the middle of a function is almost as bad as a goto.

    Another dumbass.

    Everyone who ever said this is a VB6 programmer, where you couldn't in fact exit a function without writing a "function = value" line at its very bottom.

    Yet, dumbasses who think skipping a block of code with return statements would then rather wrap everything in some if-else blocks, or even worse, let a bunch of code execute unnecessarily.

    There are better jobs for Kevin, Meep and you out there.

  • delenit (unregistered) in reply to Jasper
    Jasper:
    I wonder what happens if you pass this an input that has "GMT+05:30" as its timezone.

    Current time gets returned.

  • delenit (unregistered) in reply to Cbuttius
    Cbuttius:

    A "break" in the middle of a loop is a goto in disguise however.

    there is never a need to use goto, as you have proper closures in the form of destructors, as well as exceptions to break out early in the case of failures.

    Now, look at this dumbass. He's against using the keyword break, which is THE ONLY proper way to skip executing unnecessary code (which is why we break out of loops, you dumb fuck), and he wants to raise EXCEPTIONS instead!? We're wasting air on you.

  • turist (unregistered) in reply to delenit
    delenit:
    Using the phrase "rule of thumb" is also stupid. WTF that does that even mean? Are you sucking it and then rethinking the problem?

    Yes, it's stupid to use goto, and when I see it, I immediately drop my opinion on the intelligence of the author all the way to zero.

    So, now you know what I think of you.

    You're obviously an idiot. Better stop posting on a site where thinking for yourself is considered normal.

  • (cs) in reply to delenit
    delenit:
    Cbuttius:

    A "break" in the middle of a loop is a goto in disguise however.

    there is never a need to use goto, as you have proper closures in the form of destructors, as well as exceptions to break out early in the case of failures.

    Now, look at this dumbass. He's against using the keyword break, which is THE ONLY proper way to skip executing unnecessary code (which is why we break out of loops, you dumb fuck), and he wants to raise EXCEPTIONS instead!? We're wasting air on you.

    You're an idiot. You raise exceptions when an error occurs, and then the call-stack is automaticaly unwound for you, calling all the non-throwing destructors on the way, unlocking any mutexes and closing any file or database handles you opened (or if you acquired from a pool, restores it to the pool).

    Returning out of a loop when you have found what you were looking for is a valid action. Calling break to exit a genuine loop is valid, yes, but putting in a do...while(false) loop just so you can break out of it to get to the code outside the block is a goto in disguise.

    throwing when there is no error, just because you want to break out of a loop is a WTF.

    Incidentally, there are only 3 types of exception, and having exceptions run through the type system is WTF.

    An exception is either:

    1. transient: could process at this point, something timed out, try again.
    2. bad request: something is wrong with your request and we can't handle it, no matter how many times you resubmit it.
    3. FUBAR. (fatal error).
  • CodeMonKey (unregistered)

    Another WTF is to include a resource residing in a directory named after the 'developer' (https://thedailywtf.com/images/remy/scroll.mpe).

  • foo (unregistered) in reply to Miguel
    Miguel:
    Why do on the computer something that is so trivial without one....

    "Please enter the current time in seconds since 06/12 12pm EST 1714, assuming the Gregorian Calendar was introduced like in Sweden and further assuming 1900 was a leap year"?

    If the user fucks it up, it's their own fault

    Exactly. The software the only needs to store the number (in a single-precision float, of course).
  • Herp (unregistered)

    The best part is that it won't execute deeper than the first if statement because of the goto.

  • sagaciter (unregistered) in reply to turist
    turist:
    delenit:
    Using the phrase "rule of thumb" is also stupid. WTF that does that even mean? Are you sucking it and then rethinking the problem?

    Yes, it's stupid to use goto, and when I see it, I immediately drop my opinion on the intelligence of the author all the way to zero.

    So, now you know what I think of you.

    You're obviously an idiot. Better stop posting on a site where thinking for yourself is considered normal.

    I'm not the guy who wrote that for you, but, turist, go fuck yourself. You're also posting your own fucking opinion, and you called everyone not using goto stupid. Same goes for this Cbuttius duche.

  • (cs)

    It used to happen in the old days that when you used Microsoft Visual Studio C++ wizard to create a service for you, the code it generated was very WTF'y and included gotos.

    You're not meant to fix auto-generated code but I recall once going in and doing that anyway.

  • (cs) in reply to sagaciter
    sagaciter:
    I'm not the guy who wrote that for you, but, turist, go fuck yourself. You're also posting your own fucking opinion, and you called everyone not using goto stupid. Same goes for this Cbuttius duche.
    if( user=="sagaciter" )
    {
      goto trash;
    }
    

    while( false ) { trash: // insert nasty stuff here

    }

  • Mach (unregistered) in reply to delenit
    delenit:
    Cbuttius:

    A "break" in the middle of a loop is a goto in disguise however.

    there is never a need to use goto, as you have proper closures in the form of destructors, as well as exceptions to break out early in the case of failures.

    Now, look at this dumbass. He's against using the keyword break, which is THE ONLY proper way to skip executing unnecessary code (which is why we break out of loops, you dumb fuck), and he wants to raise EXCEPTIONS instead!? We're wasting air on you.

    What about continue?

    Captcha: I still think you're a nobis!

  • turist (unregistered) in reply to sagaciter
    sagaciter:
    I'm not the guy who wrote that for you, but, turist, go fuck yourself. You're also posting your own fucking opinion, and you called everyone not using goto stupid. Same goes for this Cbuttius duche.

    Oh, another idiot. This time even more moronic (not capable of very basic reading and undestanding)

    Yep, sure, i'll go "fuck" myself. That is, of course, unless someone donates you a brain.

  • David (unregistered) in reply to sagaciter
    sagaciter:
    turist, go fuck yourself. You're also posting your own fucking opinion, and you called everyone not using goto stupid.

    No he didnt! He said:

    turist:
    Rule of thumb "avoid goto" is ok, but "ban goto, no matter what" is stupid.

    which is perfectly...

    Oho, wait a minute!

    Is it that time of year again already?

  • turist (unregistered) in reply to David
    David:
    Is it *that* time of year again already?
    According to my calendar, september is over ... well, maybe not. captcha: dolor ... fits.
  • JJ (unregistered) in reply to delenit
    delenit:
    Meep:
    But returning in the middle of a function is almost as bad as a goto.

    Another dumbass.

    Everyone who ever said this is a VB6 programmer, where you couldn't in fact exit a function without writing a "function = value" line at its very bottom.

    Yet, dumbasses who think skipping a block of code with return statements would then rather wrap everything in some if-else blocks, or even worse, let a bunch of code execute unnecessarily.

    There are better jobs for Kevin, Meep and you out there.

    Sigh You are obviously a troll, and you've gotten several bites (congrats!), but for posterity I will mention that VB6 has Exit Sub and Exit Function, so in case anyone actually thought you had a clue as to what you were talking about, they shouldn't anymore.

  • TimmyB (unregistered) in reply to delenit

    Example from http://cboard.cprogramming.com/c-programming/149162-goto-bad-idea-ever.html (thanks Boozer)

    // with goto while (whatever) { while (something) { if (such_and_such) goto break_outer_while; actual_work(); } } break_outer_while:

    // with idiotic flag while (whatever && !idiotic_flag) { while (something && !idiotic_flag) { if (such_and_such) idiotic_flag = 1; else { actual_work(); } } }

    I myself have only used goto one time, but it did make the code easier to read. If you think never using goto is more important than readable code, then right back at you with the "you know what I think of you" snark.

  • Schol-R-LEA (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    Or you might be using SwedishJava, which you can test for by looking at the month of February 1712. If you are using SwedishJava, this month will have 30 days.
    Which, given that this was February in Sweden, was about 30 days longer than anyone wanted it to be. Do You Believe That? (TM)
  • default_ex (unregistered) in reply to Vakieh

    Sheesh, with how often I see these ridiculous if-else chains, I think I'm going to have to make sure every programmer I work with in the future understands what a look-up table is and how to put one together.

  • David Conrad (unregistered) in reply to Steve The Cynic
    Steve The Cynic:
    snoofle:
    In Java, creating a GregorianCalendar with 1752, Sep 7, 25:00 yields: 1752 09 08 01:00:00.000

    Something isn't consistent.

    You must be using CatholicJava rather than AnglicanJava. The 1752 thing is for the UK and the North American colonies (i.e. the territory now included in Canada and the 13 US founding states).

    Or you might be using SwedishJava, which you can test for by looking at the month of February 1712. If you are using SwedishJava, this month will have 30 days.

    Of course, in no version of Java should the GregorianCalendar object be able to parse a date before 1582.

    It's actually the proleptic Gregorian calendar, which takes the current rules and projects them backwards indefinitely in time. You can represent September 7, 1752, or September 7, 752, or September 7, 752 BC, or September 7, 1752 BC (which would have been a Thursday).

  • Cherns Major (unregistered) in reply to Steve The Cynic

    I used to do some work for a bus company that had a 30-hour clock for its scheduling and timekeeping systems. This would actually be very useful: for instance, a shift that started at 2200 hours (10:00pm) Monday and ended at 0600 hours Tuesday would be counted as having ended at 3000 hours Monday. (As I recall, no shifts could ever start on one day and end after 0600 the next, but I suppose that there really was no reason that the clock had to be limited to just 30 hours.)

    Furthermore, I notice that in my local paper's tv listings, a "day" is considered to start at 6:00am and run to 5:59am on what is officially the next day. This is certainly in accord with the usual viewer's idea that a show that starts at, say, 1am Tuesday is "actually, subjectively" just very late Monday night.

Leave a comment on “The White Flag”

Log In or post as a guest

Replying to comment #:

« Return to Article