4 ms·
I've considered doing this - I spend so much time learning new languages that I am average in many but not an expert in one. However, when I look at what langua
by exdsq 5y ago
I've considered doing this - I spend so much time learning new languages that I am average in many but not an expert in one. However, when I look at what language to pick for that 'one', I can't decide. It's gone from Python -> Common Lisp -> Rust, etc... What are some arguments for C++ to be The One?
- mdpye 5y agoThat it includes almost every possible feature ever posited in a language? /jk, sort of It's kind of a double edged sword...
- vnorilo 5y agoC++ has a great reach, from bare metal to very high level of abstraction. It can be squeezed to support almost any paradigm, oop to functional. You can make dynamic object systems, build a reflection system or a garbage collector. You can do compile time programming. In general, a systems language is a great asset in your toolbelt. A high level one can let you shape your own environment to great detail. In the end I think most systems languages will take you to a similar place. Many others have fewer footguns or better ergonomics than C++. Its distinctive feature/bug is having no opinion of almost anything. Or alternatively, you can find subcommunities with almost any opinion.
- exdsq 5y agoBut is it truly practical to use in 'higher-abstraction' apps like web or mobile? I mostly work in higher-level systems programming but dabble in most areas when I want/need to.
- rramadass 5y ago>But is it truly practical to use in 'higher-abstraction' apps like web or mobile? Yes absolutely. Once you become familiar with the language the barrier is not that high. Familiarity trumps everything else. That said, since i am not a Web/mobile developer i had collected some resources to help me learn how to use C++ for Web/Mobile apps, you may find it useful; https://levelup.gitconnected.com/cross-platform-mobile-and-web-development-with-c-explained-aac9952b4f8c https://levelup.gitconnected.com/cross-platform-mobile-and-w... https://github.com/Microsoft/cpprestsdk https://github.com/Microsoft/cpprestsdk https://medium.com/@ivan.mejia/modern-c-micro-service-implementation-rest-api-b499ffeaf898 https://medium.com/@ivan.mejia/modern-c-micro-service-implem...
- jahnu 5y agoWeb and mobile is possible but anyone experience in both will realise c++ is only suitable for a minor subset of these.
- vnorilo 5y agoI have been working on many mobile apps that would share a C++ model between iOS and Android, and use platform-specific code for views.
- typon 5y agoNot really. If you want to do iOS development, there's no point in using C++. The Swift interop with C++ is very painful. I think for Android development, the NDK support is much better and there you might be able to leverage C++ much easier.
- rramadass 5y ago>Its distinctive feature/bug is having no opinion of almost anything This single phrase has clarified the workings of the C++ standards body like nothing else; When in doubt, add it in!
- jahnu 5y agoHistory shows this to be just plain wrong. There are many examples but for example look how long doubts about concepts held back that feature.
- scott_s 5y agoThis very submission is 160 pages documenting this very fact.
- jahnu 5y agoIndeed. I have a lot of sympathy for the viewpoint that c++ is a very very complicated language in it's entirety, but not much sympathy for the idea that features are added willy-nilly. It's a product of its time, massive success, and a herculean effort to retain backwards compatibility. It can be frustrating at times but I can seem to make great things with it still.
- rramadass 5y agoSee my other post in this thread for some reasons making C++ "The One" language to learn. You mention; >I am average in many but not an expert in one This is exactly why i am always wary when people give me a long list of languages they "know". They may know the superficial syntax but not the commonly used "idioms" of the language which is what is necessary for fluent expression in the language. This takes time and effort which i would rather spend with a single language and try to truly "master" it as far as possible. The situation is exactly analogous to learning "Natural Languages". You may be fluent in one or a couple while knowing a few introductory phrases/expressions in half a dozen more.
- wly_cdgr 5y agoAll the coolest problem domains (embedded/robotics, games, creative content creation software, systems) run on C/C++ and will for the rest of your career. If you dual wield C++ sword and Python dagger it gets even better (computer vision)
- exdsq 5y agoGood point. I think the rust hype threw me off incase it's going to replace C++ but I do agree with GP in that it's probably going to be more like a C/C++ split. This post has convinced me to look at C++ again. Last time I used it I got put off by the lack of dependency manager so linking things like Boost sucked. Any tips on a modern tool chain?
- wly_cdgr 5y agoI'm very far from an expert, but Microsoft has been making some nice ecosystem improvements. Check out vcpkg if you haven't had a chance to yet
- pjmlp 5y agoTo pick on the sibiling comment, these are the C++ versions of crates.io. https://vcpkg.io/en/packages.html https://vcpkg.io/en/packages.html https://conan.io/center/ https://conan.io/center/ Plus they can also host binary packages, so you don't have to build the world, just your own stuff. For some of us that matters.
- tialaramex 5y agoThey certainly are package sites, but they don't seem very like crates.io I looked at random at the "quote" crate on crates.io and, since I've heard of it and it was on that front page, the "abseil" package from vcpkg First thing I'm wondering is, is this the thing I thought I might need, or did I mishear somebody and I wanted a different thing? Crates.io provides me detailed information about the crate in one click. Yes, this is what I hoped it was, and here's a great description of how to use it. But on vcpkg there's a single line describing Abseil, and it's cut off for some reason with no indication how to read more. Maybe if I paid Microsoft money I'd know? No idea. OK. Let's use assume we did want this, both are clear here, crates.io gives me the text to add to cargo to use quote in my program, while vcpkg tells me to invoke a slightly awkward command to get abseil, but either would become natural very quickly I'm sure. Now, we need a bit more information. On crates.io in two clicks I'm looking at programming documentation for quote, explaining how I should use it with working examples. In one more click I'm reading syntax highlighted source code for the actual quote! macro, in case I'm curious how that works. I am suitably horrified, I definitely want somebody else to solve this problem for me. But on vcpkg after a few moments with no idea I realise that the Octo-cat icon labelled "Star" is a link to a GitHub repo for Abseil, and this seems the only possible way forward. Alas, the GitHub repo also doesn't really document Abseil, but it does eventually produce a link to another third party site about Abseil, and on that site I get told to install Bazel, a build system that Abseil likes so that I can get "started" learning how to use Abseil. OK, maybe Abseil is special. Not good news, but lets try something different. What does vcpkg have in the way of Hazard Pointers? It suggests libcds. We can again get to a GitHub, which provides us with a (HTTP) link to a doxygen doc site. Clunky but functional, at least it doesn't want me to install separate build tools. I could learn how to use this, although it lacks search and the examples are poor it is serviceable. But you're right, vcpkg can include binary packages and so you don't have to build the world and if that is all that matters you're onto a winner.