3 ms·
This may seem obvious, but some people just don't get it, and it can be easily taught: I like to purposefully and consistently use "big-endian" names for assets
by DonHopkins 11y ago
This may seem obvious, but some people just don't get it, and it can be easily taught: I like to purposefully and consistently use "big-endian" names for assets, classes, functions, variables, events, files, directory structures, etc.
The desired result is that related names are convenient grouped together in an alphabetical sort.
A rule of thumb is: the most important part is at the beginning, and most specific part is at the end.
But what is convenient, important or specific is context sensitive and debatable, since there are many ways to name the same thing in different kinds of hierarchies.
Sometimes it's ambiguous what's most important, like when you're classifying things along two or more dimensions, like x y and time.
Should it be (MouseXCurrent, MouseXLast, MouseYCurrent, MouseYLast) or (MouseCurrentX, MouseCurrentY, MouseLastX, MouseLastY)?
In that case I'd put the most tightly bound dimension last (x and y, which are usually used together as a 2d vector, so keep them adjacent).