[Prog] A good language to learn?
Jimen Ching
jching at flex.com
Tue Jul 29 17:54:01 EST 2003
On Wed, 30 Jul 2003, Kathryn Andersen wrote:
>On Tue, Jul 29, 2003 at 09:59:59AM -1000, Jimen Ching wrote:
>> C++ also supports generic programming. A very powerful technique
>> indeed. Many people overlook this feature of C++.
>
>Are you talking about templates?
Yes.
>Templates can be cool, but only if you have the type of application that
>actually needs them.
Sure. And I assume, by application, you mean any container-like object
that can be made generic...
>Most use of templates, I bet, just occurs with people using the Standard
>Template Library.
If, by this, you mean STL is the most used template library, then of
course. But templates can also be used where you wouldn't expect it to
benefit the object much.
For example, a string class doesn't seem like it would benefit that much
from generic programming, especially since it's just an array of
characters. But std::string uses templates, and it is made more powerful
because of this.
Granted, not every object should be made generic. But you'd be amazed how
many objects would benefit from it.
--jc
--
Jimen Ching (WH6BRR) jching at flex.com wh6brr at uhm.ampr.org
More information about the Programming
mailing list