[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Try-catch and try-finally
- From: "Soni L." <fakedme@...>
- Date: Tue, 31 May 2016 18:57:15 -0300
On 31/05/16 04:58 PM, Dirk Laurie wrote:
Uh, right, the context was the whole message, but particularly the parts
where you talked about excessive use of exceptions.
2016-05-31 18:29 GMT+02:00 Soni L. <email@example.com>:
The only reason why you should ever need to catch exceptions is to print
error messages, or to protect your program from crashing when doing
something dangerous (e.g. calling a external library), especially in Lua,
where errors are generally strings not objects.
You'll hate Python, then.
I am an ex-Pythonista who admired its compactness, orthogonality
and coherence, but was appalled by its profuseness and dependence
on whitespace. Lua to me combined Python's strengths while avoiding
That is, KeyError, IndexError, ValueError, etc... At least it's
consistent about throwing exceptions instead of returning None.
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.