Women in Technology

Hear us Roar



Article:
  Introduction to Amazon S3 with Java and REST
Subject:   nice article
Date:   2007-11-08 17:02:02
From:   slackorama
Nice article.


But this seems kind of strange and non-standard to me.
if ((statusCode/100) != 2)


why not just use if (statusCode != 200)?

Full Threads Newest First

Showing messages 1 through 5 of 5.

  • It's not just 200, it's 2XX
    2007-11-09 07:44:34  pcarroll [View]

    I'm guessing that the ((statusCode/100) != 2) to handle *all* 2XX return codes, not just 200.
    • It's not just 200, it's 2XX
      2007-11-11 08:12:59  georgecoller [View]

      That's called clever programming at the expense of code clarity. (bad habit, especially in tutorial)
      • it explains a bit about history......
        2007-11-11 14:31:08  jamesak [View]

        ...where 95% of mordern operating systems are still experiencing crashes, due to the bad habits of our ancestor developers (who are suppose to be the teachers). Thats not to say that I'm a saint. A better breed. I hope!.
        • it explains a bit about history......
          2008-09-11 08:28:05  Anonymous8888 [View]

          Let's not be stupi_d, anyone can see this is a quick introduction.

          There is no reason to create test case, UML diagram, etc ..
      • It's not just 200, it's 2XX
        2007-11-12 08:29:39  pcarroll [View]

        Well, look at it like this: it is just a quick-and-dirty piece of code to get you off the ground. So, take the good with the bad.

        Kind of like in the Simpsons:

        Marge: Now be good for Grampa while we're at the parent-teacher meeting. We'll bring back dinner.
        Lisa: What are we gonna have?
        Homer: Well, that depends on what your teachers say. If you've been good, pizza. If you've been bad... uh... let's see... poison.
        Lisa: What if one of us has been good and one of us has been bad?
        Bart: Poison pizza.
        Homer: Oh, no! I'm not making two stops!