News for hackers. Stuff that matters.
Re:To the brain, reading computer code is not the same as re... by pgt on Wednesday December 16, 2020 @01:02AM (#25439576)
Your comment is insightful and suggests that perhaps we should try to design a programming language that feels more like a natural language.
Re:To the brain, reading computer code is not the same as re... by creata on Wednesday December 16, 2020 @01:05AM (#25439593)
Or 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.
Re:To the brain, reading computer code is not the same as re... by ZephyrBlu on Wednesday December 16, 2020 @01:04AM (#25439586)
I 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.
Re:To the brain, reading computer code is not the same as re... by infogulch on Wednesday December 16, 2020 @03:45AM (#25440354)
And also harder for a computer to interpret and execute a natural language.
Re:To the brain, reading computer code is not the same as re... by tremon on Wednesday December 16, 2020 @04:52AM (#25440732)
No, 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.

Re:To the brain, reading computer code is not the same as re... by datameta on Wednesday December 16, 2020 @12:32PM (#25445435)
This 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.
Re:To the brain, reading computer code is not the same as re... by astrange on Wednesday December 16, 2020 @07:24AM (#25441726)
This 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.

Re:To the brain, reading computer code is not the same as re... by DonaldFisk on Wednesday December 16, 2020 @04:15AM (#25440503)
Like 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).

Re:To the brain, reading computer code is not the same as re... by goto11 on Wednesday December 16, 2020 @04:11AM (#25440476)
This 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.
Re:To the brain, reading computer code is not the same as re... by Ma8ee on Wednesday December 16, 2020 @04:17AM (#25440510)
They tried that with COBOL and to a certain degree SQL. We would probably do a better job today, but the idea isn’t new.