Hacker News new | ask | show | jobs
by benas 2256 days ago
Writing code is different from writing mathematical equations. Developers (humans) prefer meaningful variable names, method names, expressions, etc. Comparing this to maths where conciseness is key is not the best analogy IMO. And it is not about experience (btw, I have no problem being one of these newbies who "need to learn those before they can understand what is being said "naturally""), it is really about expressiveness to reduce the mental effort to match things (what I have in mind and what I see in code). That's why there are many attempts [1] to create programming languages that are as close as possible to people's natural languages.

[1]: https://en.wikipedia.org/wiki/Non-English-based_programming_...

2 comments

My team has been hiring and training coop students for years, and it takes on average a week or two for students to become productive with Clojure. Furthermore, students with less programming experience actually have an easier time picking it up. So, I completely reject the argument that Clojure syntax is somehow less natural, it's simply different from syntax people are used to. Most people who doesn't have an existing bias pick it without any problems.
Developers (humans) prefer meaningful variable names, method names, expressions, etc.

Well, isn't that part of the premise we're debating?

Mathematical papers and books tend to have the advantages of dealing with only a handful of concepts at any given time, and of presenting their mathematical content in relatively small doses, both of which allow concise notation to remain both unambiguous and accessible enough to be useful. Anything other than the smallest programs probably do not enjoy the same advantages, so it makes sense that programmers tend to use longer names for entities that are relevant over a larger area. However, this argument still allows for short names to be used in programs as long as the scope is also small, and it says nothing at all about the relevance of natural language for representing programming language constructs.

We have some experience with programming languages that do try to read very much as natural human language. COBOL is probably the most famous example, and in that language even basic mathematical concepts like comparisons can be written out in words. We don't write much COBOL today, and it's hard to believe that the verbosity isn't a contributing factor in that.

No, you are deviating from the main point: natural expressiveness. So let me back up: If you think "if (= x 1)" is natural to humans, then try to ask someone in the street "is equals this that?" and let me know about their reaction. My point is that the natural way of asking such questions is:

  * "Is this equals to that?" and not "is equals this that?"
  * "Is this bigger than that?" and not "is bigger this that?"
And this is regardless of the language (be it English or whatever, see https://news.ycombinator.com/item?id=22811168). I'm not going to debate this to death, so feel free to disagree. Again, I have nothing against Clojure, I'm just trying to argue in a constructive way.