tonytech08
12/5/2008 9:03:00 AM
On Dec 5, 2:25 am, dertop...@web.de wrote:
> On 4 Dez., 19:36, tonytech08 <tonytec...@gmail.com> wrote:
>
> > C++ templates have grown to be language within a language, at least
> > for some users. Do most programmers overuse templates? Given that C++
> > template techniques, and some of them are quite intricate, can lock in
> > an entire codebase (that is, require a ground-up re-implementation if
> > wanting to use another, perhaps new, language), is extreme template
> > use wrought with peril in the long term view of things? Is a policy
> > that requires "judicious" use of templates the way to go?
>
> That really depends on your project.
OK, you "answered" just the last question.
> I have to admit that even though
> I'm programming C++ for the last ten years, and also had my share of
> template programming (M$ ATL for COM requires some knowledge of
> templates), I'm still a bit cautious when it comes to using template-
> based libraries like boost.
Well that library may be a case in point! (Good work Sherlock!).
>
> I think that templates are the most advanced concept of C++,
That may be another case in point! The concept can be VERY easy. Or
VERY difficult. (Examples of the latter: "partial specialization",
"derived from object "inherits" derived object's behavior").
> and thus
> -- as probably many in this thread will agree to -- it is also one of
> the least understood feature when you consider the majority of C++
> programmers.
"least understood"? How difficult should "genericity" be? (Apparently
I just indicted it. Oh well).
> That's why I'd agree with the term "judicious use"
Are you confusing the concept with the C++ implementation? Cuz even
without the idiosynchracies of the C++ implementation of genericity, I
(let it be now "divulged") think that judicious use (read, requires
explicit coding standard) is appropriate.
> : After
> I introduced too heavy template programming in my current project, I
> lost one of my team members (he is about 50, so he learned programming
> quite a while ago).
Like I suggested: templatism can become a realm all itself.
> That's a bad thing
Did you tell him "C++" and not say more correctly "Template C++" so he
left for not wanting to be part of that DIALECT of C++?
> I see it with a
> bit of concern that many open source projects require template-ridden
> libraries like boost without the least thought that this could turn
> off many programmers
You took the words right out of my mouth with your true-life
experience you noted.
>(which may not be skilled enough to understand
> templates
Ha! But you "get it" now, don't you? It is unnecessary and
undesireable to learn "languages within languages" ad infinitum. It's
not a non-understanding of the idiosynchratic/complex/etc "feature",
but rather a practical decision to not "bite" on it.