Search code examples
programming-languagescomputer-sciencelanguage-designhuman-readable

How to measure the "understandability" of a language?


I have often read that some programming languages are clear than others and I asked myself several times if there is an objective way to measure the clarity of a language in order to design, given an abstract syntax, a concrete syntax as clear and human friendly as possible. Perhaps exist some kind of designs patterns for that purpose?

In short: How can be achieved the maximum clarity of a syntax? Know any way to quantify the "clarity" or "expressiveness" of a language?

Makes sense to try to measure these aspects?

Thanks.


Solution

  • I have heard this phrase too many times carelessly thrown at different languages, and different people will choose different languages based on different criteria.

    In Beautiful Code, Yukihiro Matsumoto (Ruby's designer) makes an argument about how much simpler it is to write a Hello World program in Ruby than in Java. Although I don't think this example is meant to scale, the author's point is that the amount of cruft you have to add on to your code reflects the deficulty in understanding a program written in a that language. That is, the less distraction you get, the more "readable" the program is.

    Now, in my experience, good programmers write clear code in all languages they program in, though even more clearly in languages they are more familiar with. The author's talent as well as the breadth of his experience in that lenguage end up dwarfing the language itself's clarity or expressiveness.

    Another point to consider is the amount of available libraries and the quality of the APIs. If you have to write less "support code" to get the job done, then it's likely the resulting program is clearer because it appears more straight to the point.