How Microsoft Uses C++ to Deliver Office Applications Across Multiple Platforms
youtube.com
youtube.com
Use other languages in the interface for different platforms,or in the testbench code.
We got to this conclusion after years of painful practical problems, but it is hard because it goes against the common philosophy of theoretical people that write best practice books(but not code too much) and natural inclinations of programmers(to use the new shiny thing).
The core of our software is grabbing data from an external device and signal processing. On top of that we've built a plain C API, an plain C RPC lib over TCP with the same interface as the main C API, and a C++/CLI dll for interfacing with .Net. On top of that we've built the main C# ui and a lot of custom applications in C/C++/Labview/Matlab/Python. And it all just works which makes me wonder wether there even were other choices than C++ for this particular job.
It seems like C++ keeps getting shinier. Though organizations might try to stick to a limited subset of C++ anyway.
I agree with both points. And I'm glad the shiny new parts of C++ are very usable
Oracle ignoring the mobile OS eco-sytems and not providing either JVM or AOT compilers is the problem.
Why keep people mixing languages with implementations?!!
The mobile VM you speak about, were the J2ME VMs, usually done by the device manufacturers themselves, not by Sun.
Java, The Programming Language Specification does not require the Java Virtual Machine Specification to run. Any implementer is free to take any approach to turn Java code into executable code.
Yeah.
And for good reasons. Reminds me of the initial complaint about "no flash in iPhone", then someone managed to put it in an Android tablet and then they realised what a bad idea it is.
Because it's their platform, and they are not a monopoly in the mobile market (more like 20-30% in EU).
>* They're shutting out Flash and Java*
Yes, amen to that (though it's: Flash and Java applets).
>and yet Google get nailed to the floor despite supporting a pretty liberal, almost completely open source mobile OS.
Well, "almost" is the key word. The main value proposition behind Android is in the Google apps integration, and Google is very adamant about who and how gets that in a MS circa 1995 way.
Besides, the reasons they "nail" Google to the floor has nothing to do with Android, but about it's monopoly on search and the abuses of it.
Java the language specification != JVM bytecode.
There isn't any transpilation to Objective-C involved.
SDL was ok for games, but now with a real app, I tried the Qt way, only to discover there are still lots of issues.
So I figured out, better use JNI and C++/CX directly and save the pain of figuring out bugs in Qt.
In the end, the JNI pain is bigger than figuring out Qt bugs and helping those guys.
For small devshops there is a lot of time to be saved by letting third parties like Digia and Xamarin have to go through the pain of writing platform specific wrappers.
If I was doing mobile OSs for work, I would gladly pay for them.
One of the weirdest things we had to overcome was actually the cultural aspect. For the Linux client, nobody had any problem with the architecture: Get the Qt client working and hook it up to the plumbing. Done. For the iOS guys, still no problem, but let's make sure we separate the C++ cleanly from the Objective-C through a solid, well-understood interface so our food doesn't mix. The Java guys basically threw a hissy fit, objecting to all of this C++ nonsense infecting the purity of their Java. Every time the app crashed: they blamed the C++ code. Every performance problem was because C++. Grandma got sick? C++. When tracking down a bug, they'd step through their Java layer, and as soon as it hit the JNI, they'd just stop and file a bug to the core team rather than dirty themselves stepping through C++. They culturally wouldn't accept C++, and wanted to instead have a separate parallel tree with Java business logic, Java math, Java graphics, etc. The hard reality, however, was that the Android client wasn't bringing in enough revenue to justify a full parallel team and code base. Despite all the grumbling, going the C++ route was a huge success, letting us support multiple platforms with mostly the same code base.
I'm curious as to whether this borderline religious anti-C++ attitude is common in the Java/Android ecosystem, or an outlier? I found it really bizarre.
So it is natural in a world full of out of bounds exploits, hazardous pointers and use after free/delete, to complain about them.
As for Android, it comes even from the Google team, given the little support they give to the NDK.
I know the old argument was that it was easier to audit the (small) amount of native code in the JVM than the code in your specific project. But half a million lines isn't small by any definition I'm aware of. It's larger than any native projects I've worked on.
Besides there are JVMs implemented in Java too, just not with as high performance as Hotspot... search for Maxine or Jikes RVM.
And, really, who wants to use a language designed for people who don't know what they're doing?
I'm not saying that it's impossible to write a JVM in a managed language. Just that it's funny to hear people talk about native languages with a hint of fear, and then run their "safe" programs on a VM that is implemented with a half million lines of C and C++.
It's a well known result of theory and practice among people who start delving into more provably safe languages.
http://www.reddit.com/r/gamedev/comments/xddlp/describe_what...
At the moment I can definitely share an Ugly part - the code has thousands of #defines everywhere, and you will find parts with C++11 code(for PS4/X1) and parts which use some hardcore custom methods for everything since they don't have access to STL(for WII....which is a horrible console to write for). So within one file you can see code which uses autos and for each(C++11 parts) and then bits which can't even use Vectors. It's bizarre. And then you have gigabytes of ram on next gen console, but everything you do also needs to fit in the tiny, 128MB ram of WII. It makes you really aware how you write code - which I think is good.
The biggest takeaway for me is that investing in c/c++ paid off immensely for Microsoft. For a massive codebase that's 30+ years old this is a huge win. No other programming language could have and still give that level of ubiquity.
It also highlights how important it was for C++ to have stayed backwards compatible with C, despite the pain.
c++ (and c) is here to stay.
http://www.sabayon.org/article/sabayon-runs-android-market-g...
(Also kernel is patched and GPU drivers don't use X compatible interface for acceleration.)
I had to add a driver for a USB device and it was Linux to me. I could not have done the same for BSD (never used it) or Windows using code from Kernel.org . I have personally used an Android kernel to boot one of those arm `mini-netbooks` into xfce.
Indeed you would find that glibc has iterated through different ABIs but we don't call these different operating systems, and we can fix them by simply installing the appropriate binaries.
You have a 100% Java based userland, and only a very limited set of C and C++ libraries available to native applications. There isn't even a full POSIX support.
Google could change Linux kernel with e.g. QNX, and hardly anyone would notice.
You're misunderstanding. It's not criticism, but a statement of facts that the only thing Android has in common with most desktop Linux-distros is the kernel. Apart from that they share literally nothing.
Tweaking your Gentoo installation still makes is a Gentoo-installation, and thus a normal GNU/Linux environment.
But if you change the init-system, remove all userspace tools, lock it down so users can't have root, ditch X for something else and only run apps designed for your non-X graphical environment, with each user-facing app running as their own Linux user-account...
Would you call that a "normal" Linux desktop? Probably not. And that's the point. Android isn't conventional Linux. (Which is probably why it's so successful, but that's flamebait for another discussion)