3 ms·
1. All entities named in a way that describes their purpose as precisely as possible. Prerequisite: a design that carves the problem into concepts clear enough
by andywood 15y ago
1. All entities named in a way that describes their purpose as precisely as possible. Prerequisite: a design that carves the problem into concepts clear enough to permit precise naming.
2. Well-factored at all levels.
- buro9 15y agoAgree on the naming, though it always brings to mind Tim Bray's quote: "There are only two hard things in Computer Science: cache invalidation and naming things"
- Pewpewarrows 15y agoI thought the quote went: "There are only two hard things in Computer Science: cache invalidation, naming things, and off-by-one errors."
- joe_the_user 15y agoNot "as precisely as possible" but "as precisely as necessary". For example, "i" is great name for a loop variable. It keeps it from distracting you and it saves space so you can see more of the variables whose names matter.
- eru 15y agoYes. Though I like languages that help me to eliminate meaningless identifiers. Compare the number of identifiers in sum :: [Integer] -> Integer sum = foldr (+) 0 to int sum (int size, int* array) { int res; for (int i = 0, res = 0; i++; i<size) res += array[i]; return res; } (Those are not exactly the same function, but I hope you can see them as idiomatic expressions of the same idea.)