Why all platforms should support C
This is a little rant to people that think managed languages and sandboxes are the way to go. We've been doing lots of development on Mobile platforms. We started on iPhone with Objective C. This was fine, but we knew we must go to Android in the future - and there lies Pain. So when the day came, we rewrote the entire app in C. This wasn't that hard, but took a couple of months - and longer if you factor in bug squashing. It involved pretty much every line being changed. The UI went platform neutral OpenGL, and we though: "That's it, we're no longer locked to anything". Android has the (poorly supported - where's your MT debugging??!) JNI interface. We could see Nokia with S60 had a C environment, and PC and Mac would be a stone's throw away - should we ever get rights to them. Everyone supports C right?
D'oh. Nokia then imploded - killing their products and customer base. "Everything we make is now obsolete in 12-18 months, we're going to Windows Phone 7". Top tip: if you plan such a radical change, do it slower or at least wait until you have something for your customers to actually buy! Cheers. But WP7 will support C right? Like WP6.
Wrong. Microsoft seem to have decided in their wisdom to support only .Net C sharp. They then produce "How to" guides to port stuff to their platform. This is not useful. Any developer worth their salt can easily recreate their work in another language. Guides and semi automated fudges are only good for the first five minutes of any port. If every line must change, it must be rewritten. This takes time, but its worse than that. Its a support nightmare. Every bug, every improvement, every change must be done twice from then on.
Now add the fact that Blackberry is Java - though they've seen the light and QNX is coming that supports proper native development - and you have 3 platforms. That's 3 versions of the same file doing the same things, in slightly different ways. They never marry up fully, as you have UI code that must be different, and simple features that don't exist.
Which is the next problem. We don't actually write all our code. A dirty little secret is no software engineer does these days. Everyone relies on BSD stuff, and libraries to do things. We use zlib, libxml2, libpng, and curl - industry standards, of which only zlib has been ported into the core of non C languages. We're always looking around too for better libraries, so the recent WebP library looks good for storing our source assets. It makes our track assets 30% smaller than our PNG optimized versions with no loss over the original source!
Managed language versions? No chance. You'll be stuck with what ever version was current when they were put together. So please everyone who's putting together platforms see sense. Have your managed environment if you like, but make sure that you can call out to native code easily. You'll get the best versions of everything, and benefit from coders not chasing their tails trying to maintain lots of versions of the same thing. Oh and of course performance will be better too. As a frame of reference our Objective-C code to C code rewrite saved 3 times the memory, and ran 6 times faster. I expect Java and .Net to be even worse on these little devices.
Finally, to any hardware manufacturers reading this: a recentish build of Webkit is a must (fat chance MS will do this, me thinks, but others have got the message!). Webkit completes a platform giving bulletproof HTML support with fast JS, allowing lots of tedious UI building to be cross platformed. If course if you can build C you can bring your own to the party, but its nice to see the OS support this out of the box (saving you the download)...
D'oh. Nokia then imploded - killing their products and customer base. "Everything we make is now obsolete in 12-18 months, we're going to Windows Phone 7". Top tip: if you plan such a radical change, do it slower or at least wait until you have something for your customers to actually buy! Cheers. But WP7 will support C right? Like WP6.
Wrong. Microsoft seem to have decided in their wisdom to support only .Net C sharp. They then produce "How to" guides to port stuff to their platform. This is not useful. Any developer worth their salt can easily recreate their work in another language. Guides and semi automated fudges are only good for the first five minutes of any port. If every line must change, it must be rewritten. This takes time, but its worse than that. Its a support nightmare. Every bug, every improvement, every change must be done twice from then on.
Now add the fact that Blackberry is Java - though they've seen the light and QNX is coming that supports proper native development - and you have 3 platforms. That's 3 versions of the same file doing the same things, in slightly different ways. They never marry up fully, as you have UI code that must be different, and simple features that don't exist.
Which is the next problem. We don't actually write all our code. A dirty little secret is no software engineer does these days. Everyone relies on BSD stuff, and libraries to do things. We use zlib, libxml2, libpng, and curl - industry standards, of which only zlib has been ported into the core of non C languages. We're always looking around too for better libraries, so the recent WebP library looks good for storing our source assets. It makes our track assets 30% smaller than our PNG optimized versions with no loss over the original source!
Managed language versions? No chance. You'll be stuck with what ever version was current when they were put together. So please everyone who's putting together platforms see sense. Have your managed environment if you like, but make sure that you can call out to native code easily. You'll get the best versions of everything, and benefit from coders not chasing their tails trying to maintain lots of versions of the same thing. Oh and of course performance will be better too. As a frame of reference our Objective-C code to C code rewrite saved 3 times the memory, and ran 6 times faster. I expect Java and .Net to be even worse on these little devices.
Finally, to any hardware manufacturers reading this: a recentish build of Webkit is a must (fat chance MS will do this, me thinks, but others have got the message!). Webkit completes a platform giving bulletproof HTML support with fast JS, allowing lots of tedious UI building to be cross platformed. If course if you can build C you can bring your own to the party, but its nice to see the OS support this out of the box (saving you the download)...
Comments