logoalt Hacker News

ulrikrasmussentoday at 5:40 AM2 repliesview on HN

A corollary of this statement is that code without a spec is not code. No /s, I think that is true - code without a spec certainly does something, but it is, by the absence of a detailed spec, undefined behavior.


Replies

retsibsitoday at 7:54 AM

No way! Code is whatever defines the behavior of the program unambiguously, or as close to unambiguously as makes little difference. A sufficiently detailed spec does that, and hence it is effectively higher level code. Code (together with the language spec and/or compiler) always does that, regardless of how haphazardly written it is.

lmmtoday at 5:59 AM

On the contrary, code is a spec. In a decent language it should look like one.

show 1 reply