lua-users home
lua-l archive

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


On 4/19/2012 5:13 AM, Coda Highland wrote:
        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."

I was not aware of this rule. But I agree it's a good rule, especially when it's explicit.

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.

I'll let him crash & burn, so he would learn :) Eventually he'll learn and get it right. He'll develop a style, and maybe push it onto others, at least teach them (right or wrong).

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?

Hell if I know! "Which is better for a developer" - is the quesion to which we have so many answers - languages, runtimes, operating systems, frameworks, etc.