Originally Posted by unknownone
The problem with C++ is it's not type-safe, it only pretends to be. You can nuke the type safety anywhere. (Although the same is kind of true for C# with reflection.)
The other problems are lack of higher level features like lambdas, reflection, coroutines, and lack of a standard threading model. A lot of these features have been added and finalized, but the new specification is not yet published, and no compiler has fully implemented the new spec. You can get parts of the new version of C++ in MSVC++, GCC and Clang though.
And then comes the problem with libraries. There are many, but they are generally all incompatible with each other, or have some essential features missing. You end up juggling through many libraries to get exactly what you want. (And as for running on all platforms - that's a joke, due to the library situation). Actually C# is way easier to port between major platforms now, due to more consistent libraries.
To give a library example, take boost::asio for networking. It's been considered a defacto standard for async networking in C++ due to it's portability and ease to use. The problem? It uses boost::shared_ptr<>, which is incompatible with the now standardized (and massively improved) std::shared_ptr<>. Meaning, whenever you need boost, you can't use some standard library features which are incompatible.
I was trying to get back into C++ after years hiatus learning and using C#, but the number of problems just put me off. It's in an awkward state until the C++0x specification is implemented properly in compilers, and many libraries, particularly boost, shift to using the new smart pointers and other newer features of the standard library. Then there's the tooling - IDEs, debuggers, profilers etc need updating to work with the new language. If all that is done, the language will return to a state where it can compete with C# in terms of high level abstractions.
Oh, and as for Battlefield using Python - it only uses small amounts of it. The game engine will still be written in a low level language like C or C++, and languages like Python are only used to script some game logic, AI and such, which doesn't require intensive computation. Python is very slow compared to even C#, let alone C++, and you'd be lucky to get 1 frame per second of high quality 3d graphics in it alone.
|