In my experience, the opposite of what the author claims is true: modern C++ leads to code that's easier to understand, performs better and is easier to maintain. As an example, replacing boost::bind with lambdas allowed the compiler to inline functor calls and avoided virtual function calls in a large code base I've been working with, improving performance. Move semantics also boosted performance. Designing APIs wit…
Fully agree with what you're saying. Just a nitpick about bind (which I'm sure you're aware of, just for the sake of others). The return type of {boost,std}::bind is unspecified (it's basically just a "callable"). This means that bind doesn't have to do type erasure. On the other hand, {boost,std}::function has to do type erasure, which can boil down to a virtual function call. But that's orthogonal to where the call…
Why I don't spend time with Modern C++ anymore
121–130 of 264 posts
Re: Why I don't spend time with Modern C++ anymore
#122> Today the "Modern Technologist" has to rely on a new set of languages: Verilog, VHDL That was a complete surprise ending! :) I like surprise endings, and he makes a lot of good points, whether or not I agree with them. But, I totally wasn't expecting "I'm done with C++ because: hardware." I was expecting because web or because awesome new high performance functional scripting language . A lot of what he's talking a…
I would say yes: you can't really run C++ on an FPGA. There are all sorts of tools which promise this (SystemC etc), but it requires you to stick to a careful subset of language constructs. You don't have a heap, for example.
Re: Why I don't spend time with Modern C++ anymore
#123HFT is a pretty limited and extreme application case. From what I understand - everything is not enough for HFT - network cards, kernel drivers, cables, etc. You have milliseconds (edit: nanoseconds !) to receive, process and push your orders before someone else does it and gets the prize. It's an arms race between technologists for the purpose of making a small number of people rich. I doubt that these requirements…
HFT = Insider trading + Algorithm trading
Re: Why I don't spend time with Modern C++ anymore
#124In my experience, the opposite of what the author claims is true: modern C++ leads to code that's easier to understand, performs better and is easier to maintain. As an example, replacing boost::bind with lambdas allowed the compiler to inline functor calls and avoided virtual function calls in a large code base I've been working with, improving performance. Move semantics also boosted performance. Designing APIs wit…
And not just runtime performance; IME replacing bind() with lambdas typically significantly improves build time performance significantly. C++03 with C++11 features emulated via library trickery has terrible compile times compared to having the same features built in to the compiler.
Re: Why I don't spend time with Modern C++ anymore
#125> Today the "Modern Technologist" has to rely on a new set of languages: Verilog, VHDL That was a complete surprise ending! :) I like surprise endings, and he makes a lot of good points, whether or not I agree with them. But, I totally wasn't expecting "I'm done with C++ because: hardware." I was expecting because web or because awesome new high performance functional scripting language . A lot of what he's talking a…
Currently they are exclusive. You can theoretically 'compile' some subset of C++ to an FPGA, but you very likely do not want to.
Of course C++ makes it a decent language to talk with a custom circuit in FPGA, but that's orthogonal.
edit: clarify
Re: Why I don't spend time with Modern C++ anymore
#126People who are not forced to use C++ should consider other languages which are way cleaner and even more performant. Code written in Ada and Nim for instance is much easier to maintain.
Re: Why I don't spend time with Modern C++ anymore
#127Earlier quoted context omitted.
Well, we also have to thank C for the set back in optimizing compilers. Fran Allen. In Coders at Work (pp. 501-502): --- Begin Quote --- -Seibel-: When do you think was the last time that you programmed? -Allen-: Oh, it was quite a while ago. I kind of stopped when C came out. That was a big blow. We were making so much good progress on optimizations and transformations. We were getting rid of just one nice problem a…
That's some serious sour grapes by Allen. Her assertion that Fortran and COBOL are higher level than C is .. difficult to support given the reliance of both languages on GOTO. The assertion that compilers weren't taught any more is just silly.
Re: Why I don't spend time with Modern C++ anymore
#128Re: Why I don't spend time with Modern C++ anymore
#129Earlier quoted context omitted.
(re 10 minute compile times) > This is simply a bogus statement I work on a C++ project and believe me, 10 minute compile times would be great :)
have you tried ccache? the 5x to 10x improvement isn't a bogus statement in my experience
Re: Why I don't spend time with Modern C++ anymore
#130Earlier quoted context omitted.
C++noob here, but: Given that the members in your example are no pointers but actual substructures within your data structure, wouldn't that result in an infinite data structure? Therefore it sewms quite logical to me it's not allowed. Disallowing cyclical dependencies via pointer would make no sense though.
Right. C++ objects are values, not references to values like in almost all other languages. So C++ needs to know the sizes of everything to construct them. If you tried to write out the mathematical series describing the ultimate size you would need to allocate for A or B, you would end up with a value approaching infinity.