By: anon2 (anon.delete@this.anon.com), May 23, 2022 3:36 am
Room: Moderated Discussions
Michael S (already5chosen.delete@this.yahoo.com) on May 23, 2022 2:52 am wrote:
> Templates are too generic answer to the challenge of generic programming.
> Pattern matching, which is at heart of templates, is hard and more than occasionally
> confusing, not just to compilers, but to human readers as well.
> More restrictive solutions to generic programming (e.g.
> generic facility of Ada) appear to be less confusing.
> Less powerful, too, but powerful enough for most practical purposes.
> It seems, C++ committee is well aware of the problem. That's why they are adding concepts in the new version.
> But just adding concepts without removing old ways is not going to make the language simpler.
>
Oh, you won't hear an argument from me on this. I don't think that C++ is a particularly well designed language, especially today. And I have to scratch my head in confusion every time someone claims that it is "strongly typed" — but I digress.
What I was curious about is to hear more about Jörn's dislike of templates in this particular case. I mean, I seen C programmers typing out dozens of pages of virtually identical declarations to parametrise a type or use complex preprocessor macros (=templates sans inference) to automate this process, and I do not quite get why this solution is any better than C++ templates.
> Templates are too generic answer to the challenge of generic programming.
> Pattern matching, which is at heart of templates, is hard and more than occasionally
> confusing, not just to compilers, but to human readers as well.
> More restrictive solutions to generic programming (e.g.
> generic facility of Ada) appear to be less confusing.
> Less powerful, too, but powerful enough for most practical purposes.
> It seems, C++ committee is well aware of the problem. That's why they are adding concepts in the new version.
> But just adding concepts without removing old ways is not going to make the language simpler.
>
Oh, you won't hear an argument from me on this. I don't think that C++ is a particularly well designed language, especially today. And I have to scratch my head in confusion every time someone claims that it is "strongly typed" — but I digress.
What I was curious about is to hear more about Jörn's dislike of templates in this particular case. I mean, I seen C programmers typing out dozens of pages of virtually identical declarations to parametrise a type or use complex preprocessor macros (=templates sans inference) to automate this process, and I do not quite get why this solution is any better than C++ templates.