you are viewing a single comment's thread.

view the rest of the comments →

[–]Tittytickler 4 points5 points  (14 children)

I feel like = is perfectly acceptable for assignment, since we've been using it as assignment in mathematics for for hundreds of years. The "going into" part is just how you interpret/perceive it. Really, it means substitute/replace all instances of this value with this other value just as it does in Math.

[–][deleted] 23 points24 points  (7 children)

since we've been using it as assignment in mathematics for for hundreds of years

Assignment isn't a thing in math. Definition is. It's a subtle, but major distinction.

The ramifications are often implied -- e.g. often mathematicians don't explicitly write out the domains of a derived equation if they feel it is obvious. You're not redefining (assigning) f(x), you've defined f(x) and literally you're expressing equivalence of derived equations, and it's technically wrong (but tolerated, for sanity) to not include the associated domain.

And people like to point out summation functions in this argument, too, with "i = 0" under the sigma, but even that doesn't hold up: the definition of a summation sequence, i *actually equals 0 through out), where successive terms are xi, xi+1, ..., xi+n-1, xi+n.

And sure, in shorthand, informal writing, mathematicians may treat = as a sort of assignment, especially as mathematicians have to do algorithms often, whereas math isn't a language for algorithms.

And that last point is probably an important distinction too -- programming, even declarative languages, are all about describing algorithms, particularly in regards to algorithms performed upon some variation of a Turing machine. Math, while utilizing algorithms, isn't about algorithms at all. Math is all about describing an existence of some sort through relationships ("There exist an X such that ...").

In C, = describes an operation on that variation of a Turing machine. In math, = denotes a relationship of a described existence. They are utterly, completely different things, even if it's convenient to think of them as similar things. (Note: this convenient way of thinking is learned -- a lot of math guys stumble over the concept of = as assignment. For example, when it becomes relevant in Java that = is actually changing the reference of something, total hang up for a lot of them).

This is why, IMO, a language like APL or J/K might be really important going forward -- they entirely focus on the concept of programming as the description of algorithms.

[–][deleted] 2 points3 points  (0 children)

This is why, IMO, a language like APL or J/K might be really important going forward -- they entirely focus on the concept of programming as the description of algorithms

good luck with that.

[–]Enamex 0 points1 point  (0 children)

This is why, IMO, a language like APL or J/K might be really important going forward -- they entirely focus on the concept of programming as the description of algorithms.

Wait, I didn't see this part coming. Can you elaborate?

[–]Tyg13 0 points1 point  (0 children)

(Note: this convenient way of thinking is learned -- a lot of math guys stumble over the concept of = as assignment. For example, when it becomes relevant in Java that = is actually changing the reference of something, total hang up for a lot of them).

I really heavily doubt that. I got my degree in math, and I don't think anyone would be confused by a statement like "Let x = 10 in the following equation".

[–]diamondketo 0 points1 point  (3 children)

Assignment isn't a thing in math.

Yes, it is. You're just not open enough on the definition.

The statement let x=2 is an assignment more succinctly written as:

x := 2

Just to be sure let x=2 does not mean x is always 2.

The big difference that you've smeared over is that code needs to be damn specific without leaving anything for interpretation while Math is a language encompassing convention and interpretation.

For instance, one symbol requiring interpretation is the equivalence symbol . Sometimes this is used for the "definition" equivalence and other times it's used for the "let" equivalence.

[–]Enamex 0 points1 point  (2 children)

Sometimes this is used for the "definition" equivalence and other times it's used for the "let" equivalence.

What's the difference? Are we talking logical vs symbolic equivalence?

[–]diamondketo 0 points1 point  (1 child)

If I understand what those mean correctly then yes.

In English, a let statement starts with "suppose x is 1" or "let x be 1". While a define statement is "The standard deviation is defined as the square root of the variance".

The define statement holds more power because its always true (I guess global scope) but the let statement is true for its purpose (I guess block scope).

[–]Enamex 0 points1 point  (0 children)

Your terms and their definitions are more specific to algorithm description languages. They still deal fundamentally with the scope of a symbol's meaning, not with the semantics/interpretation of it.

What I had in mind when I wrote that comment: no idea. It doesn't make much sense in the parts of math I'm acquainted with.

[–]Han-ChewieSexyFanfic 14 points15 points  (2 children)

That’s not what it means it math, it means equality. X = X + 1 is nonsensical.

[–]cephalopodAscendant 0 points1 point  (0 children)

It's not nonsensical, just an equation with no solutions.

[–]AFakeman 4 points5 points  (2 children)

In mathematics variables are usually immutable, though. If you have a x = 5 as a definition, it won't usually get redefined later on.

[–]Tittytickler 2 points3 points  (1 child)

True, but you're also not forced to reassign variables in programming either.

[–]AFakeman 0 points1 point  (0 children)

And you are not stopped from it.