Re: [OT] Re: C++ *for Git*
- From
- Marco Costalba <mcostalba@gmail.com>
- Date
- Sep 23, 2007, 18:05 UTC
- Message-ID
- <e5bfff550709231105h94d08e2n9b1234e7c1a7e6a8@mail.gmail.com>
- In-Reply-To
- <alpine.LFD.0.999.0709230911360.16478@woody.linux-foundation.org>
On 9/23/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 8 quoted lines
> > There are a few features of C++ that I really really like. For example, I > think the C preprocessor is absolutely horrid, and a preprocessor that is > built into the language - and integrates with the syntax - would be > wonderful. And while C++ doesn't improve on that, at least templates are > an example of something like that. Not perfect, but that's the kind of > feature that C really would like. >
Yes, I really agree. IMO templates are the thing that more resembles procedural programming, a common way of using them is to split data structures (containers) from functions that operates on them (algorithms). I find them very similar to the struct + functions classical approach of C.
And BTW
template <typename T>
is the thing in C++ that more remembers me of opaque pointers and their use in C, the difference is that the first is fully type checked.
Marco