3 ms·
C++ is of course a vastly more complex language than Swift. I don't think anyone would want to code in C++ these days if they can avoid it.
by zozbot234 5y ago
C++ is of course a vastly more complex language than Swift. I don't think anyone would want to code in C++ these days if they can avoid it.
- gumby 5y agoActually plenty of people do want to and do so.
- jlarcombe 5y ago...and of course it was simple to interoperate with Objective-C in C++, in a way that it isn't for Swift, sadly
- gumby 5y agoWhich is super annoying when you have an engine written in C++, perhaps that runs on multiple platforms, and want to run it with a GUI under macOS.
- BorisRasin 5y agoYou can use Scapix Language Bridge to automatically generate bindings for various languages directly from C++ headers: https://github.com/scapix-com/scapix https://github.com/scapix-com/scapix Disclaimer: I am the author of Scapix Language Bridge.
- germandiago 5y agoI want. I do it. It gives me a level of control and a number of libs that no other language can give me, including all the C libs available as well. Yes, it is not pretty sometimes, but if you take a look at well-written C++ code you would be very surprised at how clean it can look. With its quirks from time to time, but very clean: - mark virtual overrides with override - use move semantics to increase performance - take advantage of RVO - write GUIs, CLIs, or servers - use lambdas and ranges - use smart pointers to get rid of most memory management - tune your server to allocate and deallocate in the desired patterns via polymorphic allocators or just plain allocators - take advantage of SIMD and parallelism (via parallel algorithms library, among many examples) - create generic infrastructure in algorithms with zero overhead penalty that is not even possible in other languages - keep things working for the next 2 or 3 decades without touching the code - Program in HPC environments C++ is much better than what most people that do not use it all the time think. It is not as bad as they put it, and, more important, it is very high performance. I admit this is one of the big reasons why people use it, but C++ for application programming does not look to me like crazy either.
- deleted 5y ago[deleted]
- lpapez 5y agoIf besides best possible performance you also value ergonomics, security, maturity and tooling then IMO nothing comes close to C++, especially C++17 and later. Not that there is much choice really, only C and Rust can realistically get you comparable performance, each with their own problems.
- mpweiher 5y agoa) I wouldn't be so sure that C++ is actually more complex at all, never mind vastly. It may be less forgiving... :-) b) With C++, you're at least getting something for all that complexity: performance and control.