SelectSQL issues

  1. ‹ Older
  2. 7 weeks ago

    Jeff T

    Feb 12 Pre-Release Testers 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 Pre-Release Testers, Xojo Pro outside LMAO
    Edited 7 weeks 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 Pre-Release Testers, Xojo Pro Europe / Germany / Lower Saxon...
    Edited 7 weeks 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
       ...
     endif
     db.Close
    else
     Message "can't open database"
    ShowErrorList
    endif

    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!