5 ms·
Why I don't spend time with Modern C++ anymore
- dallbee 11y agoI wonder if the author has similar views about C, which doesn't have many of the problems that he's talking about. Furthermore, many of his arguments seem to be statements about all high level languages.
- w8rbt 11y agoWhat does he propose as a replacement for C++? Did I miss that part? IMO, there's currently nothing mainstream that can replace it. Of course, C is just as fast, but has the same expert problem he cites and lacks many of the safety features found in C++. If you need a very fast, relatively safe, mainstream systems language, there's not much else out there.
- cottonseed 11y ago> Today the "Modern Technologist" has to rely on a new set of languages: Verilog, VHDL. and > all sorts of reconfigurable hardware are being deployed in the field. Intel is currently shipping Xeon CPUs with embedded FPGAs. IOT is going to become a multi-billion dollar market in the next five years, and it is largely propelled by little $10 FPGAs that will require an astounding amount of qualified technologists to program them. I can't say I disagree (I wrote arachne-pnr [0] last year to learn about exactly these technologies) but I don't know how many people are going to be developing next generation of high performance systems in VHDL and Verilog compared to modern programming languages. I think there is a huge opportunity for tool development in this space. [0] https://github.com/cseed/arachne-pnr https://github.com/cseed/arachne-pnr
- kazinator 11y ago> What does he propose as a replacement for C++? Given that the focus of the article is mostly bleeding edge C++, and not C++ in its entirety, I'm justified in suspecting that he would have you do C++ work using C++98 or C++2003. (In which case I strongly agree; I think C++ developed into the best version of its kind of thing in around that era, and is now basically in a kind of Rococo decline.)
- plorkyeran 11y agoIt's actually more about what was the bleeding edge of C++ 10+ years ago. The examples of "recent developments" he gives are all quite dated, and one is even outright obsolete as of C++11 (the safe bool idiom).
- rumcajz 11y agoI have moved from C++ to C myself and I am a much happier person since.
- Galanwe 11y agoI also did switch from C++ to C when C++11 appeared, and never looked back since.
- alpineidyll3 11y agoI totally agree with everything in this article.
- n00b101 11y agoAs has always been the case, effective use of modern C++ requires knowing which subset of the language to use and which to avoid. I agree with the author's criticisms of many C++ features. At the same time, I think that a proper simple, modern subset of C++ exists that is much more productive and safer than C, without sacrificing performance. You can also optimize progressively, for example start with using std::string and std::vector and then replace the stock implementations if they aren't performant on your target architecture. I would not, however, recommend using C++ for GPU kernel code - a mix of C++ for CPU code and C for GPU kernel code works best. It is not ideal, but it's the best toolset available for serious industrial development. FPGAs are exciting, but they've also been the "next big thing" in general purpose computing forever. Obviously it makes sense to use FPGAs for certain HFT and embedded applications, but that's not the same as general purpose computing which is what C/C++ is for. Not to mention, FPGA compile times can take hours or even days, which pales in comparison to most C++ template overhead. I would also say that for IOT, I'm not sure why it is obvious that "$10 FPGAs" should dominate. Why not a $2 microcontroller? Embedded devices have been around long before "IOT" became a buzzword, and we can see that microcontrollers, FPGAs, SOCs, and custom ASICs all have a role to play depending on the application.
- ngrilly 11y agoDoesn't Rust look like an excellent answer to the author's issues with C++?
- cm3 11y agoCan we merge submissions? This and https://news.ycombinator.com/item?id=11720659 https://news.ycombinator.com/item?id=11720659
- ingve 11y agoI have no idea why this submission got resurrected now, it was submitted several days ago and failed to get any traction. Hope dang can kill it and move the comments to the newer and more active thread.
- any1 11y agoDuring my time as a systems programmer, I've gone from C to C++ to C again. At first, I didn't understand it so I feared it. Then I understood some of it, so I liked it. Finally, I understood most of it, so the mirage dissolved in front of my eyes and I no longer seek it.