Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"To believe that “plain language” programming would be more readable is Utopian, even intellectually dishonest. For if I say, “a linear function of a variable is equal to the sum of a constant and of the product of a variable and a second constant”, it is incontestably English but completely obscure, even incomprehensible!"

This is absolutely true. People try to make a big deal out of natural language for both programming and simply interacting with computers. Rarely would a natural language description be easier, clearer, or faster than a more precise interface (e.g. text for programming, mouse/keyboard for interacing with computers).



Of course you wouldn't write it all out like that in any programming language. But instead of writing code like this:

  y = a * x + b
You could write code like this:

  height = slope * run + ground
It may not be helpful to write out simple math using colloquial language, but it can be helpful to future maintainers if your variables have meaningful names. Calling it "a variable" instead of "a" is not useful, but calling it "slope" can be.


If you are talking about math, sure. But then your average person would be unable to articulate much of that anyways, in English or otherwise, while professionals who are trained in this area are willing to invest in artificial languages to express it concisely.

If you are talking about automating every day tasks through "code," then natural language makes perfect sense; the future their is going to be based on increasingly sophisticated dialogue systems in forms like Siri, Now, Cortana.


Depends on the context, no? Natural language works great when you accept that it is far from context free. Consider "how do I get to the nearest store?" Give me that in a programming language where it is functionally better than what a person can provide? Suddenly, you'll find that you have to start adding in all sorts of additional information that is just assumed otherwise.

And, it is not like this is unique to language. Even in math, one often finds a certain lack of precision that is accepted and more cumbersome to work with than without.

Or, mayhap I just misunderstand more than I understand. :) Very likely.

Edit: There is also the issue of a terrible example. If I were to explain a linear function to someone, I would say more that it is a function where the output changes in constant proportion to changes of the input.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: