Do C++ Programmers Overuse Templates?

T

tonytech08

Then their peers should either restrain them or learn form them.

I once had a member of my staff complain about me using "arcane C++
constructs" so I asked the team whether they wanted to stick with their
current knowledge, or grow it.  No one ever make that criticism again.

Perhaps they wanted to create and invent better things instead of just
using existing things? How much "growth" is attainable by just being
followers? The There are some good ideas there in the C++ way, and
they deserve consideration. C++ mechanisms aren't the only way nor not
necessarily the best way though.
 
I

Ian Collins

tonytech08 said:
Perhaps they wanted to create and invent better things instead of just
using existing things? How much "growth" is attainable by just being
followers? The There are some good ideas there in the C++ way, and
they deserve consideration. C++ mechanisms aren't the only way nor not
necessarily the best way though.

They are when the job at hand is a C++ project. With a little
encouragement, the followers soon became leaders.
 
M

Matthias Buelow

Per said:
But thats why there is lead-programmers and
new-programmers. And thats why their salaries differ. If the
new-programmer is observant and willing to learn from a professional
lead-programmer he will soon be better than most of his peers and
score some high paying job.

Hehe.. do you have a programming job or are you a full-time academician?
Never expanding his horizons.

Some constructs are just drudgery; your horizon won't really expand if
you smack stones with little copper hammers all day long. You might get
paid for it, though.
 
G

Guest

There is a subset of instructions that are similar between certain
processors (not RISC to CISC surely, but between, say, CISC processors
from different manufactures: someone's X86 CPU and some else's "Y"
CPU).

I disagree. There are huge differences between different
machine architectures.

Given that, C++ has a lot of C++-only constructs that don't/won't map
onto another language, especially if a developer uses the kind of
things that are kind-of side effects of the major mechanisms.



Yes, the other way: C++ moves away from "all languages are just about
the same, only the syntax is a little different" (a "for" loop in one
language is like a "for" loop in another, for example).

FOR i := 1 STEP 1 UNTIL 4,
6 STEP 2 UNTIL 10,
15 STEP 5 UNTIL 30
DO Statement

FOR i := 1, 2, 4, 7, 15 DO Statement

most languages have some unique property. Otherwise
there wouldn't be much point in inventing them.

<snip>
 
N

Noah Roberts

Per said:
I think the approach to this problem would be to require higher
standards from programmers. Seeing that they actually spent some time
reading the more advanced literature there is for the language. Not
just being able to program after reading a "teach yourself X in 21
days" book.

Good luck on that one. Colleges don't get into the advanced, or in many
cases even the intermediate stuff. People just don't seem interested in
instructing themselves on these things either. I pushed pretty hard to
get reading and instruction material at my workplace. I'm the only one
who reads the stuff. The only exception is when someone needs to know
something and I just refer them to the book that would help them.

Not saying I agree with your opposition on this, because I truly don't.
Just sayin'...I've come to stop expecting too much.
 
N

Noah Roberts

Matthias said:

I'm not and I agree with him...except for the part about advanced
programmers making more money (which is what gave him away).

To tell the truth, templates are NOT hard. Template metaprogramming is
NOT hard. It's different, true, but it is not hard. Once the basics
are understood it becomes fairly clear. The only difficulty is
debugging, which IS a problem but is something that is being worked
on...there are steps one can take.

The new language constructs will, I hope, make many of these things much
simpler. For instance, the trickery involved in the coding of such
constructs as boost::bind should be at least partially eliminated (from
what I understand from talking to people about it). This would be a
great benefit when trying to debug programs that use it.

At any rate, inability to understand templates seems to be constructed
upon baseless fears and laziness. There's nothing extraordinarily
difficult about them.
 
N

Noah Roberts

tonytech08 said:
Indeed! And also decide which (if any) of those advanced "techniques"/
mechanisms to use.


Surely you jest. Conceptually, the concept of "container" is easy to
grok. Wrap that simple concept in obfuscated STL and it's another
matter entirely. Not "plain" by any stretch of the imagination.
Simple? Perhaps relative to "advanced template techniques and
mechanisms" (sounds like a book title (that I would rename: "how not
to use templates"?).

I see what's going on now. You don't understand the concepts behind the
STL and thus can't appreciate them. Here's a term to research:

Generic Programming

Look for the paper by Musser and Stepanov and go from there.
 
T

tonytech08

And that is, IMHO, one of the keys.  

State that "key" please.
Difficult to write is
relative,

"relative" to what? You?
of course, and for simple containers, they're a lot
simpler than the alternatives.

"alternaives"? What are the alternatives? Dynamic typing?
 But not every C++ programmer (or
even not most) needs to understand all of the details of
template meta-programming.

I would boldly say: no one should be a C++ programmer (in the long
derm) (my node has been compromised and I can't type t's??).
 
T

tonytech08

I disagree. There are huge differences between different
machine architectures.

I think you are teaching me "red herring" (?: english is a remote
language). I _believe_ those assembly language people (I don't "know"
assembly) who tell me that they know a common subset of instructions.
You, OTOH, are offering the differences between architectures in
arguement to the commonality. Either VERY STRANGE or propaganda.
 
I

Ian Collins

tonytech08 said:
On Dec 11, 8:55 am, (e-mail address removed) wrote:

I think you are teaching me "red herring" (?: english is a remote
language). I _believe_ those assembly language people (I don't "know"
assembly) who tell me that they know a common subset of instructions.
You, OTOH, are offering the differences between architectures in
arguement to the commonality. Either VERY STRANGE or propaganda.

Those "assembly language people" are telling your porkies. Such a
subset would be very small. "jmp" springs to mind.
 
T

tonytech08

Those "assembly language people" are telling your porkies.  Such a
subset would be very small.  "jmp" springs to mind.

Apparently there is an impasse between "us". Good luck with your push
of complexity. :p
 
T

tonytech08

I see what's going on now.  You don't understand the concepts behind the
STL and thus can't appreciate them.  Here's a term to research:

Generic Programming

Look for the paper by Musser and Stepanov and go from there.- Hide quoted text -

I'm hoping (?) that stays (for you wannabes). Good luck with that.
 
I

Ian Collins

tonytech08 said:
Apparently there is an impasse between "us". Good luck with your push
of complexity. :p
I was an assembly language programmer long before C++ escaped into the
wild, so I know a thing or two about complexity and I'm happy to leave
it in the past.
 
J

James Kanze

Would dynamic-typing (just for generics, is that possible?)
been a "better" solution?

In what way? Early C++ libraries (NIHCL) tried it, and found
that it didn't work. Java tried it, and found that it didn't
work.
 
J

James Kanze

C++ is a tool, comprised of various, more specific tools.
"Judicious," in the way you seem to be using it, means "you
can't use it unless I understand it." That's bureaucratic
nonsense.

Judicious, in the way he seems to be using it, means "I'm too
stupid or too lazy to try to understand how it works".
Certainly, some people do overuse templates, but it's far from
universal. There's also the question: what is overuse?

Of course, with the usual meaning of the word "judicious" in
English, his statement is trivially true. Everything should be
used "judiciously" (i.e. with good judgement).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top