F.I of the month

«1

Comments

  • : http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=25&MsgID=224887&Setting=A9999F0001
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    Deep sigh and no comments ...
  • : http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=25&MsgID=224887&Setting=A9999F0001
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://mark.space.servehttp.com

  • : http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=25&MsgID=224887&Setting=A9999F0001

    The fact that JAVA actually has an error message quite literally worded "General Error" is kinda funked up too...

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • : : http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=25&MsgID=224887&Setting=A9999F0001
    :
    : The fact that JAVA actually has an error message quite literally worded "General Error" is kinda funked up too...

    Seems like every exception-throwing language has a base error or exception class that is too generic to be useful. I know Python has class Exception which is intended mostly to be subclassed for specific applications. Even then, though, you can pass a custom message to the constructor and the traceback will point you to the specific line that raised it. Does Perl have a try/catch syntax for exceptions? Error handling is one of the most frustrating things about VB after working with something as fabulous as Python's try/except/finally/else blocks.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • : Error handling is one of the most frustrating things about VB
    [blue] You wouldn't say that after trying PowerBuilder 5.0 Error method. That's real piece of crap! It simply does not work at all![/blue]

  • : Seems like every exception-throwing language has a base error or
    : exception class that is too generic to be useful. I know Python has
    : class Exception which is intended mostly to be subclassed for
    : specific applications. Even then, though, you can pass a custom
    : message to the constructor and the traceback will point you to the
    : specific line that raised it.
    I think the JAVA one would return the line that raised the exception. I only wished it had been posted...just imagine "I've got an General Error on line 25 of my code. Help!" with no code. I wouldn't know whether to laugh or cry...

    : Does Perl have a try/catch syntax for exceptions?
    If Perl has a weak spot I can pick at, this might be it. There is a way to throw an exception (using the die keyword), and this propogates up to the next eval { ... } block and causes that to fail. You can check the return value of the eval block to see if an exception was caught, and if it was you can handle it as you wish. This works for both user thrown exceptions and ones that Perl throws. If you don't have a handler, it propogates to the top and Perl spits out the error and terminates.

    The main weakness is that there isn't any kind of exception object or any standardised way of saying what went wrong. You are dependent mainly on text based messages, which you set and then have to parse later - a problem. You might well be able to define your own exception object, mind...and there may be modules that handle exception stuff better that you can use.

    On the other hand, Perl does allow you to put short circuit OR operators to good use for simple error handling:-

    open my $fh, "somefile.txt" || die "Couldn't open file - $!
    ";

    Good for simple stuff - probably for small scripting tasks, which is where Perl was heavily used in the early days of it's existence.

    I suspect that things will be much improved on this front in Perl6. I certainly hope they will be. :-)

    : Error handling is one of the most frustrating things
    : about VB after working with something as fabulous as Python's
    : try/except/finally/else blocks.
    I never liked VBs error handling mechanisms full stop. Even before I saw what else was "out there".

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • : : Error handling is one of the most frustrating things about VB
    : [blue] You wouldn't say that after trying PowerBuilder 5.0 Error method. That's real piece of crap! It simply does not work at all![/blue]

    PowerBuilder - is that a Borland thing? Tied to any particular language?

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • [b][red]This message was edited by lionb at 2003-11-17 13:21:29[/red][/b][hr]
    : : : Error handling is one of the most frustrating things about VB
    : : [blue] You wouldn't say that after trying PowerBuilder 5.0 Error method. That's real piece of crap! It simply does not work at all![/blue]
    :
    : PowerBuilder - is that a Borland thing? Tied to any particular language?
    :
    : Jonathan
    :
    : ###
    : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
    :
    :
    Ooops! Did I send empty message?


  • : : : : Error handling is one of the most frustrating things about VB
    : : : [blue] You wouldn't say that after trying PowerBuilder 5.0 Error method. That's real piece of crap! It simply does not work at all![/blue]
    : :
    : : PowerBuilder - is that a Borland thing? Tied to any particular language?
    : :
    : : Jonathan
    : :
    You mean Builder Studio? No. PowerBuilder is a OO language. It was created by PeopleSoft company which was aquired by Sybase.
  • : : : : : Error handling is one of the most frustrating things about VB
    : : : : [blue] You wouldn't say that after trying PowerBuilder 5.0 Error method. That's real piece of crap! It simply does not work at all![/blue]
    : : :
    : : : PowerBuilder - is that a Borland thing? Tied to any particular language?
    : : :
    : : : Jonathan
    : : :
    : You mean Builder Studio? No. PowerBuilder is a OO language. It was created by PeopleSoft company which was aquired by Sybase.

    What little I've heard of PowerBuilder is generally positive. Interesting to hear a specific complaint.

    Oracle's PL/SQL language recently got some fairly good exception handling capabilities. In fact, I might consider PL/SQL one of my favorite languages to work with.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • : : Does Perl have a try/catch syntax for exceptions?
    : If Perl has a weak spot I can pick at, this might be it. There is a way to throw an exception (using the die keyword), and this propogates up to the next eval { ... } block and causes that to fail. You can check the return value of the eval block to see if an exception was caught, and if it was you can handle it as you wish. This works for both user thrown exceptions and ones that Perl throws. If you don't have a handler, it propogates to the top and Perl spits out the error and terminates.
    :
    : The main weakness is that there isn't any kind of exception object or any standardised way of saying what went wrong. You are dependent mainly on text based messages, which you set and then have to parse later - a problem. You might well be able to define your own exception object, mind...and there may be modules that handle exception stuff better that you can use.
    :
    : On the other hand, Perl does allow you to put short circuit OR operators to good use for simple error handling:-
    :
    : open my $fh, "somefile.txt" || die "Couldn't open file - $!
    ";
    :
    : Good for simple stuff - probably for small scripting tasks, which is where Perl was heavily used in the early days of it's existence.
    :
    : I suspect that things will be much improved on this front in Perl6. I certainly hope they will be. :-)

    Python has great exception handling. You can define your own exceptions just by creating an empty subclass of Exception.

    [code]
    >>> class MyError(Exception): pass
    [/code]

    Then you just use the raise command anywhere to "throw" it.

    [code]
    >>> raise MyError
    Traceback (most recent call last):
    File "", line 1, in ?
    MyError
    [/code]

    You can pass it an arbitrary string, too:

    [code]
    >>> raise MyError("foo!")
    Traceback (most recent call last):
    File "", line 1, in ?
    MyError: foo!
    [/code]

    There are try/catch blocks too:

    [code]
    >>> try:
    ... raise MyError
    ... except:
    ... print "caught exception"
    ...
    caught exception
    [/code]

    There's even an "else" block that will execute if the try block [italic]didn't[/italic] raise an exception.

    [code]
    >>> try:
    ... pass
    ... except MyError:
    ... print "caught exception"
    ... else:
    ... print "didn't catch exception"
    ...
    didn't catch exception
    [/code]

    You can also catch specific exceptions:

    [code]
    >>> try:
    ... raise ZeroDivisionError
    ... except MyError:
    ... print "caught MyError"
    ... except ZeroDivisionError:
    ... print "caught ZeroDivisionError"
    ... except:
    ... print "caught error"
    ...
    caught ZeroDivisionError
    [/code]

    Also, instead of a generic message, you can catch the instance of your exception too:

    [code]
    >>> try:
    ... raise MyError("supercalifragilisticexpialidocious")
    ... except MyError, e:
    ... print "MyError:", e
    ...
    MyError: supercalifragilisticexpialidocious
    [/code]

    There's also an alternative "finally" block to do cleanup before an exception gets raised up the call stack:

    [code]
    >>> try:
    ... raise MyError("foobar")
    ... finally:
    ... print "Cleaning up..."
    ...
    Cleaning up...
    Traceback (most recent call last):
    File "", line 2, in ?
    MyError: foobar
    [/code]

    So you can see that Python's exception handling is easy to work with, very flexible, and an integral part of the language.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • [b][red]This message was edited by lionb at 2003-11-18 7:13:20[/red][/b][hr]
    : : : : : : Error handling is one of the most frustrating things about VB
    : : : : : [blue] You wouldn't say that after trying PowerBuilder 5.0 Error method. That's real piece of crap! It simply does not work at all![/blue]
    : : : :
    : : : : PowerBuilder - is that a Borland thing? Tied to any particular language?
    : : : :
    : : : : Jonathan
    : : : :
    : : You mean Builder Studio? No. PowerBuilder is a OO language. It was created by PeopleSoft company which was aquired by Sybase.
    :
    : What little I've heard of PowerBuilder is generally positive. Interesting to hear a specific complaint.
    :
    [blue] I used to work with 2 versions of PB 5.0 and 7. IMO, last one was the worse. PB 5.0 generally was fine and in some cases even much better than VB. The best example Window/Data Control. No one of Microsoft Grid Controls is not even close to the same PB control. It's very friendly and works perfectly. At the same time, some PB stuff, like Error object is very week or does not work properly. Sometimes using API functions failed. Or working with Menu ... That was a real head ache. Besides, even though PB is OO language, there was not way to build something like UserControl or ActiveX in PB 5.0. Working with "foreign" objects like Adobe PDF Reader was a real paint of the ass. PB 7 was very unstable. I've never seen so many Dr.Watson Error messages during the design time working with another languages. Sybase also released piece of crap named Jaguar (for me it looked like bad copy of another piece of crap MTS) together with PB 6. Since 20001 (PB 7 was released) Sybase released PB 8 and very soon after that PB 9. Even Microsoft do not released new versions of its products that quick ... In other words, nothing is perfect in this world[/blue]

    : Oracle's PL/SQL language recently got some fairly good exception handling capabilities. In fact, I might consider PL/SQL one of my favorite languages to work with. :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    :



  • :
    : Oracle's PL/SQL language recently got some fairly good exception handling capabilities. In fact, I might consider PL/SQL one of my favorite languages to work with.
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    :
    I thought it's a Python. Or Python is just a pet language?
  • : :
    : : Oracle's PL/SQL language recently got some fairly good exception handling capabilities. In fact, I might consider PL/SQL [b]one of[/b] my favorite languages to work with.
    : :
    : I thought it's a Python. Or Python is just a pet language?

    Python is my favorite language overall. I actually have to use PL/SQL at work and at first I didn't care for it but I've really learned to like what it has to offer - with the caveat that it only runs in Oracle databases. Since we're stuck using an Oracle database for the project, I very much prefer coding in PL/SQL than in VB. One part of the project prints documents. It used to be a horrible nightmare of Crystal Reports and VB hacks. Now, 90% of the code is in the database and VB is only used to transform the XML returned by the database into XSL-FO and then call FOP and GhostScript. I've since learned how to also do XSLT in the database, so in theory the database could contain 99% of the document generating code and VB would be solely responsible for driving the process. Even that could be replaced by some clever .BAT scripting. Ooh, or Python. Hmmmm.....


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • You might want to try a fairly recent version. 5.0 is at least 6 or 7 years old. The current versions (8 and 9) offer structured exception handling...

    : : Error handling is one of the most frustrating things about VB
    : [blue] You wouldn't say that after trying PowerBuilder 5.0 Error method. That's real piece of crap! It simply does not work at all![/blue]
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories