For mathematicians, = does not mean equality
(I assume this was inspired by <a href="https://news.ycombinator.com/item?id=16803874" rel="nofollow">https://news.ycombinator.com/item?id=16803874</a>)<p>The use of ‘=’ for assignment in programming languages comes, not directly from mathematics, but indirectly from the use of mathematics in science and engineering. As an example, consider the formula for kinetic energy, commonly written<p><pre><code>        𝑚𝑣²
    𝐾 = ───
         2
</code></pre>
Why isn't it written 2<i>K</i>=<i>m</i><i>v</i>², which expresses the same mathematical equality in a smaller, simpler form? Or any of the other equivalent rearrangements? It's because formulas have a convention, where the LHS is a single term naming the value you <i>want</i>, and the RHS contains the terms for values you <i>have</i>. That is, a formula doesn't just state an equality, it states a <i>method for calculating</i> something. That usage predates programming, and was explicitly copied by early programming languages like For[<i>mula</i>]tran[<i>slator</i>] that were designed for scientific & engineering calculations.