Whats more bizarre is that windows phone 7 does not have a development kit for using C/C++. Only C#/XNA. I've heard on HN that this may change for WP8. I hope so.
Whats more bizarre is that windows phone 7 does not have a development kit for using C/C++. Only C#/XNA. I've heard on HN that this may change for WP8. I hope so.
I can develop ONE piece of core logic, and have it run on iOS, Android, Windows, Mac, even web (via NativeClient). I posted an AskHN about this earlier today (though not much interest). That sounds like a win.
I like C# although mono always failed to be nearly as good as .NET and that hindered C# a lot.
If microsoft had realized it and made .NET multiplaform as well, and open source, we may live in a different world today. Heck, Microsft could be leading.
But then again, rewritting the past is easier said than done.
I would expect the opposite - some runtimes do not allow exceptions, RTTI, dynamic_casting, or simply ABI interworkings due to name mangling and calling conventions for methods. Also virtual inhertiance and it's interworkings (where the this pointer is stored, and how multiple virtual ihneritance is done).
V8 is also C++, but lots of other successfull VM's are written in "C"
I like "C" because it's more limiting, hence I won't see templates overused, or latest trick used (SFINAE). It's also easier for me to read.
Also at binary level things are simpler - here is your function, and it's name, it takes this and this as parameter, and returns this and that, also follows this convetion (stdcall, pascal, fortran, etc.)
With C++ my biggest pain has been name mangling. I'm not sure why this was not standartized. It's actually much better that the name of the function automatically contains what types it can take, which would've been much easier for dynamic binding, but then you have GNU, MSVC and others totally differs on how they mangle the name (and from version to version it changes a lot). Also exception handling (mingw/cygwin/msvc - there is big confusion there, and on binary compability level it's hard to combine one with another).
My last show-stopper for C++ was - on this platform you can' t use this feature. For example on certain game consoles exceptions are not allowed. So you go with longjmp/setjmp, but then this would not unwind the stack and call destructors.
Most of all, I got bitten by a heavily templated math library - it was much faster with optimizations than the one before, but without (debug) it was several times slower than same one before it. Why? Because it was relying on inlining everything, and back then gcc for playstation2 was not really inlining everything, even if it was forced.
So every overloaded operation (matrix by matrix, or matrix by vector) was actually function call.
There is another gotcha - sometimes overloaded C++ operators lose their ability to short-cut. For example overloading && and || would not longer short-cut, and many other gotchas.
Most of all, I can't stand boost - it's just too huge.
But I'm totally fine with C++ the simple way (whatever this is) - best example for me is ZeroMQ lib - it's C++ internally, they limit themselves to not use exceptions, and provide "C" interface by default. This makes it very easy to use from other languages - python, lua, ruby, etc.
My choice right now is Lua + C - for fun & experimentation. I also dabbled with Common Lisp, but haven't touched code in it in months, might get back at it later...
You're right, a standardized mangling scheme would have been nice... but there's always 'extern "C"' if you need a C++ function from asm or a linker script.
Compilers really should short-circuit &&/||... were you using some kind of experimental compiler?
Then again, Linus said C++ developers were dumb and C was better.
Boost is almost a second standard library (it is one reference source used in the standards process), and it demonstrates a lot of what's cool and awful about C++. Boost invented a lot of the smart pointer classes that are now standard and save a lot of boilerplate that makes memory management in C annoying. Boost has things like Asio, which lets you write portable synchronous/asynchronous network code. On the other hand, it has Spirit, which is a massive abuse of operator overloading which is at once both impossibly complex and nifty/convenient.
Linus's opinion is worth noting, but he's hardly the best source.
And that's not a bad thing. I love C#/.Net (one of my projects, Tagxedo, was built with Silverlight), but given Microsoft doesn't have even the slightess will to push it, we may as well move on, or find some way to ride Mono. C++ is currently on my mind since it covers all ground (sans UI, which you still have to do anyway), probably in a way more straight-forward than Mono.
Derived from Win8 != WinRT- could just be the kernel and not app model.
I guess Armin Ronacher's blog post here makes a pretty good introduction: