Re: The least used keywords in C++, which do you use?
On 18 Sep, 10:09, James Kanze <james.ka...@gmail.com> wrote:
Unless you're doing very low level programming, reinterpret_cast probably remains unused as
well.
Or using a C interface that normally involves a strange cast, eg dlsym
which returns void * as a pointer to anything, even a function, or
"pointer to pointer" which is seen as a different level of indirection
by static_cast even though it really is a pointer to something.
And of course, I've never used continue or goto, in over 25
years of C/C++. And when I encounter it in code I have to work
on, I simply throw the code out and start over.
I have never used goto but continue isn't really evil, any more than
break is. Yes you can put in a block to the end of the loop that is
not called but continue is simpler. I would say that not using
continue is a style issue only. I also sometimes return from the
middle of functions. Maybe you consider that evil too.
Having said that I couldn't find an instance of "continue" used in my
own code.
I don't use the operators ('and', 'or', etc.) mostly because
those are less readable than symbols ('&&', '||'), and
readability is one of the cornerstones of maintainability of
the code when a larger team is concerned.
There is no logical xor as far as I'm aware, so why isn't the function
called bit_xor which shows which group it belongs in.
In logical terms, logical_xor( 1, 2 ) = false (they are both non-zero)
while logical_and( 1, 2 ) = true (same reason). In bitwise terms
bitwise_xor( 1, 2 ) = 3 while bitwise_and( 1, 2 ) = 0
If without the prefixes, and and or mean the logical variety then xor
should mean the same.