Error Testing

Chris Angelico rosuav at gmail.com
Sat Oct 19 19:02:23 EDT 2013


On Sun, Oct 20, 2013 at 9:46 AM, Ned Deily <nad at acm.org> wrote:
> In article
> <CAPTjJmqRRxSx0rhU0bShQHBAwYm6_NWb6eX3hKetjwMDADQQxg at mail.gmail.com>,
>  Chris Angelico <rosuav at gmail.com> wrote:
>> Pascal tried to create a new operator, := to be read "becomes", to
>> deal with the whole equality-vs-assignment issue.
>
> Um, Pascal was just following the lead of ALGOL 60, roughly a decade earlier.

Sorry, the word "create" was poorly chosen. Would "deploy" be better?
I'm aware there's a family; what I'm trying to say is that, in Pascal
(I prefer to use a better-known language for discussion, where
possible), there's a new operator instead of =.

Anyway, my point is that it doesn't really help much. Imperative code
is temporal (maybe functional or declarative code could be closer to
maths, but we're talking Python here, which is imperative), where
mathematical truth is timeless. If a² + b² = c² now, then it still
will be true tomorrow. In programming, that's far from guaranteed
(though compilers will often optimize if they know there's a section
of code where the three won't change). You have to get your head
around that, whether you're doing assignment or comparison, and using
a different symbol to represent them is doing yourself as much of a
disservice as avoiding + for addition of floats to emphasize that they
don't always work like real numbers.

ChrisA



More information about the Python-list mailing list