10 ms·
C++ Dev Ecosystem 2021
- zabzonk 5y agoI would observe that anyone using C++11 in their code is also being compatible with C++17. And all this idea that modules will solve all compilation problems (such as they are)? No, I don't think so.
- bluGill 5y agoSure and odds are C++98 is compatible with C++17. The problem is the reverse, I try to write the most modern C++ I can, but I'm limited to my compiler (in embedded systems we rarely get updated compilers) which sometimes means I have to write the c++17 library things I need in older styles, and of course I can't touch anything that needs a non-library update.
- jbluepolarbear 5y agoI haven’t done an upgrade from 11 to 17, but I did do a few 11 to 14 and there were a lot of issues with the boost versions we used. Those upgrades killed any interest I had in ever using C++ again.
- Shadonototro 5y agoand yet they don't even support C++20.. not even modules jetbrains used to be ahead of the competition, they are now lagging behind > Is your current project planning to use any of these C++20 features in the next 12 months? modules with 48% jetbrains you better hurry up
- infamouscow 5y agoOnly MSVC has complete C++20 support. GCC and Clang are not all the way there yet.
- aninteger 5y agoDepends on the definition of complete: https://old.reddit.com/r/cpp/comments/old0t6/why_does_msvc_blatantly_lies_about_its_supported/ https://old.reddit.com/r/cpp/comments/old0t6/why_does_msvc_b...
- gpderetta 5y agoI might not have used it in a while, but by experience MSVC features had a tendency to be much more buggier and incomplete than Clang or GCC (mind, new features tend to have bugs everywhere).
- scatters 5y agoMSVC claims complete C++20 support, but their concepts implementation is lacking support for requires-expressions. This is a pretty huge oversight, imo.
- slezyr 5y ago> and yet they don't even support C++20.. not EVEN MODULES Can you name a build system that supports them?
- rightbyte 5y agoAnd 46% said they will use concepts. I guess people are overestimating a lot or the panel was C++ aficionados.
- bluGill 5y ago46% seems way too high. Most C++ programmers just use templates without writing them, so concepts are of no use as the compiler can figure out from the simple types what is wrong with the code and give a good error message. Until you have to write generic code concepts don't have much use, and that seems to be around 10% of C++ programmers. Unless you mean as in use them to diagnose an error in your use of generic code that you use. Then if you are using a high enough C++ you will use them - though probably without even knowing it.
- logicchains 5y agoIf someone writes: auto myFunc(auto& x, auto& y){....} They're technically using concepts, as auto function params are part of the c++20 concepts stuff.
- otabdeveloper4 5y agoNo, it's the other way around. Concepts are pretty useless at the moment for error messages, but they're super easy and convenient when you need to disambiguate something like void do_it(auto& x) { // x is a vector void do_it(auto& x) { // x is nlohmann::json Just stick a 'requires' in there and it works.
- nemetroid 5y agoDoes CMake meaningfully support modules yet? From what I can tell, the latest activity on this topic[1] is that it's in an experimental state, and requires that you use a bundled version of ninja[2]. I wouldn't expect CLion to support modules before CMake does. 1: https://gitlab.kitware.com/cmake/cmake/-/issues/18355 https://gitlab.kitware.com/cmake/cmake/-/issues/18355 2: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5562 https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5562
- Shadonototro 5y agoIt doesn't matter, they could provide a cmake fork that supports modules I am a customer, i need module support because we want to embrace C++20 early, i look at what's available and i see Visual Studio supporting modules, the choice is easy to make Visual Studio has module support since few months already
- jbluepolarbear 5y agoI don’t use raw C++ anymore, but Rider with Unreal is next level. I primarily use Rider with C# and it’s always up to date with the newest features.
- pjmlp 5y agoWhile catching up with what the compilers are capable of, like Windows applications and C++ hot reload. https://devblogs.microsoft.com/visualstudio/visual-studio-2022-preview-2-is-out/ https://devblogs.microsoft.com/visualstudio/visual-studio-20...
- jbluepolarbear 5y agoDid they improve build time for C++ in 2022? I’m still on 2019 for my IL2CPP Unity builds and it’s slow because it generates a lot of files. Each generic gets its own file per type.
- Shadonototro 5y agoIl2CPP is slow because C# is a bloated language that doesn't work well with AOT compiler because most of the features people rely on are actually relying on runtime code generation
- jbluepolarbear 5y agoI mean it takes half the time to build in Xcode on the same machine. I think you’re also confusing runtime code (dynamics) with reflection. Dynamics rely on reflection. AOT has issues where reflection would be used: generics, serialization, Activator, etc.
- pjmlp 5y agoNo idea about IL2CPP abilities, the C++ code I write isn't tool generated.
- sharikous 5y agoWhat surprises me is that VSCode is used more than VS for C++. I would have guessed people would go for the "full fledged IDE" for the kind of projects that require C++. Overnight VSCode has become the one size fit all for everything.
- Jtsummers 5y agoVSCode is multiplatform. It runs on Linux and macOS as well as Windows which expands its applicability and availability greatly compared to Visual Studio proper.
- exdsq 5y agoI would use VS if I was on Windows, but I'm on Linux (specifically a Ubuntu distro on a chromebook) where I need something lightweight (and cross-platform).
- frabert 5y agoIn my experience, VSCode + clangd works better than full VS for most projects
- Flex247A 5y agoEven Sublime Text 4 is pretty good, if you install the LSP plugin.
- ant6n 5y agoVSCode is kind of nice, but those keybindings are very confusing and opiniated. And if you install an extension to get the bindings you're used to (vim/emacs), it gets even more confusing as the extension and VSCode start digging each other.
- sgerenser 5y agoAren’t VSCode keybindings fully configurable?
- 5y ago
- ape4 5y agoWhat about the dev's (like me) who never heard about the survey.
- deleted 5y ago[deleted]
- ok2938 5y agoSurprised that vim clocks in at only 6%.
- uncomputation 5y agoI’m wondering the percentage for C developers.
- tored 5y agoVi/Vim 9% https://www.jetbrains.com/lp/devecosystem-2021/c/ https://www.jetbrains.com/lp/devecosystem-2021/c/
- tored 5y agoTo invite potential respondents to complete the survey, we used Twitter ads, Facebook ads, Instagram, Quora, VK, and JetBrains’ own communication channels. We also posted links to some user groups and tech community channels, and we asked our respondents to share the link to the survey with their peers. Probably not where you would look for vim & emacs users. https://www.jetbrains.com/lp/devecosystem-2021/methodology/ https://www.jetbrains.com/lp/devecosystem-2021/methodology/
- 908B64B197 5y agoWhere would you look for Vim and Emacs users?
- user5994461 5y ago
- ternaryoperator 5y agoOne third of C++ devs in this survey don't write unit tests at all? That's insane in this day and age.
- NavinF 5y agoIs it really? Most unit tests I've encountered are garbage. They only test for bugs that are incredibly unlikely to happen. Integration tests and fuzz testing is where it's at. Anyone can add or improve an integration test within an hour and find several bugs that real users would encounter.
- ternaryoperator 5y agoAll that could be true and it still would not suggest that no unit tests at all is a valid choice.
- Jtsummers 5y ago> They only test for bugs that are incredibly unlikely to happen. Well, that might be the problem. Testing "for bugs" isn't a terribly helpful activity. Testing for behavior is much more helpful, and unit tests can definitely be applied to that aspect of the system. Of course, it requires you to properly decompose the system into subsystems (modules) with loose coupling that can be individually (or in small sets) loaded into test harnesses for testing.
- ddlutz 5y agoMaybe you are not working on the right projects or with the right people, because good unit tests are extremely valuable. At a minimum, ensuring that making a change to some existing code doesn't break existing behavior is valuable.
- titzer 5y agoStrong disagree. Effective unit tests accelerate development by allowing fast turnaround and refactoring with confidence. There are bad unit tests, of course, that are highly coupled with the code that they test. I have written tens of thousands of unit tests in my career, and by far the most useful ones are the ones that point you to the exact subsystem in which a bug you've just introduced during refactoring/re-implementing lies. Bad unit tests are brittle "change detectors" and make you constantly adjust them for no real reason. I find mocks and interaction-based tests (rather than simple input/output tests) are this way. I flat-out do not use mocks for this very reason. They are intricate, involved, and take huge amounts of time to load context when they fail. Don't write such tests. If your unit tests are garbage, it's because they were not thought out very much and commit sins.
- daenz 5y agoWhich c++ standards do you regularly use? 11% - I'm not sure. That is extremely amusing and also extremely understandable.
- stanislavb 5y agoThe C++ trending projects on LibHunt also give a nice overview of the current open-source dev ecosystem https://www.libhunt.com/l/cpp/trending https://www.libhunt.com/l/cpp/trending (disclosure: I've built LibHunt)
- user5994461 5y ago60% of developers are on C++17 and C++20, really? I would have bet that the vast majority of C++ projects are not using the latest standard let alone the latest compilers that support it.
- saurik 5y ago(I have been programming in C++ for just under a quarter of a century now--since before C++98 was standardized--and have seen a lot of C++ upgrades over the years.) Who wouldn't be using a C++17 compiler? AFAIK all relevant compiler franchises have supported almost all of C++17 for a long long time now (and unless you are screwing around with Xcode--as Apple doesn't seem to know how to separate applications from operating systems ;P--you generally don't have to upgrade anything except your compiler to upgrade your compiler). You have to be using C++ on a particularly unpopular microcontroller to be stuck without a modern C++ compiler (and even then).
- user5994461 5y agoI am double checking. - Full C++17 support requires GCC 7 or Visual Studio 2019 or Clang 5. - Limited support available in GCC 5 and Visual Studio 2017 with update pack. Then the question is what packages are available in Debian/RedHat? especially the previous major version of the OS (Companies are always slow to upgrade and libraries in particular need to work on active OS until EOL). RedHat 7 is stuck on GCC 4.8 so anybody working in that type of environment is stuck there. Debian looks fine. For Visual Studio it probably depends on whether you can get the license (have to convince procurement to pay?) Aside of the tooling, you have to take time and be willing to upgrade the toolchain. I'd expect C++ to be the language with trillion of lines of barely maintained legacy code. (We can define "legacy" as any existing code :D)
- ericbarrett 5y agoGCC 7 is available for RedHat 7 from an official package; it’s just not the default /usr/bin/gcc.
- saurik 5y ago
- xvilka 5y agoIt's surprising how so many people still use MSVC when there's clang-cl[1]. Both Google and Mozilla use it for producing binary releases for Windows for years already[2][3]. MSVC has poor track record on following standards and lacked ASAN etc support until recently. And Visual Studio now can integrate with it smoothly [4]. [1] https://clang.llvm.org/docs/MSVCCompatibility.html https://clang.llvm.org/docs/MSVCCompatibility.html [2] https://blog.llvm.org/2018/03/clang-is-now-used-to-build-chrome-for.html https://blog.llvm.org/2018/03/clang-is-now-used-to-build-chr... [3] https://blog.mozilla.org/nfroyd/2019/04/25/an-unexpected-benefit-of-standardizing-on-clang-cl/ https://blog.mozilla.org/nfroyd/2019/04/25/an-unexpected-ben... [4] https://docs.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-160 https://docs.microsoft.com/en-us/cpp/build/clang-support-msb...
- userbinator 5y agoSpeaking from experience, because MSVC (and also ICC) is far more sane with how it interpets undefined behaviour.
- xvilka 5y agoRelying on UB in programs is a recipe for disaster. It should be avoided rather than workarounded by compiler. There's UBSAN, various static analysis tools to fish out UB, developers should use them instead.
- TinkersW 5y agoMSVC track record is poor, but that isn't relevant to today, it is actually ahead of GCC/Clang for tracking the standard if anything. You can use both MSVC/Clang-CL.. The primary reason I find to still use MSVC is that it compiles faster.
- pjmlp 5y agoIf you want do the Windows development with raw Win32 C APIs and zero tooling that is. Most of us live on .NET and C++ mixed code bases, and enjoy our IDE tooling for all levels of Windows stack.
- howtofly 5y agoI cannot imagine Clion, which lacked proper Autotools/Makefile support a year ago, dominate the embedded world now. Due to the immaturity of LSP, the same doubt applies to VScode. Eclipse CDT, the long time king in embedded world, has been deliberately hidden from the default list. You have to click 'all results' to see it. Such a nasty trick! PS: Eclipse can support all project long before LSP/Clion appeared, provided that 'CDT GCC Build Output Parser' is setup properly.
- new_realist 5y agoCDT is dog slow, though. It is painful to use.
- pjmlp 5y agoMoreso anything JetBrains on same hardware.
- howtofly 5y agoFor the default setting, CDT is indeed very slow for large projects like Chromium. However, make change to eclipse.ini (providing large heap, the larger the better) and some preferences (mainly for how the code indexer works), CDT works smoothly for very large project. Just check the following link: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/linux/eclipse_dev.md https://chromium.googlesource.com/chromium/src/+/refs/heads/... https://developer.mozilla.org.cach3.com/en-US/docs/Mozilla/Developer_guide/Eclipse/Eclipse_CDT https://developer.mozilla.org.cach3.com/en-US/docs/Mozilla/D... Please note that 16G RAM is assumed, I use 32G on my own laptop. I use Eclipse CDT for more than ten years successfully on all kinds of embedded projects.
- lenkite 5y agoThis is understandable. CDT is a true competitor to CLion in the embedded space. (vscode isn't). Hence Jetbrains is incentivized to diminish its visibility where-ever possible.