2 ms·
When you're as jaded as I am, names like customerList don't indicate anything. That could be a list of customers, or a list from the customer, or a list that us
by toast0 8y ago
When you're as jaded as I am, names like customerList don't indicate anything. That could be a list of customers, or a list from the customer, or a list that used to have customers and now has god knows what. But if you gave all your variables really long names, now everything either scrolls off the side of the screen or takes multiple lines and I can't see anything.
- kstenerud 8y agoThis is code rot, which is a different problem. But even code rot can be mitigated somewhat with this discipline. Which of these changes is easier to justify: countCustomers(list) incrementCustomersScore(list, n) // where "list" is to change type from "list of customers" to "list of sales domains" VS countCustomers(customers) modifyCustomersScores(customers, scoreDelta) // where "customers" is to change type from "list of customers" to "list of sales domains" Code is a map to what the computer is supposed to do. Making things familiar and easily navigated just makes sense. Good code requires good U/X, just like good websites require good U/X. It's just something you do to make your users have a better time using your stuff.
- bunderbunder 8y agoI don't even necessarily trust type names anymore, for similar reasons.