🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.programming
Article #215546

Re: Ada Tutorial - w Instytucie Lotnictwa

#215546
From: heby
Date: Tue, 07 May 2019 20:52
20 lines
1913 bytes
On 07/05/2019 21:15, Wojciech Muła wrote:
> Zadanie dla chętnych: w ilu miejscach może tu polecieć wyjątek?
> Type1 i Type2 to jakieś klasy dostarczone przez użytkownika,
> nic o nich nie wiemy.
> 
> Type1 fun(Type2 a, Type2 b)
> {
>     if (a.get_value() > b.get_value()) {
>        return a.get_foo();
>     }
>     
>     return a.get_bar() + b.get_foo();
> }

Skoro nic o nich nie wiemy to obsługa tego wyjątku ma znaleźć się w 
kodzie który coś o Type1 i Type2 wie czyli pewnie poziom niżej. Inaczej 
kończysz na try {} catch(...) to jest jeszcze gorsze.

Wyjątki nie łapie się po każdym dodawaniu. Łapie się tam gdzie wiadomo 
co z nimi zrobić.
Technical Details
Message-ID: <qasr5t$7i2$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!3.eu.feeder.erje.net!feeder.erje.net!news.albasani.net!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
References: <c1760262-b4a3-44fe-a99e-2fa16be86820@googlegroups.com> <btKtE.25850$wd2.16727@fx24.fr7> <9537dd39-0164-41a6-803b-393b77b4a701@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!3.eu.feeder.erje.net!feeder.erje.net!news.albasani.net!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: heby <heby@poczta.onet.pl>
Newsgroups: pl.comp.programming
Subject: Re: Ada Tutorial - w Instytucie Lotnictwa
Date: Tue, 7 May 2019 22:52:10 +0200
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <qasr5t$7i2$1@dont-email.me>
References: <c1760262-b4a3-44fe-a99e-2fa16be86820@googlegroups.com> <btKtE.25850$wd2.16727@fx24.fr7> <9537dd39-0164-41a6-803b-393b77b4a701@googlegroups.com>
Mime-Version: 1.0
Injection-Date: Tue, 7 May 2019 20:52:13 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="f53946d952d6b6c1a986e9ad179f0b16"; logging-data="7746"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xAyOYV3xpRc5DMlPNu2ZB"
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
Cancel-Lock: sha1:KA15WlmNKMQa7HoxsfXJLXq6eRk=
In-Reply-To: <9537dd39-0164-41a6-803b-393b77b4a701@googlegroups.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit