Now to your response. Does using memcpy() really imply "novice" or "guru"?
No. Nor did I ever say such a thing. What I said was
If you'd have said "Every usage of memcpy() indicates the code was
written by a novice or guru, and there are a hell of lot more
novices
than gurus", I think you'd have had fewer complaints.
Even ignoring the smiley, that does *not* have the same meaning as:
If you'd have said "Every usage of memcpy() indicates the code was
written by a novice or guru, and there are a hell of lot more
novices
than gurus", I think you'd have been right.
Not the same meaning.
memcpy() has still has many uses in C++. But most of its mundane C-
style uses should probably be discouraged in C++ because they are
subsumed by assignment operators. Not banned outright, merely
discouraged. We have operator= and it is (a) typesafe and (b) more
generic. If I memcpy a non-copyable object, bad things happen. If I
assign one, the compiler tells me I've made a mistake. Those places
where memcpy may beat operator= (speed-critical path optimization,
library implementors) are not places where novice programmers should
be working.
At the risk of over-simplfication, there are, in my experience two
thought process that lead to memcpy usage:
(i) I know that my code will never be used on non-POD types so know
that I can memcpy() these objects and I know that assignment won't cut
it here, for reasons of efficiency, or because I'm *defining*
assignment at a very low level, and I know the compiler will not do as
good a job of optimizing this as I can, and this is a code path where
that really matters. This often applies to embedded programmers where
code efficiency (size or speed) may be of major importance. This is
guru-like thinking.
(ii) I remember from a text book that C has a memcpy() function for
copying stuff. C++ is like C, and I want to copy stuff, so I'll use
memcpy(). This is novice-like thinking.
The rest of us know that one of the virtues of C++ is that all that
low level C-style byte twiddling is left to the gurus who implement
the libraries, and we can concentrate on writing clear, expressive,
readable, *type-safe* code and very rarely lose much efficiency. Type
safety is the our friend - it enables the compiler to stop us making
many novice mistakes.