Regardless of how you see them, however,
exceptions are a necessity in programming, and can prove a very powerful tool when working in an
object hierarchy.
Those of you who have dealt with programming in Java or the .NET framework will know exceptions
very well. Pretty much everything you do that generates an error will produce an exception. However, it
is important to understand that exceptions in these languages are objects created by other objects, often
buried deep within the language framework. Once created, they are bubbled up through the application
until caught and dealt with, either by other objects in the language framework, or by your own classes. If
186
Part I: The Core Language
not dealt with properly, the exceptions are eventually exposed in a message output and your application
is often brought to a halt.
Languages that don ??™ t use an exception framework will often provide a more subtle way of alerting the
developer to an error. Some functions provided by the language may return a null or negative integer
value, while other more severe errors may bring the operating system to a complete standstill.
Pages:
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371