Suggestion: Syntactic sugar for Exception handling in D2

Ulrik Mikaelsson ulrik.mikaelsson at gmail.com
Sun Jun 21 12:51:33 PDT 2009


I just remembered another tiny benefit of allowing this. Being a VCS-fascist, I really strive towards patches that are as readable as possible.

>   * Makes the code slightly more readable, since the "exceptional" code-paths are clearly separated
>   * Biases me as a programmer to think a little bit more of exactly what exceptions can be raised in a function, improving my code-quality.
>   * When I'm about to write a try-clause, makes me think twice if the code could not be extracted as a separate method instead (if I can only figure a good name for it), also improving readability and code-structure.
+   * Patches adding exception-handling will not change indentation of a potentially very large method, making it slightly easier to read.



More information about the Digitalmars-d mailing list