[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Proposal: allow @, $, !, and ? in Lua identifiers
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 25 Apr 2014 14:37:46 +0200
On Fri, Apr 25, 2014 at 2:13 PM, Coroutines <coroutines@gmail.com> wrote:
> Ruby also makes it convention to put ! at the end of the function name
> if if modifies its `self'. The non-! version returns a modified copy.
That's a fine convention, but then everyone must use the convention
consistently and idiomatically. An enormous amount of code must then
be rewritten. It's an option for a new language, but not for a
twenty-year old.
The situation IMHO is better handled with good documentation
practices. In static languages, people can pretend that entities
don't need documentation since they have explicit types [1]. In
dynamic languages, documentation takes over the role of static type
annotations, at least in an informal way. Not mentioning copy/original
is then a documentation bug.[2]
As for the other characters, well perhaps we'll think of a better use
for them? My concern is that people will use them willy-nilly,
because they look Cool....
[1] and everyone agrees that tautological documentation ("add(x,y):
adds x and y") is worse than none at all. JavaDoc made this style
popular.
[2] if the docs are available at your fingertips, doubleplusgood - but
that's an environment/editor issue