News for hackers. Stuff that matters.
Re:Ask HN: What is your best advice for a junior software de... by moron4hire on Wednesday October 03, 2018 @04:00PM (#18134270)
Erh, exception types should include an inner exception parameter, for the generic one they wrap. So neither of your two examples are all that great.
Re:Ask HN: What is your best advice for a junior software de... by scarface74 on Wednesday October 03, 2018 @04:43PM (#18134664)
Why would I wrap an exception if I don’t plan to have special handling? If it is exception that I didn’t throw because of a business reason, why not just throw the original exception?
Re:Ask HN: What is your best advice for a junior software de... by moron4hire on Wednesday October 03, 2018 @05:25PM (#18134952)
If you don't have any special handling, then why are you catching it at all?
Re:Ask HN: What is your best advice for a junior software de... by scarface74 on Wednesday October 03, 2018 @05:30PM (#18134987)
That was the "//Do stuff" part, you may want to do some cleanup (in C# usually handled by a finally block or a "using" block), send a custom notification, logging (usually I would just let the client handle logging), etc.