why ; ?

Leandro Lucarella llucax at gmail.com
Thu May 8 07:01:03 PDT 2008


Janice Caron, el  8 de mayo a las 05:23 me escribiste:
> On 08/05/2008, Leandro Lucarella <llucax at gmail.com> wrote:
> > No you don't, \n is your redundancy. So you still get meaningful messages.
> 
> That would be true IF AND ONLY IF we were forced to escape newlines
> that didn't mean end-of-statement. e.g.
> 
>     auto a = b \
>     (c)
> 
> I wasn't aware that requiring me to escaping newlines was part of the
> suggestion. If it was, then I'm even more against it.

Yes, in my suggestion you need to escape false-newline-end-of-statement in
some few cases, like in Python.

What you written (which doesn't make any sense, I don't know what's the
point of putting shitty and unreal examples to prove a point) need a
escape at the end of the line, but this (more realistic) version doesn't:

auto a = b(
    c)

Because when you don't expect a statement to finish until the closing ) is
found (which is *exactly* the same behavior you get now, so please don't
bring the "meaningful errors" argument again =).

I have a Python project with 6482 LOC and I have just 39 lines with line
continuation. I think adding an extra character (\) to 0.6% of the lines is
pretty acceptable if you get rid of the extra character (;) at the end of
the line in the other 99.4% =)

Really. You are telling me that is ugly to have a '\' in 0.6% lines of code
but is pretty to have ';' in 100% of them??? It doesn't makes any sense to
me...

> Besides which, how would that work with statements like
> 
>     if (a == b) { ++i; ++j } else { --i; --j }
> 
> If newlines were to take over the role of semicolons, then that would turn into
> 
>     if (a == b) { ++i
>     ++j } else { --i
>     --j }
> 
> Yuk.

Is *that* hard to read the entire message? I said ';' is OPTIONAL (and
that's the key for backward compatibility). So you can perfectly write:

if (a == b) { ++i; ++j } else { --i; --j }

"Yuk."

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Dentro de 30 años Argentina va a ser un gran supermercado con 15
changuitos, porque esa va a ser la cantidad de gente que va a poder
comprar algo.
	-- Sidharta Wiki



More information about the Digitalmars-d mailing list