3 ms·
I personally rather like the idea of making type names long but variable names short. Instead of DockableModelessWindow window; I might write Dockab
by kccqzy 7y ago
I personally rather like the idea of making type names long but variable names short.
Instead of
DockableModelessWindow window;
I might write
DockableModelessWindow dmw;
if this is a local variable whose type is nearby. Using acronyms also help people remember its type.
For global variables, though, it would not be appropriate.
- wolfgang42 7y agoIf abbreviating, why 'dmw' and not 'win'? Is the fact that it's dockable and modeless really important enough to use two-thirds of the variable name on a cryptic abbreviation? (And if it is, why not call it by what it is rather than how it's shaped, like 'toolbar' or 'tbar'?)
- clarry 7y agoI agree (at least as far as function/block local variables are concerned), except that I'd probably just name it w. If it's not obvious from context that w stands for window, then the function probably needs to be refactored anyway. That said, dmw is fine if the function needs to deal with more than one type of window.