Re: On/offtopic here (was Re: 64 bit C++ and OS defined types)
* Juha Nieminen:
Jorgen Grahn wrote:
Yes. If we cannot talk about such things here, where should we do it?
I am here to become a better C++ programmer and having more fun while
doing it, by hearing what other people do, what they don't do, what
they like and so on.
You won't become any better of a C++ programmer if you discuss whether
you should use the word "get" in getter method names or not any more
than you will if you discuss eg. whether 2 or 4 spaces of indentation is
better or whether you should use camel-case in variable names.
Those types of discussion just aren't useful nor relevant. They are
completely a matter of taste, and your program will not become any
better or worse depending on it (as long as you use a clear style and
you use it consistently).
Things which are not really part of the C++ standard but which *can*
concretely improve your C++ programming are things like "you should
usually avoid allocating things with 'new' if an STL container suffices
equally well for the same task" and such. There are certain programming
practices which will help you write better C++ programs. However,
whether or not you should use "get" in a getter is not such a practice.
It seems you choose to have a very limited view of software engineering.
The idea of referential transparency for getters was and is one fundamental idea
of the Eiffel language. In Eiffel you can freely (by design of the language)
change the representation of a data member from member variable to accessor
function and back, without affecting client code. Now think how easy or not that
is if you have to keep renaming the thing all the time to comply with a silly
requirement to have an utterly redundant prefix or suffix on one form, and think
of whether a main influence of a language like Eiffel can be irrelevant.
Such prefixes that indicate type or implementation aspect are the fundamental
idea of Hungarian notation. It will increase your and others' efficiency if you
stay away from Hungarian notation (which you probably already do). Think about
whether that is irrelevant to C++ programming. Then, but think about it first!,
apply that insight not only to Hungarian notation but also to other
manifestations of same the in modern C++ counter-productive idea, like, for
example, "Get" prefixes. Then, but think about it first!, think also about why
the situation is different in e.g. Java, i.e., why this ties in specifically to
C++ programming.
Cheers & hth.,
- Alf (unfortunately, can only show rough map of terrain, you have to walk it)
--
Due to hosting requirements I need visits to <url: http://alfps.izfree.com/>.
No ads, and there is some C++ stuff! :-) Just going there is good. Linking
to it is even better! Thanks in advance!