3 ms·
>Your fake names are a false choice Yes, they are certainly hyperbolic. But the idea was to make the point that longer is not better. If a variable has a sho
by imanaccount247 12y ago
>Your fake names are a false choice
Yes, they are certainly hyperbolic. But the idea was to make the point that longer is not better. If a variable has a short scope, you do not need to constantly be reminded what it is. If a variable is very general, a very general name is fine. Generally haskellers consider names like 's' and 'x' and 'i' to be very good names. Code is generally optimized for being read by people who know the language, not by people who are unfamiliar with it.
- sanderjd 12y agoYour single-letter-name examples reminded me of some of the articles awhile back about church numerals, which of course used "s" for "successor" and "z" for "zero". One of the comments on one of those articles was somebody who clearly read the whole article without having a good guess at what "s" or "z" were supposed to mean. I found myself wondering what the point of using "s" and "z" instead of "succ" and "zero" could possibly be, besides some sort of mathematical bravado.
- imanaccount247 12y agoBecause they are easier to read, and make the program clearer. Your anecdote is precisely what I was talking about. It doesn't matter if people who have not yet learned the subject don't understand it. It matters that people who have learned it understand it. People who have learned haskell find short variable names make the easiest to read code.