[eeps] A plea against trivial heterogeneity (eeps 21, 27, 28)
Bob Ippolito
bob@REDACTED
Fri Feb 20 01:17:34 CET 2009
On Thu, Feb 19, 2009 at 4:09 PM, Dominic Williams
<erlang@REDACTED> wrote:
> Hello,
>
> I think a programming language should not provide several
> ways of achieving the same thing, especially when the choice
> is only a matter of taste.
>
> As programmers, we waste too much time thinking, hesitating
> or arguing about the totally trivial issues of style and
> layout. Then, we are not comfortable reading, let alone
> modifying, someone else's code. Code within the same product
> looks different, or people are frustrated with having to
> adjust to new conventions in a new project or company.
>
> I would actually go so far as to welcome a compiler which
> rejected code in which the layout (spaces, indentation etc)
> was not "standard". Obviously, all editors could then
> enforce the official layout. Then, all code would look
> identical in those trivial aspects.
>
> With that in mind, I am not favourable to the following
> EEPS:
>
> 21: Optional trailing commas for lists and tuples
> 27: Multi-Parameter Typechecking BIFs
> 28: Optional leading semicolons for choices
>
> Which all introduce an additional, optional syntax, which
> some people will adopt while others will stick to the
> existing syntax, leading to increased heterogeneity in
> styles of coding.
This argument doesn't seem very convincing for 21 of 28. People
already do this by accident all the time, it's frankly just annoying
that you can't. The only fair argument I can come up with is that some
versions of Erlang will support it and some will not, which can also
be annoying. For example, some browser JavaScript interpreters allow
for trailing commas (e.g. Firefox) but others consider it a syntax
error (e.g. Safari, IE). In the Erlang case it would be just between
one release and the next, but syntax sugar to allow trailing commas
and semicolons would be a pretty silly reason to require a newer
release to run the code.
-bob
More information about the eeps
mailing list