M
Michael Olea
Hiya.
Frequently (as in at least twice now) I find that when I write some sort of
container I want at least two out of three possible versions:
o fixed max size known at compile time
o fixed max size known at run time
o max size is dynamic
The question is how to name the variants consistently. My usual approach is
to give the "generic" name to whichever flavor I write first and then add
modifiers to the other two whenever prodded to build 'em:
template<size_t NStates, typename TState>
class HiddenMarkovModel {...};
and a week later:
template<typename TState>
class RTHiddenMarkovModel { RTHiddenMarkovModel(size_t nStates)...};
and 3 weeks after that:
template<typename TState>
class DynamicHiddenMarkovModel { ... };
OK, truth is I've yet to need to code DynamicHiddenMarkovModel - bad
example. But:
template<typename TCell>
class Stack { Stack(size_t maxStates) ...};
template<size_t NStates, typename TCell>
class FixedStack {...};
template<typename TCell>
class DynamicStack {...};
has come up. Sort of a trivial question, how to name these things to reduce
average client surprise (library name entropy), but I am wondering how
y'all cope with this.
- Michael
Frequently (as in at least twice now) I find that when I write some sort of
container I want at least two out of three possible versions:
o fixed max size known at compile time
o fixed max size known at run time
o max size is dynamic
The question is how to name the variants consistently. My usual approach is
to give the "generic" name to whichever flavor I write first and then add
modifiers to the other two whenever prodded to build 'em:
template<size_t NStates, typename TState>
class HiddenMarkovModel {...};
and a week later:
template<typename TState>
class RTHiddenMarkovModel { RTHiddenMarkovModel(size_t nStates)...};
and 3 weeks after that:
template<typename TState>
class DynamicHiddenMarkovModel { ... };
OK, truth is I've yet to need to code DynamicHiddenMarkovModel - bad
example. But:
template<typename TCell>
class Stack { Stack(size_t maxStates) ...};
template<size_t NStates, typename TCell>
class FixedStack {...};
template<typename TCell>
class DynamicStack {...};
has come up. Sort of a trivial question, how to name these things to reduce
average client surprise (library name entropy), but I am wondering how
y'all cope with this.
- Michael