3 ms·
Zero-cost abstractions come at a pretty hefty price if you pick C++. The cost is in programmer productivity & quality of resulting software. I'm sure there are
by fulafel 12y ago
Zero-cost abstractions come at a pretty hefty price if you pick C++. The cost is in programmer productivity & quality of resulting software. I'm sure there are some fields of academia where this is a reasonable tradeoff (if you're programming DSP algorithms running on a embedded battery powered device strapped to a dolphin, say...) but your generic number crunching job rarely calls for it.
(As an aside, zero-overhead abstractions being unique to C++ doesn't sound right to me. Then again I haven't heard the term used outside C++ circles and its meaning is nebulous, so maybe it's just a name for C++'s tradeoffs?)
- edgarbob 12y agoHopefully Rust's approach to zero-overhead abstractions will alleviate a lot of the problems you run into in C++.
- markrages 12y agoFor embedded DSP, the preferred language is C (no ++). The extra complexity the ++ adds is of little or no value in small embedded systems.
- adwn 12y ago> Zero-cost abstractions come at a pretty hefty price if you pick C++. The cost is in programmer productivity & quality of resulting software. I agree with you. But as with most prices, sometimes they are worth it. There are a lot of practical cases where you really want the performance (even outside scientific computing, which in itself is a pretty widely applied field). > I'm sure there are some fields of academia where this is a reasonable tradeoff I'm not sure where you got "academia" from; scientific computing is in no way restricted to research. Weather predictions, genome processing, and oil reserves exploration are just three of many examples for the commercial application of scientific computing. > (if you're programming DSP algorithms running on a embedded battery powered device strapped to a dolphin, say...) DSP applications are ubiquitous today; you'll find them, e.g., in your phone, or in your car. > but your generic number crunching job rarely calls for it. You're very wrong. Number crunching is the example for which you want lots of performance. > As an aside, zero-overhead abstractions being unique to C++ doesn't sound right to me. I didn't say they are. I said that no other language offers them to the degree that C++ does. > so maybe it's just a name for C++'s tradeoffs? No. It means abstractions which do not cause runtime overheads because the compiler can optimize them away.