Timeline for Can something like a Donkey Sentence exist in a programming language?
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 12, 2023 at 6:42 | comment | added | Barmar |
@shawnhcorey Beginner programmers make lots of mistakes, like if a == "foo" or "bar": when it should be if a == "foo" or a == "bar": , because they expect the programming language to be parsed like English. So unless your objective is to design a language that's more English-like (e.g. COBOL) so that beginners are less likely to make mistakes like this, it's not clear how interesting this is.
|
|
Jun 12, 2023 at 19:35 | vote | accept | FlatAssembler | ||
Jun 10, 2023 at 19:25 | comment | added | kaya3 | @shawnhcorey I didn't miss that part. Beginner programmers won't benefit from a debate over whether a particular scoping rule is "like a donkey sentence", any more than they would benefit from a debate over how many angels can dance on the head of a pin. | |
Jun 10, 2023 at 18:33 | comment | added | shawnhcorey | You missed the part about beginner programmers. Humans can easily parse Donkey Sentences. That is why beginners programmers often make this mistake. If a compiler can figure out how to do the same thing, it would be easier to learn programming. | |
Jun 10, 2023 at 14:35 | comment | added | kaya3 | @shawnhcorey Sure, there is value in widening the scope of variables so they can be used in more places, so long as widening the scope makes sense to do so. What I don't see much value in is figuring out whether code which makes use of such wider scopes is really "like a donkey sentence" or not; that's a philosophical point. | |
Jun 10, 2023 at 12:21 | comment | added | shawnhcorey | The value would lie in the fact that most beginner programmers try to use a local variable after it has left its scope. Donkey sentences make sense in real life. Learning that they don't in programming can be difficult. | |
Jun 10, 2023 at 1:12 | history | edited | kaya3 | CC BY-SA 4.0 |
deleted 3 characters in body
|
Jun 9, 2023 at 20:30 | history | edited | kaya3 | CC BY-SA 4.0 |
deleted 9 characters in body
|
Jun 9, 2023 at 18:08 | history | answered | kaya3 | CC BY-SA 4.0 |