(no title)
peterkelly | 3 months ago
On the foolishness of "natural language programming". https://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD667...
peterkelly | 3 months ago
On the foolishness of "natural language programming". https://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD667...
dilawar|3 months ago
Apparently Dijesktra loved using em-dash!
beezlewax|3 months ago
sfn42|3 months ago
And its just so obviously correct.
bazoom42|3 months ago
Atlas667|3 months ago
cubefox|3 months ago
Example:
- "&&" rather than "and",
- "||" rather than "or",
- "if (A) B" rather than "if A then B"
This only makes the code harder to read for beginners without apparent benefit. I'm not sure whether Dijkstra would have agreed.
Thankfully though, programming languages already use mostly explicit (English) language in function names. Which is a much better situation than in mathematics, where almost every function or operator is described by a single nondescript letter or symbol, often even in Greek or in a weird font style.
There is a tradeoff between conciseness and readability. Mathematics has decided long ago to exclusivly focus on the former, and I'm glad this didn't happen with programming. If we read Dijkstra as arguing that only focusing on readability (i.e., natural language) is a bad tradeoff, then he is right.
pm215|3 months ago
Personally I think one advantage of '&&' and '||' is that it's clear they're a notation that you need to know the syntax and semantics of. For instance typically '&&' is "short-circuiting" and will not evaluate its RHS if the LHS is true; a natural-language "if a and b then ..." doesn't suggest that critical detail or necessarily nudge you to go and check. (Not that Dijkstra was in favour of short-circuiting logical operators, to judge by https://www.cs.utexas.edu/~EWD/transcriptions/EWD10xx/EWD100... point 4...)
More generally, I'm not sure of the benefit of tailoring the language syntax for beginners rather than experienced practitioners; the advantage of '&&', '||' and the rest of the "C-like" syntax stuff in a new language is that it's familiar to a wide base of existing experienced programmers.
SirHumphrey|3 months ago
dragonwriter|3 months ago
renox|3 months ago
mkoubaa|3 months ago
f1shy|3 months ago
adamddev1|3 months ago
This hits so hard. cough dynamic typing enthusiasts and vibe coders cough
noosphr|3 months ago
https://www.cs.utexas.edu/~EWD/transcriptions/EWD12xx/EWD124...
oivey|3 months ago
bazoom42|3 months ago