lua-users home
lua-l archive

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


I've been writing code for a week, which leaves little time for
amusements like reading lua-l.  So,  I'm not really replying: as the
true lua-l member I hope to be, I'm just spouting off the top of my
head.

But, so as not to be guilty of hijacking a thread, here is a quote:

>>  Lua code (to the extent I have delved into it by now)
>> seems quite self-documenting.

I wish to remark that there are more ways of documenting code than comments.

Example from C:

Version 1:

if (level==0||head!=choice[level-1]->head) …

Better comment this, it's really obscure.

Version 2:

#define COLUMN_DONE level==0||head!=choice[level-1]->head
if (COLUMN_DONE) …

No comment required.

Examples from Lua are harder to find.  I'm not proficient enough to
write obscure Lua code :-)