3 ms·
Your comment is insightful and suggests that perhaps we should try to design a programming language that feels more like a natural language.
by pgt 6y ago
Your comment is insightful and suggests that perhaps we should try to design a programming language that feels more like a natural language.
- ZephyrBlu 6y agoI don't think making a programming language more like natural language would be helpful. It's much harder to learn a natural language than a programming language.
- infogulch 6y agoAnd also harder for a computer to interpret and execute a natural language.
- creata 6y agoOr perhaps we should accept that programming a computer is more like playing a board game and less like speaking, and optimize languages along those lines.
- goto11 6y agoThis have been tried. Languages like Perl and AppleScript was deliberately designed to feel more like natural languages. It turns out this lead to a worse programming language.
- DonaldFisk 6y agoLike COBOL? Basing a computer language on a subset of English was done for several query languages, ranging from SQL to Attempto Controlled English (https://en.wikipedia.org/wiki/Attempto_Controlled_English https://en.wikipedia.org/wiki/Attempto_Controlled_English).
- Ma8ee 6y agoThey tried that with COBOL and to a certain degree SQL. We would probably do a better job today, but the idea isn’t new.
- tremon 6y agoNo, not at all. Natural language is imprecise, ambiguous and heavily contextual in both its structure and semantic meaning. All those qualities are sources of bugs or undefined behaviour in programming. As others have said in this thread: programming "languages" are not like natural languages for a reason, and conciseness is a big part of that. The two fill a completely different role, and it should be obvious that the brain structures involved are different too. To illustrate that: the only reason people are surprised that programming languages and natural languages are dissimilar is because our natural language is ambiguous: it calls them both "languages" even though they serve entirely different functions.
- astrange 6y agoThis has failed in the past (AppleScript). Another way to do it would be to make the language “vague” in the same way a poorly formed English sentence can still be understood, but I think this would fail too - the most important thing for a tool is to be predictable, not clever. Ruby’s syntax does seem to be informed by Japanese word order, so that’s nice.
- datameta 6y agoThis was attempted using COBOL with a varying degree of success depending on who you ask. I myself have not used it but it seems to me the verbosity would be a major drawback for most tasks. Perhaps one can learn to read it quickly but I believe having shorter yet self documenting names for variables, functions, objects, etc leads to being able to store more in our limited human working memory, which is vital for more complex operations. Code structured more like natural language takes longer to compile, and takes up more disk space. Perhaps these are not such drastic drawbacks for the use cases it was developed.