Programming languages, imperative ones in particular, place a lot of emphasis on sequence. Take this simple pseuodocode for example:
|
The result of this code is 3, but that same result can very clearly be achieved in a less computationally expensive manner by performing:
|
Correct me if I am wrong, but current day compilers operate on source code that lacks the semantic to perform such an optimization.