|
|
|
|
|
by reikonomusha
2289 days ago
|
|
Code can be studied, reasoned about, interpreted with some semantics, and often even turned into some manner of equations. Heck, Standard ML is even defined by a bunch of equations. But very rarely is code written for the same reason a mathematical expression is written. I agree code can be as you say, but most often isn't. Code, at the end of the day, more often than not, is written to express some logic to be executed by a computer. At least 80%, if not more than 98%, of code is written to express imperative commands to a machine. I say this as a fan of abstraction, Lisp, Prolog, etc. I just don't buy that s = 0
for x in a:
s += x
return s
is interpreted with the same generality and depth as s := \sum_{x\in a} x,
the latter of which is seen in and of itself more as an "object" which may or may not be used to represent a computation that the code above indicates. |
|