7 ms·
I think that C++'s build system difficulties are _huge contributors_ to people not feeling like C++ is "worth learning". People do the C/Rust comparison, but a
by rtpg 4y ago
I think that C++'s build system difficulties are _huge contributors_ to people not feeling like C++ is "worth learning".
People do the C/Rust comparison, but at least C has a simpler mental model so is a different thing. I feel like C++ has similar, if not more, complexity to Rust and is harder to onboard.
I do think there are domains where "let's use Rust" are a bit ... aspirational more than anything (anything related to graphics or OS integration...). And there C++ makes a lot of sense. But I think that day by day the number of projects where C++ is the only obvious choice goes down. Hell, it's been going down since Java!
- __jem 4y agoPeople always assume people who like Rust and are a bit more hesitant about C++ are just hype driven haters. I'm mostly exposed to C++ through my hobbies in creative coding, graphics programming, etc., and I would like to be a better C++ developer and be more comfortable with those projects. But every time I have to set up a new project it feels like death by a thousand cuts, and the fun art project I was about to work on just becomes a painful chore. I never, ever feel this way with Rust, even though it's significantly more immature in this space. Maybe I'm just one of those spoiled younger developers who expects great DX on all my tools, but it makes me really reluctant to invest more time into learning C++ when I could be contributing to open source Rust and improving the ecosystem. Getting better with C++ just feels like learning an endless series of sharp edges.
- vvanders 4y agoThis was something that Microsoft did really well back in the Visual Studio days. That said Rust really raised the bar not just on tooling but the whole end-to-end experience and with cross-platform being table stakes now it really makes for a compelling choice.
- pjmlp 4y agoWell, it is no surprise given their C++ investment, that Microsoft keeps briging more Rust like experience into Visual C++ then. They are adopting Rust in some small spots like Azure Sphere, and Rust/WinRT, yet WinDev, XBox, Office, .NET (for the runtime), DirectX aren't getting rid of their C++ code anytime soon. Rust experience is compeling if one doesn't need to rewrite the world, e.g. doing CUDA in C++ versus Rust.
- brundolf 4y agoSeconded. I can have fun using Rust, I can't have fun using C++, so Rust is what I've spent the past ~4 years getting more and more familiar with. Now I'm at a point where I could apply to Rust jobs, but certainly not C++ jobs
- vintermann 4y agoConsidering this is a volunteer driven open source project with a high "for the heck of it" factor (Wikipefia: "Fish is considered an exotic shell since it does not rigorously adhere to POSIX shell standards"), I don't think the having fun argument is quite as bad as all the serious people say.
- brundolf 4y agoYeah, but I was also making a further point: if everyone uses the enjoyable language in their spare time, and nobody wants to use the miserable one unless they have to, you get a gradual brain-drain. More and more people have more and more experience with the fun one, and over time it gets easier to hire for (or find contributors for) Of course it's sticky- someone who's already an expert in the miserable language may not choose to totally re-skill themselves (and anyway, once you know something that well it tends to become less miserable). But the new generations will heavily favor the thing that's welcoming to them, not the thing that's prickly
- simplotek 4y ago> But every time I have to set up a new project it feels like death by a thousand cuts Which part of the following example is hard: program(mynewproject LANGUAGES CXX) add_library(libfoo STATIC foo.cpp ) add_executable(bar bar.cpp main.cpp ) target_link_libraries(bar libfoo ) Edit: and this message was downvoted? Seriously?
- lifthrasiir 4y agoYou completely ignored dependencies, which in my experience everyone seems to handle differently (and definitely not in a declarative way). Differently put: a phrase "metabuild system" has both a lexical sense and an idealized sense. The lexical sense would be something that generates an input to build systems. The idealized sense would be something that does everything else not possible or difficult in build systems. CMake was definitely far from that ideal [1]; it was often simpler to make a configure script in your favorite language (and, for god's sake, not in M4) than using CMake. [1] Was using a present tense but edited after realizing that I don't know much about recent changes to CMake. Still enough to justify my (and others') criticism.
- simplotek 4y ago> You completely ignored dependencies Not really. When people talk about setting up a new project, they talk about starting a hello world project and build up from there. Anyway, I'll bite. What would it take to add a dependency? If it exports a cmake config file which exports targets, all it takes is this: find_package(MyDependency), target_link_libraries(bar MyDependency::targetA MyDependency::targetB ... MyDependency::targetZ ) If it doesn't and it is instead a system library then you can even pass the library instead. add_library(bar systemlibrary ) If the library exports no cmake config and you have anything exotic you can put together your own cmake find modules, and proceed to follow step A. Alternatively, you can even bolt on something like Conan and just follow step A all the time. > Differently put: a phrase "metabuild system" has (...) Sorry, but do you actually have any concrete example of any difficulty setting up a C++ project?
- 4y ago
- Gigachad 4y agoI spent the better part of a day trying to work out how to get VS Code to see library functions in the auto complete feature. Eventually I got it so it could ctrl click to go-to-definition but it still underlined the functions as undefined and auto complete wouldn't show them. I wasn't willing to go any further and waste more of my free time to solve this. I'd never experienced such an unintuitive process.
- chickdilla 4y agoHad this same experience several times in various projects and in all sorts of IDEs, major pain. If it’s helpful, I recently came across the 10x c++ editor project, which has the best c++ code completion experience I’ve seen by a huge margin. Some rough edges UI wise, but it’s still in beta
- Night_Thastus 4y agoAs someone who works in C++, the build systems are definitely the worst part. QMake is abandoned. Cmake is the de-facto option and is an ancient horrible mess that feels like a miracle if it works at all. What's left? Options that are barely supported, severely limited in features, are only reasonable for tiny side projects, etc.
- jwkpiano1 4y agoBazel is supported by Google and is quite good. I’d certainly take it over CMake.
- mlindner 4y agoInteresting. My friend, who works at well known gaming company you've probably heard of, recently spent several months of his life fighting back against a group of people that came in from an acquisition that were trying to convert the company's well-working CMake system over to Bazel. He described it in pretty poor terms and described how it constantly caused the build system to fail. He eventually succeeded in convincing management to keep the CMake system rather than converting it to Bazel at the objection of the more senior devs from the acquisition.
- jwkpiano1 4y agoIt’s a somewhat steep learning curve, but in my experience once you have your Bazel rules set up properly, it’s incredibly powerful, enabling lots of time savings from caching, as well as helping enforce reproducible outputs.
- rtpg 4y agoI feel like Bazel is much more convincing _after it's working_, cuz you really do get much faster builds. But the work has to be done, and there's a lot of unlearning to do. If your project doesn't take long to compile or test anyways.... I can see getting annoyed.
- 4y ago
- girvo 4y agoI would give up my firstborn to never have to deal with CMake again.
- lars_francke 4y agoInitially coming mostly from the Java ecosystem with its mature (not perfect) build and dependency story, it took me days to understand that none of that exists in C++. All of it seems to be based on copying dependencies around or installing them on a system level. Plus mostly template/text driven make files. I'm still not sure if this is really how C++ is developed. Four years ago, when I last looked, I wasn't able to find a good resource for people with my background to learn C++ the ecosystem (not the language). That turned me to Rust. All of this text to give strong support for your first paragraph.