[fpc-devel] Proposal: Enhanced replacement for assignment operators

"Vinzent Höfler" JeLlyFish.software at gmx.net
Fri Aug 6 18:10:49 CEST 2010


Michalis Kamburelis <michalis.kambi at gmail.com>:

> Vinzent Höfler wrote:
> > Alexander Klenin <klenin at gmail.com>:
> > 
> >> C-like operators reduce the number of required punctuation --
> >> I always think that the extra punctuation is bad for readability.
> > 
> > Rght. Shrt sntncs r mch sr t rd.
> > 
> 
> This is more about
> 
>   SomeReallyLongVariableNameX += 10;
> 
> being nicer to read than
> 
>   SomeReallyLongVariableNameX := SomeReallyLongVariableNameX + 10;

Regarding "punctuation" this is the difference between "+=" (or even "+:=") and ":= +". Not much of a difference, I assume?

> You don't have to spend time realizing that it's the same variable (not
> e.g. SomeReallyLongVariableNameY) if you read the 1st form.

But you can mistake the "+=" for a ":=". Replacing one possible reading error with another isn't much of an improvement.

Maybe if you've learned reading Cish books, the former version is easier to read, but the books I learned reading with contained text. ;)

But well, while we're at it, what about conditional expressions?

X := (if A then Y else Z);

(See <http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai05s/ai05-0147-1.txt> This is an Ada 2012 feature which I actually don't like at all for the same reasons as the C-like operators: they interrupt the normal flow of reading. But well...)


Vinzent.

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the fpc-devel mailing list