Help me understand ...
- The C++ cross platform advantage exists because C++ is not tied to any OS -- true?
- Because of this C++ programmers cannot (or should not) access underlying platform dependent API's -- true?
- C++ is self-contained. similar to Java -- true?
- Do C++ programs provide garbage collection/ARC or is that the responsibility of the programmer?
- Because it's been around a while, C++ has a less modern syntax, and more housekeeping, than other, newer, languages like Swift -- true?
Your statement that Swift is "tightly coupled with iOS and mac now and with the cocoa frameworks" is true -- but I think that is just a means to an end. Apple made Swift viable, day 1, because of this tight-coupling and automatic-bridging to Cocoa frameworks, But, as we speak, these frameworks are being reimplemented as Swift frameworks.
My point here, is that it is possible that, in the near future, Swift will/could be a robust, self-contained package that does not depend on platform-specific frameworks. Much of this is possible because of modern clang/llvm implementations -- Soon, it might just be possible for Swift to deliver on the promise of Java: Write once, run anywhere!
To satisfy the [cross-platform] needs of developers, the whole package: IDE and Self-contained Swift: could be made available on major platforms or online ... in the worst case, the developer would need to use a Mac for cross-platform Swift development ... But, a developement Mac, actually should be an advantage -- because you can run virtual copies of all the other major OSes on a single Mac.
Again, I have zero experience with C++, but the stated (promised) advantages of Swift are:
- fast running code
- safe code -- if it compiles it will run.
- clean code (little or no housekeeping and glue code)
- readable, maintainable, self-documenting code
Those sound like pretty big advantages to me!
Yes, but the language is not the framework. C++ is basically used in cross platform code to handle data manipulation and interactions with databases ( which are platform independent since SQL is mostly a standard).. I don't think too many people *even* use it for network api - those are possibly the same on UNIXEN but not guaranteed to work on Windows.
To write a swift app which talks to the cocoa frameworks which is write once and run anywhere needs the compiler to generate code which will run anywhere, which involves adding the frameworks cross platform ( which NEXT actually did back in the day but its a lot of work), or to run in some kind of virtual machine, like JAVA. Neither is great.