15 Most Recent [RSS]
More...
|
Mix it, Baby!
Just found James Duncan Davidson's article Sometimes Carbon isn't that bad.... I'm an old Carbon nut (actually I started with Classic Toolbox in System 7) who came to Cocoa and loved it. So, it may not be too surprising that I agree with him. However, I think he's only gone part of the way:
Why not extend this to other languages? In the end, programming languages are all just tools. And there's always the right tool for the right job. While most people do not know it, Apple and the GCC folks have managed to make it easy to integrate all sorts of languages into a Mac app these days.
Even in the MacOS 10.0 days it was already possible to mix assembler, Smalltalk and any other GCC-supported programming language into your sources. NeXT one-upped them by choosing Objective C instead of Smalltalk, which, being a C superset, allows integrating any C code you want right into your application. And then we got Objective C++, which allowed the same for C++.
But Apple didn't stop there: They built various bridges between Cocoa and other languages. The first time I looked at the docs for the Cocoa/Java and Cocoa/AppleScript bridge, I was shocked to find out how easy it is to mix-and-match between these languages. If you've used CoreFoundation's toll-free-bridged objects, you've still been suffering more than you should have.
And the open source community picked up the ball. There are now numerous other bridges for up-and-coming languages like Ruby and Python, there's StepTalk that can be linked into any application to surf around and look into your app with powerful Smalltalk syntax (including blocks, which are way cooler than enumerators, and much less typing work).
Now granted, I haven't had the time to use most of these yet (so far I stopped after AppleScript, Java, C and C++), and AFAIK StepTalk has only recently been ported from GNUstep to OS X, but the Mac isn't just some fancy digital hub that promises one day that it can do the same as your TV, just that you can additionally browse the web during commercial breaks (*grins*). Due to the Carbon/Cocoa/Java dichotomy, the Mac has instead become one of the best platforms for integrating heterogeneous systems.
Instead of the old scheme where you picked the language that offered the best features for 90% of your project, you can now decide anew for each part. And Apple keep adding new open-source packages. 10.3 IIRC added Python and the PHP command-line tool.
Of course, mixing and matching opens its own can of worms. If a core part of your app relies on an exotic language, it may be hard to find people who are qualified to work on it. Also, it will limit mobility of your programmers. If the parser is written in Perl, you may not be able to have the C++ programmer who does the GUI apply a quick fix when you're in a tight spot.
But even if you use only two languages, and one of them is one of the popular ones, that may save you the time you need to speed past your competitors with a more mature product.
... well, at least that's the theory... :-) | |