Board index » delphi » Re: Hejlsberg on language design
Wayne Niddery [TeamB]
![]() Delphi Developer |
Re: Hejlsberg on language design2003-10-12 02:10:55 AM delphi32 Ingvar Nilsen writes: Quote> // do something except end; There may be a very rare exceptions <g>where this (suppression without action) is justified, for example when dealing with some external process you have no control over. But even then, chances are there is *something* that should be done within such an exception. Also, as Anders points out, exceptions are often handled at a local area when they should be allowed to percolate up, in most cases at least, to a higher level, centralized, exception handler. try // do something SomeResource.Free; except SomeResource.Free; end; ... or even ... try // do something success := True; except SomeResource.Free; Exit; end; if success then SomeResource.Free; I saw stuff like this all over a project I took over, recently written by a company claiming to have Delphi expertise since D1. There should be no exception blocks here, only finally blocks. -- Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com) RADBooks: www.logicfundamentals.com/RADBooks.html "It is error alone which needs the support of government. Truth can stand by itself." - Thomas Jefferson |