lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 31/05/16 04:58 PM, Dirk Laurie wrote:
2016-05-31 18:29 GMT+02:00 Soni L. <fakedme@gmail.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
its defects.

Uh, right, the context was the whole message, but particularly the parts where you talked about excessive use of exceptions.

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.