Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SabreMan

What's wrong with C++ templates?

This topic is 5617 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

From kuro5hin.org, What''s wrong with C++ templates.
quote:
...just because templates are the best C++ has to offer doesn''t mean they''re good. It turns out that all the problems templates solve were already solved better, before templates were ever introduced, by other languages. In fact, the kludgey way templates work precludes C++ programmers from a lot of the good stuff that nicer solutions have.

Share this post


Link to post
Share on other sites
Advertisement
Please, do not start next topic like this. Better use search button, and keyword is "template"

Share this post


Link to post
Share on other sites
quote:
Original post by Estor
Please, do not start next topic like this.

Like what?
quote:

Better use search button, and keyword is "template"

And what use will that be for sharing an interesting article with the rest of the community?

Share this post


Link to post
Share on other sites
I don''t see anything on the search results that looks like SabreMan''s (very interesting) link...

Anyway, didn''t we know all along that Lisp is far superior?

Share this post


Link to post
Share on other sites
Is this going to be a discussion of why you should use a different
language if you want to do the kind of things c++ templates are
trying to do?

Or is it going to be a discussion of how templates are designed in
c++ and could have been designed better, querying the reasons why
the standards committee agreed to specify them as they are?

Or is it going to be a discussion of how generics, such as are in
Python or Lisp, are simply too far removed from a static,
non-introspective language like c++ to be feasible.

Or is it going to be a discussion of how to best use templates in
C++ and the situations where it would be advisible to switch to
another language? After all they're far from useless.

Or is it going to be a slanging match?

Or something else?

It's up to you!

[edited by - petewood on June 3, 2003 8:57:16 AM]

Share this post


Link to post
Share on other sites
ohhh... forget it, my mistake
CU


[edited by - Estor on June 3, 2003 9:06:34 AM]

Share this post


Link to post
Share on other sites
I don''t consider that article a "what''s wrong with templates" article. It''s more of a "history of generic and compile-time programming" article.

Either way, if you want to complain about C++ templates, then I guess you can go write your games in Lisp...

Share this post


Link to post
Share on other sites
quote:
Original post by fizban75
Either way, if you want to complain about C++ templates, then I guess you can go write your games in Lisp...


How boring this place would be with no room for discussion!

Share this post


Link to post
Share on other sites
quote:
Original post by fizban75
I don''t consider that article a "what''s wrong with templates" article. It''s more of a "history of generic and compile-time programming" article.

Do you understand the statement `templates are really just a C++ version of Lisp macros geared towards generating type declarations rather than extending C++''s syntax''?
quote:

Either way, if you want to complain about C++ templates, then I guess you can go write your games in Lisp...

You could do that. Or you could just stick your head in the sand and never try to find better ways of doing things.

Share this post


Link to post
Share on other sites
quote:
Original post by SabreMan
Do you understand the statement `templates are really just a C++ version of Lisp macros geared towards generating type declarations rather than extending C++''s syntax''?


Like I said, this doesn''t say what''s wrong with C++ templates or that they don''t do what they were meant to do. It just says that they are similar to something that has been done in another language. I didn''t seen anything in that article that shows that C++ templates are "wrong" but just that they do things in a different way than what''s been done in other languages. Every language is different, each with it''s own costs and benefits and you should just choose the best tool for your job.

quote:
You could do that. Or you could just stick your head in the sand and never try to find better ways of doing things.


Wow, what an enlightened discussion we''re having. Such an adversarial tone, tsk, tsk. How old are you? Ten?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!