Which programming language is more readable?

3 points by chauhankiran 7 years ago

I am coming from ASP Classic background and I am planning to learn a new programming language. So, I chose PHP. But, things like ->, ::, make me confused. I mean how can I easily pronounced it? In, ASP conditions are like,

if conditions then //Code end if

You see pretty much easy to read and pronounced the code.

So, my question is which language is more readable and also I can switch to it and my consider my future redirection.

dasmoth 7 years ago

If "pronouncability" is a good proxy for readability for you, then Python might not be a bad place to look.

That said, this is intensely personal, and you'll find a fair few people who find symbol-heavy languages more, rather than less, readable.

I'd argue that there's also a trade off where relatively low density code is more readable line by line, but denser code can be quicker to grasp as a whole.

gvisoc 7 years ago

You will always find symbols in programming languages, at least periods (.) that would mean property access (although as you mentioned in PHP is ->) and code delimitators that could be any of the following in most cases ({[]}). This means that in the end you will always have to learn to pronounce a given language.

For languages "as is" I share dasmoth view (upvoted) and I'd add that if you learn to read functional expressions the same as in math's lambda calculus, Scala is very easy to read.

On top of that, if you choose an object oriented language, think not only on the language readability but also on the readability of the patterns that you can build with such language. For example and for further read, the Builder Pattern is much more readable than other patterns like the factory pattern:

FishPlatter myMeal = new BoiledFishBuilder().boilWater().addFish().pourSalt().setTimerInMinutes(6).build();

That is, it's not always the language rather than the way we code.