this post was submitted on 17 Jun 2023
93 points (98.9% liked)

Programmer Humor

32710 readers
100 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 9 points 2 years ago (2 children)

M$ Docu sounds like that doesn't make sense, do you have some more context?

[–] [email protected] 9 points 2 years ago

It is a relic of the past, where Microsoft intended developers to inherit all their custom exceptions from ApplicationException. Shortly after, they changed their mind and advised that custom exceptions should derive from the base Exception class.

Apparently. (Source: https://stackoverflow.com/questions/5685923/what-is-applicationexception-for-in-net)

[–] JustANoone 5 points 2 years ago* (last edited 2 years ago) (1 children)

I should have elaborated, but basically what MD87 replied. During the development of .NET it was decided that every exception caused by programs should inherit from ApplicationException, and all system errors should inherit from SystemException. Unfortunately .NET devs didn't follow this and now everything should just inherit Exception since it's easier to check. Interestingly, both SystemException and ApplicationException seem functionally identical to Exception.

[–] [email protected] 4 points 2 years ago

Which actually makes sense. Java logic with exceptions that you cannot catch is a practice no other language has.