[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: "noreturn" attribute in lua_error & Co
- From: Coda Highland <chighland@...>
- Date: Thu, 19 Apr 2012 07:13:50 -0500
> I'm afraid to say it, but I think you are assuming what a programmer
> might miss.
> There are languages where there is no explicit return, and with
> explicit ones. There is also Pascal where you store the return in a special
> variable (if memory still serves me well).
> It's really hard to say what would be beneficial to the programmer.
> If you mean the "lua" programmer then I dunno, I myself started doodling
> with it just year or so ago, after several years of not using it.
The general rule is "explicit is better than implicit."
Suppose you're a company that has Lua embedded into their system. Then
suppose you hire a new employee that's never worked with the Lua API
before.
Which is going to be better for that developer -- marking every exit
point from a C function with "return", or leaving some implicit while
others are explicit?
/s/ Adam