正在加载图片...
What do we want of exceptions? Ideally,a language(and its implementation)should: ·Restrict the set of possible exceptions to“reasonable”ones Indicate where they happ ish between them e.g.no pointers to deallocated memory Allow exeeptionsdp thendaalt with in a different place in the code from wberes threy"acur so we throw exceptions where thes osoilicagd oafct theem where we want to deal with them.written cleanly without having Ideally,we don't want non-fatal exceptions to be thrown too far-this breaks up the modularity of the program and makes it hard to reason about.11 What do we want of exceptions? Ideally, a language (and its implementation) should: • Restrict the set of possible exceptions to “reasonable” ones • Indicate where they happened, and distinguish between them e.g. no pointers to deallocated memory and not map them all to “bus error” etc. • Allow exceptions to be dealt with in a different place in the code from where they occur so normal case code can be written cleanly without having to worry about them so we throw exceptions where they occur, and catch them where we want to deal with them. Ideally, we don't want non-fatal exceptions to be thrown too far — this breaks up the modularity of the program and makes it hard to reason about
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有