Yes, and good libraries choose good names to help as much as possible with this because it takes attention. length
or size
or len
or count
or dim
or dims
orâŚ? Furthermore, autocomplete and âdid you mean Xâ messages are all there to help you out with this task because itâs harder than we want it to be.
In any case, one has little choice but to name things since types are not enough most of the time to figure out what is going to happen. (e.g. (Int, Int) => Int
is rather underspecified).
These are also hard, but the first actually helps with the second because you can use grouping to aid the task. But, anyway, IDEs tell you this stuff incessantly because itâs harder than we want it to be.
In any case, we canât get away from knowing what order to put parameters and which parameters to put, because the set of parameters is often not enough to determine function. (E.g. (Int, Int) => Boolean
might be antisymmetric.)
This is a pain point. a
? x
? element
? Most peopleâespecially newbiesâdo not use named parameters ubiquitously for exactly this reason. Itâs harder than we want it to be.
This is mostly because itâs hard to code so that use-site variance is correct. This is a safety issue, primarily.
Yes, and thatâs a pain point too. next
or next()
? hasNext()
? And we can still elide them or not, as we please, for Java.
I think itâs an open question as to whether this was worth it. The exception for Java is especially questionable.
Again, I am not convinced that this is wise. Again itâs more to remember for dubious benefit. How do you know what I need to get into that argument slot?
Of course! And itâs a lot. Itâs one of the things that makes programming hard. So donât make it gratuitiously harder by adding extra superfluous stuff to remember! We put so much effort into making this easier:
- Types help by catching you if you forget
- IDEs help by offering you the most important info
- Immutable by default means we donât have to worry about which library author thinks itâs cool to mutate internals so we donât even need to think about it
And so on.