[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Breakthrough dream or Selenophobia
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 30 Mar 2017 12:29:08 +0200
2017-03-29 21:31 GMT+02:00 Russell Haley <russ.haley@gmail.com>:
> Lua showing up on any top ten list is actually a compliment to its
> wide and varied usage. Hardly what I would call a niche language.
> I'm sure there are dozens of lanuage communities that would love
> to be a top ten dreaded language. Perhaps what is meant instead
> of niche is strength or feature? Likewise, the diversity of variants is
> a testament to the utility and flexibility of the syntax.
I think the reason why Lua is a dreaded language is that those
who develop software in it — that's us — delight in making our
tricks obscure. I consider myself an experienced Lua programmer
by now, and I dread having to modify a program that someone
else wrote.
1. Modules
At the top of a program you see
local pkg = assert(require "obscuremodule")
The author of the program knows the API for that module. The reader
does not. Does the author document any of that API? Of course not.
It's documented, if at all, inside the module. However, if that "require"
goes through, "pkg" could be any Lua value, any global variable may
have been set, any system library may have been monkey-patched.
The reader has to discern which.
2. Objects
There are any number of object paradigms floating around. Is the
constructor the callable metatable? Is __index distinct from the
metatable. Does the author document any of that? Seldom.
3. Metatables
That one word says all. You know what you do with them. Does
anybody else know?