Wed 01 Dec 2004
The Geography of Thought
Category : Commentary/GeographyOfThought.txt
I was re-reading that last sentence in that previous post - "But part of growing up is to accept life for what it is and just move along." That's so typically Asian isn't it? That's what we teach our kids. And bind us to that peasant of long ago, bent beneath the weeping willow, resigned to eternal cycles of flood and famine, and taxation from the Yellow Emperor.
But, switching back to our modern age, if that were so, why not throw it all in and accept the dominance of Windows? Surely, resistance is futile. Why spend so much effort trying to change things?
I've picked up a book called "The Geography of Thought". It's an interesting discussion about the ways Easterners and Westerners differ in their patterns of thought - and why we differ and how we came to be so.
But what if we're tending towards a new synthesis, an amalgam of west and east? It may not necessarily be better, being neither here nor there, and it's quite possible we may end up with all the worst from both cultures.
It's quite interesting reading this book, living in Singapore. We're at the cross-roads, subjected to such a hodge-podge of influences that we could go either way. Or neither, and find something uniquely our own, for better or for worse. That's what we're going to leave our children. Because of that, we ought to give it some thought.
The Story of Audion
Category : Technology/audion.txt
This is a good story, relevant to all software developers, about Audion, the MP3 player on the Mac that almost became iTunes. I really love its tone - not bitter and very generous.
Java and Objective-C Development on Mac OS X
Category : Technology/JavaAndObjC.txt
Objective-C code may look daunting at first, but it's really mainly C code with extensions to the language to deal with objects and message passing.
Both Java and C are small, compact languages that can (each) be learnt in one weekend - that is, if you're determined and start on a Friday night. Good books to use include the "Java in a Nutshell" book from O'Reilly and the Kernighan and Ritchie book for C.
The "Java in a Nutshell" book contains a good introduction to object-oriented programming and the advantages of using this approach to control code complexity.
I've got a few books on Cocoa programming but I think the "Learning Cocoa" book from O'Reilly is actually good enough to get started (I have the original version that was much maligned but the second edition by James Duncan Davidson should probably be better). I found some of the explanations mystifying (in my original version of the book), at least initially, but it contained very good, useful, sample code that you can adapt quite easily to do your own stuff. And, after a few rounds, things do become clear.
The important thing is to learn by doing - to plunge in and set yourself something useful to do by modifying from the given examples. Then it rapidly becomes clear what it is that you don't yet know, and from filling in the pieces, you start to create a mental model of how Cocoa works. I think there's a certain point where everthing clicks and you start to see the patterns in the way Cocoa works and learn to flow with it. (That's why there is a book called "Design Patterns".)
Now, I think we (Hai Hwee - who wrote Luca - and me) took a longer (and much harder) route into Cocoa by starting with Java. Cocoa's native language is Objective-C, and, though it is possible to write Cocoa apps using Java, you always have to translate the Objective-C calls into their equivalent idiom in Java, and there are far fewer sources of information about writing Cocoa code using Java. (As Aaron Hillegass says, in his book "Cocoa Programming for Mac OS X" 2002 edition - "Using Java with Cocoa"? "Don't ...").
But we have a lot of stuff we've invested time in building (database and web server stuff that call Oracle and MySQL) and it was easier to extend the Java code to work with a Cocoa front-end than it was to rewrite all that stuff in Objective-C. And where was the database solution on Cocoa in Objective-C, then? Nothing, not a single thing at all. No wonder there was not much going on for business applications on Mac OS X.
But, now, there's the possibility of taking advantage of CoreData in Tiger. One of the problems we have with Luca (besides the fact, I think, that it requires a good inventory module to make the system really gell for an end-user), is that it's too big a download. We can't assume that a user has MySQL loaded on his Mac. That is the target database that Luca uses. So we include a MySQL download. Even if a user has MySQL, we often have problems making Luca work with that existing installation. So it'll be great if we can assume that there is a database that comes with every Mac. And target Luca (and any other business application that we hope to build) to work with that common platform. And our applications could then become smaller and be easier to download.
So that's why I think we could expect to see an explosion of business applications on the Mac. But it all depends on how good CoreData is.
I do wish Apple could stop re-inventing the wheel and re-use stuff that are already out there - like all that JDBC stuff that work with almost every relational database solution on earth. Or, choose MySQL to bundle in rather than SQLite. Or make Objective-C work a bit more like Java in terms of memory management (all that "release" and "retain" code give me a headache).
We've now got two great platforms to create applications with on Mac OS X - Java and Objective-C, and Cocoa. It'll be great to get the best of both worlds. But part of growing up is to accept life for what it is and just move along. So on we go.