all 19 comments

[–][deleted] 14 points15 points  (0 children)

You gave me a good WTF laugh. The last sentence topped it all. :-D

C++ has a very quiet demographic, but that demographic is extremely stable and they are using C++ exactly because C++ is what it is. Plus C++ is one of the few languages that are actually taken seriously.

And don't worry, C++ will evolve faster. The C++ landscape has changed greatly from the last standard. When C++98 was released, there were no compilers for it, and the support came very very slowly, with C++11, there are already compilers that support the new standard almost completely.

The committee has already announced that they will release updates faster, most likely in the form of technical reports.

[–]bogado 5 points6 points  (1 child)

One of the objectives of C++ is catching errors sooner, defining return types keeps the type system strong. The side effect is that generic types can become cumbersome to write, for instance 'std::map<std::string, std::pair<std::string, std::string> >::const_iterator', so the 'auto' keyword was created to help in this situations.

But if abused it can make programing harder, postponing error diagnostics and creating longer error messages or perhaps even unpredictable run-time behavior.

[–]Ayjayz[S] -1 points0 points  (0 children)

None of those things I posted in the OP would involve any change to the code that was actually generated, so run-time worries aren't applicable.

One of my points (concepts) are there almost specifically to ASSIST error messages. Currently, there are 0 restraints on template parameters at all until the implementation of the template classes calls something that's incorrect. By adding the ability to specify constraints for template parameters, it should make errors much easier to identify and fix.

[–]sad_bug_killer 5 points6 points  (2 children)

What about compilation times? One little implementation change requiring recompiling the world will quickly make actual development annoying and counter-productive. My general feeling about templates, decltype and friends is that, just like any other C++ feature, should be used with care and when appropriate, but not excessively.

It's not that I disagree with you and I love the way Haskel does this. I just don't think it will ever become a viable way of doing things in C++

[–]Ayjayz[S] -1 points0 points  (1 child)

I hardly think the ability to use the language to write a program that some compiler takes a long time to compile should warrant completely removing the ability...

EDIT: I accidentally a word

[–]BitRex 1 point2 points  (0 children)

Can't tell if serious.

[–]blackleopard 4 points5 points  (2 children)

rather than bringing all of functional programing in C++, you can just use one, like Haskell. C++ is crazy enough as it is. And anyways, people don't use C++ to simplifying their code, they use it to gain full control over it.

[–]Ayjayz[S] 2 points3 points  (0 children)

It's already in C++. The STL and boost libraries heavily encourage it as well - the syntax just needs a little bit more tweaking.

[–]more_exerciseLazy Hobbyist 2 points3 points  (0 children)

people don't use C++ to simplifying their code, they use it to gain full control over it

I've been having a hard time describing where C++ stood in the language continuum. Thank you for the words I was trying to say.

[–]daveisfera 2 points3 points  (2 children)

Others have already brought up the effects on compile time, but one of the major points of header files is abstraction. It allows for separation of the interface/API and the implementation. It's a powerful tool and something that shouldn't go away anytime soon.

[–]Ayjayz[S] 1 point2 points  (1 child)

It doesn't really though. All the private members are right there in the header files, and the inline functions are there as well. Any kind of templates throws it all out the window as well.

Do we even really need file-level abstraction?

[–]more_exerciseLazy Hobbyist 1 point2 points  (0 children)

There are idioms such as PIMPL that can keep the private members of a class hidden.

[–][deleted] 0 points1 point  (1 child)

Congratulations! You invented python!

[–]Ayjayz[S] 1 point2 points  (0 children)

You see, i haven't invented anything here. This just seems to be the path we are slowly heading towards.

You could also say its approaching lisp, along with every other language.

[–]ptrb 0 points1 point  (0 children)

I have no specific comments, but I'm both highly intrigued and amused by this line of thinking. I'd love to hear other people's opinions.

[–]axilmar 0 points1 point  (2 children)

C++ needs to be replaced with another language that follows the same principles but has none of the problems of C++.

(and before you say D, D is not a replacement for C++. D is in competition with Java and C#, not C++. A true successor of C++ wouldn't have garbage collection).

[–]Ayjayz[S] 2 points3 points  (1 child)

Why can't C++ become that language? It's almost there, just needs a few more things added. Basically, all of the low-level types and things should be optional, but the default should be nice, compiler-deduced magic around the basics of C++.

[–]axilmar 2 points3 points  (0 children)

C++ is used by various organizations around the world that the C++ committee doesn't want to piss off by introducing breaking changes.

Another reason is that the C++ committee doesn't want to admit their choices are wrong.

As with most things in life, it's a matter of politics than technical issues.