4 ms·
> Language designers often make vague arguments about the “simplicity” or “intuitiveness” of language features, without ever saying what they mean by these term
by pmontra 9y ago
> Language designers often make vague arguments about the “simplicity” or “intuitiveness” of language features, without ever saying what they mean by these terms, or testing whether these claims are true.
Anecdotally the designer of Ruby, if in doubt, asked his little daughter what looked simpler / easier to understand.
The post skimmed by the issue of polyglot programmers. I used to work with C, Java and Perl, now with Ruby, Python, Elixir, JavaScript. There is also PHP, which I made some money with but I never really cared much about.
What happens when working with so many languages in maybe as many different projects is that the amount of context switches increases. It's like going back to a project after six months but it happens the next week. This makes it easier to spot both the weaknesses in my code (why did I call that variable so?) and the weaknesses in the programming languages (why did they do that when everybody else is doing that other thing which is so better?)
I could give examples and make everybody angry because every language has its share of problems :-)
A side effect is that I tend to write simpler and dumber code, because I have to understand it when I come back. The clever features of languages are tempting but I use them only for those special cases when everything else wouldn't do. There are (un)surprisingly very few of them.
- zzzcpan 9y ago> because I have to understand it when I come back The hard part is understanding why the code does what it does. Which is why documenting the reasoning behind the choices is much more valuable than the code itself. Why did you choose that particular algorithm and why do you use this particular convention for naming things, etc. Documenting conventions is also important, they are not obvious and let you keep consistency of the code next time you touch it, so you don't introduce time wasting edge cases that require learning and dealing with useless things.
- pmontra 9y agoI document those reasonings in wikis (example: on github) or Markdown files checked in to the repository. For normal stuff choosing the right names is enough. Example: number_of_customers leaves very little doubts, customers could be many different things. Autocompletions in editors helps because it doesn't increase the number of typed characters.