On Wed, Apr 11, 2007 at 08:34:23PM +0100, Andy Stark wrote:
An alternative to assignment operators (+=, etc) might be to have a
shorthand for referring to the variables on the left hand side of the
assignment. Perhaps one of the unused characters (question mark, say)
could be used for this. So if we started with:-
longVarName = longVarName + 1
...we could change it to:-
longVarName = ? + 1
This makes me feel like I'm reading Perl code, where everything is a
mass of strange, unconventional operators. Inventing new, unfamiliar
operators for a language has its place ... but this just feels
contrived,
where typical += operators are what's really wanted.
...and then perhaps ?1, ?2, etc for multiple assignments.
This is inviting unreadable code, where you have to keep looking back
and forth and counting to figure out what each number in an expression
means. I've adjusted enough Perl expressions after changing a regexp
to call it a maintenance nightmare, too.
--
Glenn Maynard