DenkzeitWiki

Suchen:

Aktuelle Änderungen Printable View Änderungen Bearbeiten

PythonAufDeutsch > DebuggingClojure > GarbageCollector > GarbageCollection > BicycleRepairMan > PythonIDEs > ConditionSystems > Conditions > InformationSchema > GarbageCollection > RecentChanges > IPython > YukihiroMatsumoto > TestDrivenClojure > MatthiasFelleisen > CheckedExceptions > ExceptionsClear Trail
Main /

Exceptions

(weitergeleitet von Main.CheckedExceptions)

SoftwareEngineering
DesignByContract
ConditionSystems
SpaghettiCode


I don't think so. Return-values (RV)? Better not. Handling RV has to be adapted all the time new RV enter. While that has to be done with Exceptions, too. You'll notice if you forget this with exceptions. You won't notice when using RV. Will you?

In exception-based code one must be prepared that any method-call (constructor, etc.) may fail!

General design principle: Don't commit data until they are ready.


Be careful with side-effects!
Write exception-based code good the first time.



Exceptions are escape Continuations [1]


in .NET, the stack trace is created at the time you throw the exception. In Java, it's created at the time you create the exception;

 use
 throw;
 instead of
 throw excInstance;



The Question

Better use Exceptions or Return Values? Should one write exceptions-based code or error-based code?

Checked vs. Unchecked

The trick, you see, is that RuntimeExceptions don't need to be declared, and all of the code you were thinking of writing just got a whole lot cleaner-looking. [2]


Resource Acquisition Is Initialization (RAII)

The technique combines acquisition and release of resources with initialization and uninitialization of variables.

Edit - BackLinks - Tags - Page Hist - Print - Changes - Home - Orphans - Help

Zuletzt geändert am 13.09.2008 11:15 Uhr und seit 7. April 2005 4073 aufgerufen.