|
|
|
|
|
by mplanchard
2172 days ago
|
|
How would you approach the naming of this example differently? I have gone back and forth on whether to align with the general convention on single-letter generic type names, but I’ve tended to come back to the single-letter approach any time I try making them more specific. The issue is of course that they are generic, and so naming them too explicitly robs them of some of their “this is any type” genericness. For lifetimes, I will definitely sometimes name them more explicitly than `’a`, but usually only when there’s more than one, as a way of being sure I don’t mix them up. However, the association of lifetimes with references tends to be straightforward enough that it often seems clearer and less messy to just name them with single characters. |
|
We talk a lot about user experience and usability in our end products but we do not extend that thought to our fellow programmers at code level.