SEH: the throw keyword - Forum - OpenEdge Development - Progress Community
 Forum

SEH: the throw keyword

This question is not answered

Matt Baker suggegested to start a new thread on the subject so here it is.

Interesting article on the throw keyword: hackernoon.com/the-throw-keyword-was-a-mistake-l9e532di

More on this f.e.:

www.monitis.com/.../
https://mattwarren.org/2016/12/20/Why-Exceptions-should-be-Exceptional/

Some new links I did not post in the previous message:

https://ruudvanasseldonk.com/2015/06/17/exceptional-results-error-handling-in-csharp-and-rust

a recent discussion on hacker news about the first article:

https://news.ycombinator.com/item?id=22158837

Btw another great article from the same writer as the first article ("Return to what works and jettison the fads"):

https://hackernoon.com/the-flow-manifesto-iq2732s1

@Gus : I think you will love the contents of the last link. ;-)

All Replies
  • It has been a long day, and I'm getting a little loopy.  So:  Just to lighten things up a bit, here are a two quotes on functional programming from the (highly recommended!) web-comic "xkcd", by Randall Munroe:

    Functional programming combines the flexibility and power of abstract mathematics with the intuitive clarity of abstract mathematics.

    Haskell isn't side-effect free after all; the effects are just concentrated in this one computer in Missouri that no one's checked on in a while.

  • It has been a long day, and I'm getting a little loopy.  So:  Just to lighten things up a bit, here are a two quotes on functional programming from the (highly recommended!) web-comic "xkcd", by Randall Munroe:

    Functional programming combines the flexibility and power of abstract mathematics with the intuitive clarity of abstract mathematics.

    Haskell isn't side-effect free after all; the effects are just concentrated in this one computer in Missouri that no one's checked on in a while.

  • It has something to do with determining the code execution tree mapping where every leaf must be proven to produce a safe state. I think SEH is easier to map than chasing output error code/text because it has an identifiable termination point.   

    dbeavon

    That is interesting.  I'd hate to write software for medical devices but, if I did, it would certainly involve SEH.  And I'd be extremely careful while crafting my catch blocks.

    In regular line-of-business code, I rarely catch all exceptions.  I try to catch the bulk of exceptions including the ones that are predictable.  But I only catch them as long as they aren't "above my pay grade".  If there is an out-of-memory, or full disk, or power failure, then those will (intentionally) escape my application catch blocks because I am not even going to pretend like I know what to do for them.  

    Normally it would be the job of the OS to log these types of unexpected crashes to the event log, and it can figure out what to do next ...  These types of things may even cause the entire VM to shut down and someone will need to allocate more resources to it from the Hyper-V host (memory or disk or whatever).  That type of thing is definitely above the pay grade of any given line-of-business application.

  • "Haskell can do anything your mainstream programming language can. Purity is not about preventing side effects (a database query or an http request), it's about having a clear boundary between code with side effects (impure) and pure code." alpacaaa.net/.../

  • For those interested in the error handling of rust (not a functional language btw, it borrows some things from functional languages)

    patshaughnessy.net/.../how-rust-makes-error-handling-part-of-the-language

    More background

    "Like most programming languages, Rust encourages the programmer to handle errors in a particular way. Generally speaking, error handling is divided into two broad categories: exceptions and return values. Rust opts for return values."

    web.mit.edu/.../error-handling.html

  • I prefer simple over easy www.infoq.com/.../. SEH makes it easy: to shoot yourself in the foot.

  • In the C# community one is thinking about an alternative to exceptions too, f.e.:

    medium.com/.../either-is-a-common-type-in-functional-languages-94b86eea325c

    mikhail.io/.../

  • In the case I'm talking about, the SEH requirement normally comes from the regulator, so it is not really an option. That the decision came from a gov't bureaucracy is another story.

  • Just a little puzzle, how do you go about handling OS level errors using simple output error/code?

  • I'm not the Encyclopedia Brittanica. If you're interested google or ask in a usergroup.