lua-users home
lua-l archive

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

Conclusion: concision is not the issue. The issue is personal taste. The "conciseness" of C is mostly illusory. :)

conciseness has no abstract meaning.
code size (input characters) depends on so many things.

i can write socket code in less lines/chars of lua than c, using luasocket (thanks diego)

but in c++, i can use a socket class to do similar.

you can't say that
"t = http:request(.....) " is less keystrokes than a native c implementation of the same.

that said, i find lua is easy to _read_, which is one of the most important factors in code longevity / re-use.

and yes, any long conditions end up coded like

if (a > b) then -- may comment this, if logic is unclear
else -- may comment this
end -- if (a>b) usually comment this, but maybe as "end -- if (colour test)"

i know the () are redundant, but i write a lot of c, and get used to enclosing tests, especially "a and nor b or c " types.

nb - it all goes pear-shaped when you change the test and not the comment. i have spent hours believing the comment, not the code.