OT Signature quote [was Re: Unrecognized escape sequences in string literals]
darkwater42 at gmail.com
Sun Aug 16 20:55:31 CEST 2009
On Aug 16, 6:18 am, Steven D'Aprano <st... at REMOVE-THIS-
> On Sun, 16 Aug 2009 01:41:41 -0700, Douglas Alan wrote:
> > I would definitely not like a language that obscures assignment by
> > moving it over to the right side of lines.
> One could argue that left-assigned-from-right assignment obscures the
> most important part of the assignment, namely *what* you're assigning, in
> favour of what you're assigning *to*.
The most important things are always the side-effects and the name-
In a large program, it can be difficult to figure out where a name is
defined, or which version of a name a particular line of code is
seeing. Consequently languages should always go out of their way to
make tracking this as easy as possible.
Side effects are also a huge issue, and a source of many bugs. This is
one of the reasons that that are many functional languages that
prohibit or discourage side-effects. Side effects should be made as
obvious as is feasible.
This is why, for instance, in Scheme, variable assignment as an
exclamation mark in it. E.g.,
(set! x (+ x 1))
The exclamation mark is to make the fact that a side effect is
happening there stand out and be immediately apparent. And C++
provides the "const" declaration for similar reasons.
> In any case, after half a century of left-from-right assignment, I think
> it's worth the experiment in a teaching language or three to try it the
> other way. The closest to this I know of is the family of languages
> derived from Apple's Hypertalk, where you do assignment with:
> put somevalue into name
That's okay with me, but only because the statement begins with "put",
which lets you know at the very beginning of the line that something
very important is happening. You don't have to scan all the way to the
right before you notice.
Still, I would prefer
let name = somevalue
as the "let" gives me the heads up right away, and then immediately
after the "let" is the name that I might want to be able to scan for
More information about the Python-list