Sujet : Re: The joy of FORTRAN
De : Pancho.Jones (at) *nospam* protonmail.com (Pancho)
Groupes : alt.folklore.computers comp.os.linux.miscDate : 06. Mar 2025, 00:42:53
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqanht$2l4q6$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
On 3/3/25 00:16, Dan Cross wrote:
John Ousterhout recently published the contents of a written
"debate" he had with Robert C Martin that went into this at some
length. With the caveat that I think Martin is a charlatan,
folks here might find it interesting and relevant.
>
I'm not sure how old you are, but I get the feeling Robert C Martin is writing for young people. I only became aware of him when my son was given his book as part of his required reading for his first job.
I was quite impressed. Martin seemed to me to be giving reasonable practical advice. How to decompose problems into code is something new programmers seem to find difficult. It is something not taught well at university.
https://github.com/johnousterhout/aposd-vs-clean-code/blob/main/README.md
The problem with the prime generator examples is not the comments, naming or decomposition into smaller functions, although I prefer the single function version. No, the problem is they do not explain what the algorithm is, relating it to the well-known Sieve of Eratosthenes and the Fundamental theorem of Arithmetic. Once you understand it is very similar to the Sieve of Eratosthenes, with a memory saving adaption, it is easy to understand the code. It is not easy to understand the algorithm from the code. If it was my code, I would preface it with a block English language comment overview of the algorithm.
So much of understanding complex code is conceptually mapping new code to well understood patterns or algorithms.