An interesting discussion was sparked on HN by a blog entry on apenwarr.ca. I’ve also been a little… surprised by Google’s choice of technology, but when you think about it, they didn’t have much choice.
What were the options? They needed a widely-used, performant, reasonably easy to understand programming language.
Web apps? No, Apple tried at first to use HTML + JS, but it didn’t work so they moved to Objective-C. Ruby, Python? Ruby is memory hungry, on the slow side and web-focused. Python is a little faster, which might work if one or two, or even six mobile Python apps were running at the same time. But what about 20 apps?
Objective-C might as well be owned by Apple. C is much too low level and other languages are either niche languages or too domain specific. The only realistic choices for a mobile platform were and still are C++, C# and Java.
Should Google have picked C++? They didn’t have a programming library: by the time Android 1.1 was released, Trolltech had already been bought by Nokia. It’s really hard to create a quality C++ library from scratch, and they probably didn’t care to deal with a third party like Nokia.
What about C#? Google (and pretty much any company) prefers to own the core technologies and decide their fates. If they would have picked C#, Microsoft would have had an important word to say when it came to Android’s future. That left them with Java. It’s popular. It’s also easy to learn, has good enough performance and a massive class library. The only problem were the licensing fees that they had to pay to Sun, but they got around them – or so they thought before Oracle – with Dalvik.
In the end, was Java a good choice? Before the Oracle lawsuit, it seemed so, but Google couldn’t know that Oracle would buy the friendly Sun. They will bitterly fight Oracle, since they have too much of an investment in Java and Dalvik now.
In the mean time, I wonder if anyone inside Google is looking at Java alternatives. There’s already a Qt port for Android, and some official Google love wouldn’t hurt at all.