Hacker News new | ask | show | jobs
by qbonnard 2105 days ago
A math tutor of mine was actually pretty angry at computer science for writing things like `a=1; a=2; //so 1=2 ?` I guess he'd rather have the "assign 42 to age"... Except he'd probably read `42 => age` as "42 implies age", which would probably cause him more sleepless nights ;)
4 comments

He’d probably like a := 42 which is in a lot of languages actually! Also Erlang and other fp’s do consider = equivalence.
I noticed a year or two ago when I'm pseudocoding I seem to default to "age <- 42" which I kinda like more...
I had the same issue. This is why I always comment my assignments.

    x = x + 1 // assign x to x+1
I can't tell if this is a multiple joke or not
> math tutor ... angry

It's not the same language, so why should he expect the semantics to be the same?

> It's not the same language, so why should he expect the semantics to be the same?

It's a bit like discovering that inline C in your favourite non-C language isn't actually semantically correct C. If you're a mathematician, then you know, intimately and fluently, how math is spoken and written, so seeing something that looks exactly like "inline math", but isn't, is jarring.

(I don't get angry over it, but it is exactly counter to the extremely delicate and precise way mathematicians train ourselves to think about '='.)

I'm a big fan of immutability and using constantly so I agree with your tutor.