Template instantiation syntax
Bill Baxter
wbaxter at gmail.com
Sat Oct 11 03:53:11 PDT 2008
On Sat, Oct 11, 2008 at 6:57 PM, Walter Bright
<newshound1 at digitalmars.com> wrote:
> Bill Baxter wrote:
>>
>> But it's not the << and >> that make C++ templates hard to understand.
>
> I think it does. I could never get past the visual ambiguity with less than,
> and with the streams, the ambiguity with >>. But that isn't the worst of it,
> the C++ template definition syntax sets my teeth on edge.
>
>> Replacing that with some other character or character sequence would
>> make very little difference in how difficult they are to understand.
>> It's more the lack of a straighforward equivalent for things like
>> static if.
>
> There are a lot of issues that needed improvement.
>
>> Changing details like the character used for this or that can make the
>> code more or less readable though. But that doesn't really affect how
>> difficult it is to remember how to write something.
>
> I disagree with that assessment. There are aesthetics to architecture,
> fonts, web pages, cars, dance, clothes, etc. Break those aesthetics, and
> you've got something people just don't like, even if they cannot identify
> why.
Ok, I don't disagree with that, but you're changing your argument.
Before you said << and >> prevented you from remembering how to do
things with C++ templates. Not liking the looks of the result or
finding it hard to read can be a turn-off, sure, but I don't think <<
and >> are what make it hard to remember how to fake a static if with
C++. That's all I was objecting to.
>
> Take the immutable vs invariant aesthetic. There is no technical reason to
> prefer one over the other. But people seem to just like immutable better.
>
But people don't say they have to copy&paste code because the word
"invariant" blocks their brains from remembering how to write the
code. If there's something hard to remember about how to write such
code, changing the word from "invariant" to "immutable" isn't going to
change that. That's all I'm tryin' to say.
--bb
More information about the Digitalmars-d
mailing list