Live data from Hacker News

Has C++ jumped the shark?

johndcook.com

11–20 of 69 posts

Re: Has C++ jumped the shark?

#11
post #4

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…

> 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

> 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".)

Re: Has C++ jumped the shark?

#12
post #4

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…

"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.

Re: Has C++ jumped the shark?

#14
post #4

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…

But 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.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.

Re: Has C++ jumped the shark?

#15

The author says he is content with C++ the way it is, yet he bemoans the good deal of time between major changes in the standard. This is a little inconsistent. As a language that takes a long time to master, changing fundamental features of the language every 3rd year, for instance, would be a bit difficult to keep up with. Furthermore, the niche C++ lives in isn't one that needs to change every year. For some users…

I see how that could sound inconsistent. But I'm not bemoaning the time it takes between changes to the standard as much as pointing out that these long intervals show that the language is done. I'd rather see the standards committee give up than hurry up.

It's fine for a language to be "done" or "over." It's still important until it has been replaced for practical purposes by another language. Until then, why not keep making improvements? I wouldn't put C++ on my list of favorite languages, but I expect my C++ skills to be an asset for a long time to come.

As always when talking about the continued relevance of C++, I will celebrate when I'm proved wrong.

Re: Has C++ jumped the shark?

#16
post #11
post #4

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…

> 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 backw…

> 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/). 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...

Re: Has C++ jumped the shark?

#17
post #8

C++ is the only language I'm aware of where every extension made to the language is careful to only affect compilation time/complexity, while preserving the speed and operational semantics of the code at runtime. This makes it perfect for some domains, e.g. console game development, where the speeds required are only attainable by dicking around with pointers in C, but people want to use better abstractions than C is…

C++ takes a very simplistic view of runtime performance, however. Generics are implemented using templates; which instantiates the code for every type you use. Naively, this preserves the performance of simply writing the same code for each type (which is what you did before templates). However, that might not be the best performing way to implement generics at runtime.

(Edit: Small change to make meaning clearer)

Re: Has C++ jumped the shark?

#18

The author says he is content with C++ the way it is, yet he bemoans the good deal of time between major changes in the standard. This is a little inconsistent. As a language that takes a long time to master, changing fundamental features of the language every 3rd year, for instance, would be a bit difficult to keep up with. Furthermore, the niche C++ lives in isn't one that needs to change every year. For some users…

I see how that could sound inconsistent. But I'm not bemoaning the time it takes between changes to the standard as much as pointing out that these long intervals show that the language is done. I'd rather see the standards committee give up than hurry up.

I see your point, but agree with the parent comment more. The current state of the C++ just doesn't require the committee to hurry up, and the language is not done, even if it would take five more years to have new standard approved.

As I see it, the new standard just isn't something which would change the future of C++ in some significant way, and it is not the most pressing problem C++ has as a language.

From my perspective, what I would like to see more is some alternative to boost, with similar functionality but without that meta-meta-programming. ;-) Simply, more cross-platform libraries comprehensible for the average C++ programmers.

Re: Has C++ jumped the shark?

#19
post #14
post #4

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…

But 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.x... ). For example, you can specify that you will not use exceptions, template meta-programming, default parameters, etc…

Several 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.

Re: Has C++ jumped the shark?

#20
Languages are tools. Da Vinci with a mop and a bucket of mud would be a better painter than me. In fact I recently saw a video where Kelly Slater surfed a door and a coffee table as impressively as most weekend warriors surf on $700 custom shaped boards.

Focus on your skill not the tools. Surfing is more about timing, fitness and knowledge of waves than it is about the board. Likewise coding is more about RAM, CPUs, HDs, GPUs, busses, networks and ultimately users than it is about what tools you use to manipulate them.

Post reply on HN