Perl is worse!

Steve Lamb grey at despair.rpglink.com
Sat Jul 29 18:53:04 EDT 2000


On Sat, 29 Jul 2000 11:13:48 +0200, Alex Martelli <alex at magenta.com> wrote:
>Let's take your case, that of parsing and interpreting
>input strings of the form 'iDj[+k]' as found in role
>playing games ('roll i j-sided dice and add k').  Say
>that you now also need to support GURPS, which only ever
>uses six-sided dice, so the j is often omitted *and needs
>to default to SIX*, NOT to zero, when it is.

    GURPS, as well as other games, would be in different classes with the
class defining defaults for the dice.

>As the 'behaving oddly' will typically produce irreversible alterations
>of a precious persistent database

    Only if you're typically working with persistent databases.

>while the crash can at least be assumed to leave the database intact, the
>choice is anything but easy.  Would you rather die suddenly and painlessly,
>but with no chance of making a last will and testament, or slowly in
>excruciating pain, but with a last chance to put your worldly affairs in
>order?  What a heck of a choice to have to make!

    Personally, if my email client died because of some uncaught exception
versus me being able to close out my message beacuse of some bug in a display
routine, I'd rather be able to close out and save my 20k message than have to
retype it.  There is more to programs than databases.

>Fortunately, it doesn't have to be made: wrapping the top-level entries
>in a try/except is so TRIVIALLY easy, that there is really NO excuse
>for any program not doing so.  

    Great, and then we're out of some other common practices.  CNTL-C, for
example.  :P

>but that does not stop ME from having a last will registered, nor
>from wrapping my programs in try/except...:-).

    Just out of curiousity, how do you get back down into the loop if it is,
say, 12 deep?  Does Python hit the handler, do its thing, drop back down?

>Hey, you just *SAID* there could be a None, so you had NOT made
>sure at all that they did contain numbers!  None is NOT a number.
>The empty sequence is not a number.  You're contradicting yourself!

    No, I made sure there was a number in there, Python is the one that
decided to drop a None in.

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------



More information about the Python-list mailing list