Live data from Hacker News

Dijkstra On the foolishness of "natural language programming"

cs.utexas.edu

211–220 of 281 posts

Re: Dijkstra On the foolishness of "natural language programming"

#211

Earlier quoted context omitted.

Are you saying it's impossible to program without first formulating a natural language sentence? That sounds dubious at the very least.

That's a really deep question. Obviously there are types of creativity that don't require words, like painting or sculpting, or improvising music, but I'm having real difficulty imagining programming without something at least resembling natural language. The closest my imagination gets is Scratch/Blockly, but even then you're essentially creating an AST composed out of statements and expressions, even if they're pic…

I think you're the kind of person who has an internal voice talking in their head, and can't imagine any other kind of thought?

Math is all about abstract shapes and properties, for me. So is much of programming.

Re: Dijkstra On the foolishness of "natural language programming"

#212
Djikstra's clarity of expression and thoguht is indeed impressive. One nuance : he seems to completely equate ease of language with ability to do undetectable mistakes. I disagree: I know people whose language is extremely efficient at producing analogies that can shortcut for the listener many pages of painful mathematical proofs: for instance, convenu the emergence of complexity for many simple processes by a "swarming"

Re: Dijkstra On the foolishness of "natural language programming"

#213
post #116

Earlier quoted context omitted.

Reading up on the history of mathematics really makes that clear as shown in https://www.goodreads.com/book/show/1098132.Thomas_Harriot_s... (ob. discl., I did the typesetting for that) It shows at least one lengthy and quite wordy example of how an equation would have been stated, then contrasts it in the "new" symbolic representation (this was one of the first major works to make use of Robert Recorde's development…

Although if you look at most maths textbooks or papers there's a fair bit of English waffle per equation. I guess both have their place.

Yes, plain language text to support and translate symbology to concepts facilitates initial comprehension. It's like two ends of a connection negotiating protocols: once agreed upon, communication proceeds using only symbols.

Re: Dijkstra On the foolishness of "natural language programming"

#214
I love reading literate-programming software! The problem is that very few programmers are as skilled at writing clearly as are Knuth and Dijkstra. I think I read somewhere that book publishers receive thousands of manuscripts for each one they publish. Likewise, few programmers can write prose worth reading.

Re: Dijkstra On the foolishness of "natural language programming"

#215
post #27

Dijkstra also advocated for proving the correctness of imperative code using the composition of a set of simple rules, and most programmers ignore that aspect of his work too.

Any specific paper or article of his you would recommend?

_A Discipline of Programming_

Re: Dijkstra On the foolishness of "natural language programming"

#216
post #116

Earlier quoted context omitted.

Although if you look at most maths textbooks or papers there's a fair bit of English waffle per equation. I guess both have their place.

As somebody that occasionally studies pure math books those can be very, very light on regular English.

That makes them much easier to read though, its so hard to find a specific statement in English compared to math notation since its easier to find a specific symbol than a specific word.

Re: Dijkstra On the foolishness of "natural language programming"

#217
post #118
post #45

Earlier quoted context omitted.

> Do you find the resulting natural language description is easier to reason about? An example from an different field - aviation weather forecasts and notices are published in a strongly abbreviated and codified form. For example, the weather at Sydney Australia now is: METAR YSSY 031000Z 08005KT CAVOK 22/13 Q1012 RMK RF00.0/000.0 It's almost universal that new pilots ask "why isn't this in words?". And, indeed, mos…

> prefer the coded format. Is is compact... On the other hand "a folder that syncs files between devices and a server" is probably a lot more compact than the code behind Dropbox. I guess you can have both in parallel - prompts and code.

What do you mean by "sync"? What happens with conflicts, does the most recent version always win? What is "recent" when clock skew, dst changes, or just flat out incorrect clocks exist? Do you want to track changes to be able to go back to previous versions? At what level of granularity?

Re: Dijkstra On the foolishness of "natural language programming"

#218

Djikstra's clarity of expression and thoguht is indeed impressive. One nuance : he seems to completely equate ease of language with ability to do undetectable mistakes. I disagree: I know people whose language is extremely efficient at producing analogies that can shortcut for the listener many pages of painful mathematical proofs: for instance, convenu the emergence of complexity for many simple processes by a "swar…

  > he seems to completely equate ease of language with ability to do undetectable mistakes.
I do not believe this is his argument. He was making the point that there is a balance. You need to consider the context of the times, and remember that in this context a language like C is considered "high-level", not a language like Python. He later moves on to discuss formalism through mathematics (referencing Vieta, Descartes, Leibniz, and Boole), in how this symbolism is difficult to perform and many are adverse to it, but that through its birth we've been able to reap a lot of rewards. He precisely makes the claim that were we not to move to formal methods and instead maintain everyday language, we would still be stuck at the level of the Greeks.

Actually in one season of An Opinionated History of Mathematics, the host (a mathematician) specifically discusses the transition in the Greeks and highlights how many flaws there were in this system. How the slow move to mathematical formalism actually enabled correctness.

The point is that human language is much more vague. It has to be this way. But the formalism in symbolics (i.e. math) would similarly make a terrible language for computing. The benefit of the symbolic approach is the extreme precision, but it also means the language is extremely verbose. While in human languages we trade precision for speed and flexibility. To communicate what I have with a mathematical language would require several pages of text. Like he says, by approaching human language this shifts more responsibility to the machine.

Re: Dijkstra On the foolishness of "natural language programming"

#219
post #116

Earlier quoted context omitted.

Reading up on the history of mathematics really makes that clear as shown in https://www.goodreads.com/book/show/1098132.Thomas_Harriot_s... (ob. discl., I did the typesetting for that) It shows at least one lengthy and quite wordy example of how an equation would have been stated, then contrasts it in the "new" symbolic representation (this was one of the first major works to make use of Robert Recorde's development…

Although if you look at most maths textbooks or papers there's a fair bit of English waffle per equation. I guess both have their place.

Textbooks aren't just communicating theorems and proofs (which are often just written in formal symbolic language), but also the language required to teach these concepts, why these are important, how these could be used and sometimes even the story behind the discovery of fields.

So this is far from an accurate comparison.

Re: Dijkstra On the foolishness of "natural language programming"

#220
post #116

Earlier quoted context omitted.

Although if you look at most maths textbooks or papers there's a fair bit of English waffle per equation. I guess both have their place.

Textbooks aren't just communicating theorems and proofs (which are often just written in formal symbolic language), but also the language required to teach these concepts, why these are important, how these could be used and sometimes even the story behind the discovery of fields. So this is far from an accurate comparison.

Theorems and proofs are almost never written in formal symbolic language.
Post reply on HN