Prev | Current Page 358 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

What does the word exceptions mean to you? It should mean
something that doesn ??™ t fit a given set of rules, as in ??? the exception to the rule. ??? If you imagine your code
as a series of rules, then an exception is something that doesn ??™ t fit well inside of it. Now, this doesn ??™ t
have to be an error, merely an event within your code that a specific block was not designed to handle at
the time and place of its inception. Also, this means that, should such an event arise, it should not
necessarily be handled as an error, but possibly as an event that should be trapped and handled
elsewhere.
Numerous philosophies are oriented toward programming with exceptions. Many will claim that
trapping exceptions and rethrowing them to a parent object as a way of handling a specific non - error is a
very sloppy way of coding. Many others would consider trapping exceptions as some form of a virtual
post office that facilitates an alternative to checking the return values of each and every function call
while providing less code that is more pleasing to the eye.


Pages:
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370