Delphi-PRAXiS
Seite 4 von 4   « Erste     234   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi try .. except .. finally (https://www.delphipraxis.net/137104-try-except-finally.html)

alzaimar 16. Jul 2009 07:02

Re: try .. except .. finally
 
Die Methode AddLogAlert hat natürlich einen eigenen Exception-Handler, der etwaige Probleme abfängt. Was interessiert den Programmierer, ob die Platte korrupt ist? Das muss die IO-Schicht abfangen und ggf. eine fatale Exception werfen, oder im Hintergrund eine neue Festplatte downloaden und sofort installieren. :stupid:

Hier ist uns Java überlegen, wo man in der Methodendeklaration gleich noch angibt, welche Exceptions auftreten können.

Khabarakh 16. Jul 2009 08:24

Re: try .. except .. finally
 
Zitat:

Zitat von alzaimar
Hier ist uns Java überlegen, wo man in der Methodendeklaration gleich noch angibt, welche Exceptions auftreten können.

Segen... oder Fluch ;) ?

The Trouble with Checked Exceptions. A Conversation with Anders Hejlsberg

Dort wird auch genannt, warum ich keine große Notwendigkeit für try-except-finally sehe:
Zitat:

It is funny how people think that the important thing about exceptions is handling them. That is not the important thing about exceptions. In a well-written application there's a ratio of ten to one, in my opinion, of try finally to try catch.
Gut, C# besitzt sowas :stupid: , aber dort habe ich sowieso noch nie ein finally benötigt :stupid:² .


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:34 Uhr.
Seite 4 von 4   « Erste     234   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz