5 ms·
After C++11, the bottleneck of the speed of development in C++ is no longer the language. But it has numerous other problems dragging down C++ developers still:
by netheril96 11y ago
After C++11, the bottleneck of the speed of development in C++ is no longer the language. But it has numerous other problems dragging down C++ developers still: std::string is close to useless, no userspace and project-scoped package manager, too long build times, hard to debug templates, etc.
- adamnemecek 11y agoIdk dude, after programming in swift for some time, I feel like c++ can't really become a modern language.
- fndrplayer13 11y agoAgree that swift (and other languages like Rust for that matter) offer some very nice advantages over C++. However, C++ is so well established and has a rich collection of libraries and integrations. You can write a library in C++ and ship it on nearly everything. You can also optimize the parts of your system that are well-suited to a systems-language like C++ and then easily expose them in other languages like Python, Ruby, Go, Swift, etc. via their C-bindings. We can't say that (yet) about Swift and Rust. In 3-5 years I think this is going to be a very different conversation, though. In my mind, C++'s flexibility is both its greatest benefit and its greatest danger. You can do almost anything, and there are so many ways to do it. I agree this is a "problem" that's likely not going to be fixed. You can ask your fellow developers to read Scott Meyer's Effective (Modern) C++, you can go to meetups, listen to the wisdom of the steering committee, etc. but at the end of the day it really boils down to the fact that your team needs to be committed to being resilient and responsible. That's true in any language, but much more so in C++.
- nightpool 11y agoRust actually has a really nice embedded library story, and I've already seen a few things in Ruby or Go that have started using Rust libraries for performance. https://github.com/BurntSushi/rure-go https://github.com/BurntSushi/rure-go for example, just to pick something that's crossed my feeds recently. Not sure about Swift, I haven't really been paying attention in that space.
- steveklabnik 11y agoAt least two production users of rust are explicitly embedding rust in Ruby. The Node bindings (neon) are really great too. Even then, in C++ you still need to expose a C interface, so it feels at least on even footing with Rust. But of course, I am biased...
- pjmlp 11y agoThat is what eventually made me more focused on JVM and .NET languages, with C++ only being used only for lower level infrastructure code if at all needed. Writing proper code in C++ requires, as you say, "your team needs to be committed to being resilient and responsible", which just doesn't happen on my little piece of the world. So using it in personal projects, yeah. At work, not really.
- catnaroek 11y ago> too long build times, hard to debug templates, etc. These are symptoms of language issues.
- tomlu 11y agoAnd hopefully somewhat mitigated by modules once they land and (if it happens) everyone migrates.
- catnaroek 11y agoAsking out of total ignorance: How exactly do modules interact with templates? Is template specialization restricted to the module where the template is defined? If not, I don't see how modules could help much.
- pjmlp 11y agoStill ongoing design. This is the Microsoft view of them https://blogs.msdn.microsoft.com/vcblog/2015/12/03/c-modules-in-vs-2015-update-1/ https://blogs.msdn.microsoft.com/vcblog/2015/12/03/c-modules... Regarding templates, the approach is similar to the deprecated export keyword, so partially compiled templates and inline functions are stored in the metadata database used by the compiler for modules.
- catnaroek 11y agoI love how the second and third paragraphs describe modules as if they were some sort of novel, perhaps even futuristic, language feature that no programmer has ever seen before. “Oh, it's totally not like we're catching up with what other programming languages had for decades.”
- pjmlp 11y agoThe problem is that in the C culture practically ignored everything that was done in computing up to the late 70's. Bjarne was of course aware of modules, being brought on Simula and other programmer friendly languages, but then he had to make C++ code fit into UNIX linkers that only knew about AT&T Assembly and C binary formats. So no modules there, and along the years you got a culture of developers, specially those that only learn on the job, that never learned about modules and its history. You see it happen also when cache friendly code and RAII get discussed. Those things were also possible outside the C family of languages, before they won the market. So most millennials think that they are some special language capabilities only possible in C and C++.