This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Real OO
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Perhaps this is why OO as done in Smalltalk differs so much from OO done in languages like Java, C#, and C++:
Smalltalk is a language that makes true OO programming so cheap that you're more often than not benefitting from a pure-OO (possibly with patterns) approach to coding for pretty much everything. The syntax is negligable, so you're not really adding keystrokes to your task. There are no files in an image-based operating environment, so you are free to just add classes at will. Duck-typing is everywhere, so types are determined by structural conformance, rather than rigid class hierarchy organization, etc.
However, Java is a totally different beast. Adding a new class to a program in Java is one of the most intensely heavy-weight things you can do in Java! Even defining a new interface, arguably one of the cheapest things to do at the file-level in Java, implies you now need to adjust a number of other classes so that they statically "implement" that interface. Also, there is a strong distinction between internal and user-defined types (int vs. Integer, et. al.). There is no uniform access in Java (myField versus getMyField()), which means you no longer have the cheap syntax to avoid writing getters and setters, which means that you always incur a small performance hit when accessing attributes.
In Smalltalk, it doesn't incur any cost to do OO; in the mainstream languages, it does. This leads to lots of people talking past each other - most Smalltalkers have slogged away in a mainstream language; most of the rest have never seen Smalltalk, much less developed in it.
The article is well worth reading in full - don't just take the quoted snippet as enough :) One small caveat - Smalltalk may be unheard of in many development shops, but it's not dead. Smalltalk is very profitable at Cincom, and was the best performer for Cincom last year :)