Python Forgiveness vs. Permission and Duck Typing
In Python, I often hear that it is better to “beg forgiveness” (exception catching) instead of “ask permission” (type/condition checking). In regards to enforcing duck typing in Python, is this
Decision for Unchecked Exceptions in Scala
As a java programmer, I have always been critical of Unchecked Exceptions. Mostly programmers use it as an en-route to coding easiness only to create trouble later. Also the programs (though untidy) with checked exceptions are much robust compared to unchecked counterparts.
Having error codes option in C++ library for performance
I have written an open source and cross-platform C++ File Library which have exception and error codes. Exceptions can be disabled when the program is running. In that case, the user have to check the error codes. Of course, when exception throwing is enabled, error code won’t be returned because exception is thrown before the called function returns.
Data decoding initialization/Constructor error handling
I have a set of loadable data decoders for a specific type of data and a stream to read containing data. Now I want the program to select the correct decoder in a reliable way so I want to use a trial-and-error algorithm. It seems resonable to create a decoder and connect it to the stream using a constructor:
Are exceptions an OOP concept?
Having read a post yesterday, I realized I did not know much about the origin of exceptions. Is it an OOP related concept only? I tend to think it is, but again there are database exceptions.
C++ exceptions vs. preliminary error condition checks
Preamble One of the concepts used in writing Python code is “Easier to ask for forgiveness than permission”, aka EAFP. Literally, this means that instead of doing checks, whether an operation is possible, you do the operation and “ask forgiveness” if what you do fails. Technically this means (just an example with no particular meaning): […]
throwing runtime exception in Java application
I am working as a contractor designing enterprise Java application for my client in the role of a technical lead. The application will be used by end users and there will be a support team who will support the application when we leave.
How to remove duplicate exception block code
I have good number of Service and DAO classes which has the same set of 30 line exception code block which gets repeated and it shows up in Code Duplication report.
Why does File.Open in .Net throw exceptions and not follow exception handling best practices? [duplicate]
This question already has answers here: I’ve been told that Exceptions should only be used in exceptional cases. How do I know if my case is exceptional? (12 answers) Closed 11 years ago. I have read at many places including this – http://msdn.microsoft.com/en-us/library/seyhszts.aspx – that you should use exception handling when something is truly exceptional. […]
Good library for combining .net stack traces [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for […]