SelectSQL issues

  1. ‹ Older
  2. 5 months ago

    Jeff T

    Feb 12 Midlands of England, Europe

    the powers that be have decided that exceptions are the way forward.

    I get it, but my Gud it makes the code expand:
    Every damn thing gets wrapped in cotton wool
    And if you forget to do that - unhandled exceptions and / or crashes.

    This will not help newbies.. it will just make their apps crash instead of acting odd. (Yes I know thats a subtle distinction..)
    Whereas not checking an error condition at least allows for a little 'thats odd, let me look into it' time for your end users.

  3. Norman P

    Feb 12 Testers, Xojo Pro outside admiring the sunshine,...
    Edited 5 months ago

    Exception handling is measurably slower than checking error codes
    I wrote a blog post about this
    Its meant to be used when things are exceptional, things you didnt expect might occur like nil object or a file cant be opened that exists, not as a general purpose error handling mechanism

    I kind of worry that the "default" things people wil resort to is a single try catch surrounding all the code in every method "just to handle every error" or the single "exception" at the bottom of the method to catch every error
    Java ran into this early on and it made for some really awful code

  4. Markus R

    Feb 12 Testers, Xojo Pro Europe / Germany / Lower Saxon...
    Edited 5 months ago

    about error handling
    i like this way simplified with a boolean result

    if db.Open()=True then
     if db.Query("select * ...",Recordset)=True Then
     Message "can't open database"

    if a method catch a error it put it into a list and you can show this list when you want.
    at vb6 i wrapped much of ms methods this way because you can't use a single method without surrounding error handling.

    btw can xojo editor hide this try catch surroundings?

or Sign Up to reply!