News for hackers. Stuff that matters.
Re:The cost of forsaking C by fredsanford on Wednesday October 05, 2016 @08:06AM (#12643106)
Take a look at the useless features and bloat in this video. Modern C++ isn't what you think it is.

https://www.youtube.com/watch?v=zBkNBP00wJE

Re:The cost of forsaking C by inDigiNeous on Wednesday October 05, 2016 @08:19AM (#12643154)
That's a great talk that really shows that with modern C++ you can do some really nice optimizations and code minimizations, but it seems to require a discipline that can require a lot of thinking in the complex world of C++, to find those methods that for example Jason is talking about here.

Was pretty eye opening video to see that, that some of those complex looking instructions with a modern optimizing compiler can be surprisingly neatly optimized away.

Re:The cost of forsaking C by fredsanford on Wednesday October 05, 2016 @08:28AM (#12643192)
I think discipline is a keyword here. It feels to me like being a professional means a fair amount of discipline should be required. Unless you're the nephew's uncle in law of the founders sister that knows VB and is "pretty good with compooturz" or the like.
Re:The cost of forsaking C by dreta on Wednesday October 05, 2016 @08:18AM (#12643149)
Could’ve easily written that in plain C. All the usage of C++ concepts like templates did, was made him write more code than necessary, and made the code harder to understand.
Re:The cost of forsaking C by marchelzo on Wednesday October 05, 2016 @12:58PM (#12645603)
I agree completely. I couldn't believe it when he made that Frame struct and completely abused RAII just to execute some code at the beginning and end of a block. The only really big wins were the wrappers for writing to different memory locations, all of which could have been implemented in C using macros or inline functions.
Re:The cost of forsaking C by fredsanford on Wednesday October 05, 2016 @08:31AM (#12643203)
You're not worth the effort.
Re:The cost of forsaking C by dreta on Wednesday October 05, 2016 @08:47AM (#12643315)
If i’m missing something obvious, please explain to me how using any of the C++ concepts made the code any better.

You have to keep in mind that this is a very simple piece of software. I wager you that using things like templates made the code unnecessarily harder to understand. I’ll also wager that by using templates he made the code harder to scale, since any remotely complex template, just like an overused base class, eventually becomes a set of special cases, or a set of specialised templates which defeats their purpose in the first place, and makes your code a nightmare to step through.

This is a typical example presented in a talk. It doesn’t reflect any large real-world software, where complex language solutions (useful ones, not the ones in C++) could actually benefit the programmer.