5 ms·
I've written in C++ professionally almost 12 years (17 years counting College), and in my opinion it is a shame how the language has not evolved properly. Unso
by faragon 16y ago
I've written in C++ professionally almost 12 years (17 years counting College), and in my opinion it is a shame how the language has not evolved properly.
Unsolved things:
- Unified C++ ABI call for making shared libraries without worrying about compiler manufacturer or version.
- Massive bloat. Take a look to the Boost libraries and cry.
- Poor debugging tools for templates (debugging templates it is crazy, and the promise of easy template debugging is almost a decade old).
Ridiculous things (in my opinion):
- Obsession for doing everything in "user-land" (e.g. source code templates) instead of built-in abstractions at object code-generation time instead of compile-time.
- Willing to introduce functional programing in the language, when, in my opinion, it makes more sense just to interface with true functional code (e.g. via SBCL).
C++ hour will come, with a non-bloated, system-software capable, "better than C", which could be labeled "simple C++", as in "simple English".
- joe_the_user 16y agoTake a look to the Boost libraries and cry. Indeed! The thing I don't understand is that you go to the boost library website and you see that it touts itself as an all-volunteer effort. Who are these people who volunteer their time to produce this massively bloated, over-elaborated code? What is their motivation? What's going on here? I understand bureaucracies usually bureaucrats are paid and produce code and memos to expand and control their turf. But here? What's up? Boost certainly seems well done for what it is. But does this particular niche attract so many people?
- blub 16y agoYou shouldn't generalize. Saying 'X' about Boost is like saying 'X' about the US or Europe. There are many different components in there.
- joe_the_user 16y agoOK, I have slogged through quite a few boost libraries looking for stuff to use. If you can give me an example of a part of this "continent" which is "lean and mean" rather than over-elaborated, I'd be grateful.
- tedunangst 16y agoYour complaints seem focused on poor implementations and not the language itself. You don't want C++ language evolution, you want tool support evolution. Also, as far as I know, most compilers were settling on a fairly standardized IA64 ABI, even for other platforms. The problem gcc had, last I checked, was after every release, they found a bug in the implementation and fixing it made the next release incompatible, but the goal was to be interoperable.
- jey 16y ago> Unified C++ ABI call for making shared libraries without worrying about compiler manufacturer or version. There's too many implementation decisions for this to be feasible. E.g., you'd have to standardize exception handling implementations and object layouts. In practice, GCC has tried to standardize a C++ ABI for some platforms, but each proposed "standard ABI" has been buggy and required at least moderately backward-incompatible ABI changes between GCC releases. > Massive bloat. Take a look to the Boost libraries and cry. Define "bloat"? Large parts of Boost are absolutely horrid (e.g. Spirit), but I don't know what you mean by "bloat". Do you mean that the resulting object code is big? > Poor debugging tools for templates (debugging templates it is crazy, and the promise of easy template debugging is almost a decade old). Agreed. Hopefully clang is fixing that. http://clang.llvm.org http://clang.llvm.org > Obsession for doing everything in "user-land" (e.g. source code templates) instead of built-in abstractions at object code-generation time instead of compile-time. Huh? What do you mean by "built-in abstractions at object code-generation time"? > C++ hour will come, with a non-bloated, system-software capable, "better than C", which could be labeled "simple C++", as in "simple English". I was hoping that Digital Mars D would be the "Simple C++", but it feels like D is losing momentum. (Sidenote: I've been programming in C++ for about 13 years, and am a recovering C++ "language lawyer".)
- viraptor 16y ago> I was hoping that Digital Mars D would be the "Simple C++" I was hoping for the same for a long time. Now my favourite "simple C++" is OOC (http://ooc-lang.org/ http://ooc-lang.org/). The syntax is a bit different (partially justified by faster parsing/compilation and has a lot of nice sugar), but it does support a lot of the good stuff: classes, generics, ability to use C-layout structures and attach "methods" to them, closures, pointers to allow easy C libs interaction and more...
- timr 16y ago"Massive bloat. Take a look to the Boost libraries and cry." Aside from your tears, what is the evidence that boost is bloated? Too slow? Too much source code? Too many files? I've been using Boost for nearly a decade. It does a ton of useful stuff (from template metaprogramming to fast matrix algebra), it's loosely coupled, and it's insanely fast. Given it's scope, it's the least bloated library of which I know. C++ has been evolving, but for the last decade, all of the evolutionary changes have come in the world of templates and template metaprogramming. I think this is hard on the people who have restricted themselves to the C-with-classes mentality. They're missing every modern development in the language since ~1998.
- ajross 16y agoThere is bloat and there is bloat. I'm currently playing with a 200-line file that is mostly a wrapper around a subset of boost::polygon (basically it's a single-type specialization wrapped in a simpler API). With gcc 4.4.5 and -O2, this one small file takes 22 seconds (!) to compile and produces a 14MB output file. I guess that's... tolerable. But it isn't "lean" in any meaningful sense.
- johnny531 16y agoTry stripping debug symbols. As to compile time, the pimpl pattern is your friend here.
- ajross 16y agoI don't know who your audience is. I understand that most (about 2/3) of that data is symbol information. The complaint was obviously that a 200 line file generates 8MB of symbols and takes longer to compile than the rest of the project put together. And the existence of this 200 line file is precicely a pimpl attempt to isolate the C++ brain damage as much as possible. Your point seems to just be agreement with mine: C++ bloat is tolerable. It's still bloat.
- echaozh 16y ago
- greyman 16y agoBut you can already have "simple C++", just specify for your project which parts of the language you want/don't want to use, and enforce it. This I think is a good coding practice, and for example Google also have its own C++ Style guide (http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml http://google-styleguide.googlecode.com/svn/trunk/cppguide.x...). For example, you can specify that you will not use exceptions, template meta-programming, default parameters, etc. This I think is the power of C++ - it is a multi-paradigm language, and you are perfectly free to not use some of the paradigms, or more powerful techniques.
- cicero 16y agoSeveral years after I swore I would never work in C++ again, I agreed to do C++ in order to get a job with a company I was really interested in joining. I ended up working on a project that used C++ with lots of rules and restrictions, and it was not too bad except for lots of boilerplate. I would like to see something better come along that has some of the low-level power of C, but also supports sophisticated high-level abstractions. I was hoping Go might fit that bill, but the Go designers have made some interesting choices that seem to alienate a lot of developers.
- robrenaud 16y agoMaybe try D? Andrei Alexandrescu likes it, and he knows C++ really well.