You are a stupid programmer, you can't have that
H. S. Teoh
hsteoh at quickfur.ath.cx
Tue Aug 10 19:06:15 UTC 2021
On Tue, Aug 10, 2021 at 11:29:35AM -0700, Walter Bright via Digitalmars-d wrote:
[...]
> A friend mine (a very smart one) back in college one day decided to
> learn programming. He got the Fortran specification(!), read it, and
> wrote a program.
Hey, what better way to learn a language than to get to the very
definition of it? ;-)
> The program ran correctly, but incredibly slowly. Baffled, he took it
> to his programmer friend for help. The friend laughed, and said here's
> the problem: you're writing to a file in a loop:
>
> loop
> open the file
> append a character
> close the file
>
> instead of:
>
> open the file
> loop
> append character
> close the file
>
> My friend said he followed the spec, which said nothing at all about
> how file I/O actually worked.
:-D
What the spec *doesn't* say is often just as important as, if not more
important than, what it does say. :-)
Reminds me of learning a foreign language by reading a dictionary... you
can learn all the words, and even consult a book on grammar, but will it
survive the first encounter with a native speaker? ;-) True story: one
time, I found a particular foreign word from a dictionary, and thought
that was how you referred to a particular thing. So I used that word
with a native speaker. He stared at me for a moment with this strange
look of incomprehension, and then suddenly comprehension gleamed in his
eyes, and with a smile he explained that this was an archaic word that
is no longer in widespread use, and that people these days use a
different word for the same thing. He further added that if I were to
use that word with somebody younger than him, they probably wouldn't
even understand what it meant.
Such is the peril of learning a language by spec without understanding
the context in which it operates. :-)
T
--
Almost all proofs have bugs, but almost all theorems are true. -- Paul Pedersen
More information about the Digitalmars-d
mailing list