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

"Vinzent Höfler" JeLlyFish.software at gmx.net
Fri Aug 6 19:59:00 CEST 2010


Alexander Klenin <klenin at gmail.com>:

> On Sat, Aug 7, 2010 at 03:10, "Vinzent Höfler"
> >
> > But you can mistake the "+=" for a ":=". Replacing one possible reading
> error with another isn't much of an improvement.
> 
> You can also mistake "." for ",", ">=" for "<=", or mix up "<>", "><",
> "<<" and ">>" --
> which are all valid but different symbols in FPC. This is quite a minor
> problem.

Except for the ">=" "<=" the resulting error would not compile in most cases. THAT's the difference.

> Code bloat/duplication is much more serious.
> It is usually not just SomeReallyLongVariableNameY, but something like:
> SomeFunctionReturningObject(param1, param2).PointArrayField[i] +=
> FunctionReturningPointOffset(param);
> Try rewriting that without "+=".

Add (SomeFunctionReturningObject (param1, param2).PointArrayField[i],
     FunctionReturningPointOffset (param));

IMO, since the invention of subroutines, the expressive power of operators is overestimated. Consistently.


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