All that ails us in programming…   June 13th, 2007

..is the confusion between the equals operator in maths and the assignment operator in most programming languages.

This entry was posted on Wednesday, June 13th, 2007 at 1:28 am and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed.You can leave a response, or trackback from your own site.

4 Responses

June 13th, 2007 at 9:16 am
Paul Browne - Technology in Plain English Says:

Sounds like you’ve just been caught out by that one. Hence the difference between = and == in Java.

June 13th, 2007 at 9:55 am
Joe Says:

Nope, its more philosophical than that. Imperative programming languages fundamentally break the link between equality as it exists in the real world and equality within programs.

In the purest of pure programming languages (Lisp and othe data flow variants), there is no assignment. Each variable recieves a single value and can never be updated again. Hence these languages have provably correct programs but more importantly can be understood to be correct without doind a PHD in denotational semantics.

If I have a tree in the real world, its a tree forever. If I have a tree in a program it can be a tree until I assign a car. Say what?

June 17th, 2007 at 1:39 am
Paul Campbell Says:

You need to read up on some real world Modal Logic, Joe!

June 17th, 2007 at 10:06 am
Joe Says:

Hmmm, there may be a class of problems for that, but it doesn’t look like a requirement for data upload or credit card processing…

Leave a Reply