Friday, July 29, 2005

Expressive Smalltalk

This is why I really like Smalltalk (and it's dynamically typed companions).

Determine the date at 12 days and 5 hours in the future!
Smalltalk:
future := DateAndTime now + 12 days + 5 hours.
Java:
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.DAY_OF_MONTH, 12);
cal.add(Calendar.HOUR_OF_DAY, 5);
Date future = cal.getTime();
(Sun could at least make Calendar's add method return the Calendar itself so that we could daisy-chain the add calls like cal.add(...).add(...)).

Now tell me, which one is more expressive? This is exactly the advantage of the "everything is an object" principle. And maybe this expressiveness is the reason why in-language Domain Specific Languages (http://martinfowler.com/bliki/DomainSpecificLanguage.html) are so much easier to implement in languages like Smalltalk than in this Java crap.

Monday, July 25, 2005

Into Smalltalk

I think it is a good idea for a software developer to frequently learn a new programming language (http://www.pragmaticprogrammer.com/loty/). Even if you don't need the language at work, it'll change the way how you look at problems. So for this year, I decided to learn some Smalltalk. Well, I have to admit that it is not totally new to me. I've done a bit Smalltalk a few years ago but it was fairly basic. This time, I'll do a little application to cover different aspects and to really learn the language. The application is about recording working times for the projects I'm working with. Nothing spectacular but I think it has the right size for a "pet project". The application will get a small web interface which I plan to implement in Seaside.
After checking out Cincom Visual Works and Squeak, I opted for the latter since it runs at reasonable speed on nearly every platform. Visual Works is also pretty cross-platform but the user interface was so damn slow on my PowerBook that I wasn't able to really work with it. Squeaks user interface is, well, some sort of ugly but it's ok and very functional. And because my application will get a web interface, I don't really care about this.
Finally, I found a great book that's freely available online. It's called "Smalltalk by Example", you can get it from http://www.iam.unibe.ch/~ducasse/FreeBooks/ByExample. I immediately liked the style this book is written. If you are an experienced software developer, you can get the important things out of the book without having to read through much "noise". It's also a very good reference.
Oh, and one more thing at the end. There is a great intro into Squeak available at http://wilkesjoiner.com/UsingSqueak.html. It contains some nice videos.

Wednesday, July 20, 2005

Vindaloo 0.2

I completed the second increment of the Vinaloo PDF reader. Along with this comes an updated version of PopplerKit.
Download links:
The OSX version of Vindaloo comes bundled with PopplerKit, you don't need to install it seperatly. You only need PopplerKit for OSX if you want to do development with PopplerKit. The GNUstep archives contain the sourcecode which has to be compiled. This is done using the standard make and make install procedure. Vindaloo 0.2 won't work with older versions of PopplerKit. Installation instructions for PopplerKit can be found in the docs directory of the distribution. Please READ them!

What's new in Vindaloo & PopplerKit?
  • page caching for singlepage view
  • center page in scrollview
  • don't shove page into the edge when zooming in
  • adjust zoom factor when the window is resized such that the current page is either scaled to fit completly, by it's width or by it's height
  • better support for fontconfig in PopplerKit
  • minor UI tweaks and bug fixes
What comes next?
A search function is urgently required. At least I wish I had one in Vindaloo almost every day I'm using it. So the focus of the next increment will be to implement a simple search function.

Saturday, July 16, 2005

PopplerKit & Fontconfig

Upcoming changes in the poppler library forced me to spend some effort on integrating PopplerKit with fontconfig. Until now, PopplerKit comes with it's own fonts and bypasses fontconfig using the "old" font mechanism from xpdf. The poppler library is currently changed to use ONLY fontconfig. I now figured out how to integrate fontconfig. On OSX, PopplerKit will setup it's own fontconfig configuration with the default OSX font locations (/Library/Fonts,...). On GNUstep, PopplerKit will use the system wide fontconfig library and it's configuration. In both cases, some default PDF fonts that are bundled with PopplerKit will be added to fontconfig's configuration such that at least the minimum set of required fonts is available everywhere. GNUstep users will benefit most from proper fontconfig integration since PopplerKit (and thus the Vindaloo PDF reader) can make use of the system wide fonts. As a side effect, the way PopplerKit "handles" fonts is not much better. The changes are currently in an experimental branch. I need to do some more testing before I move them into the main trunk.

Sunday, July 03, 2005

Hello World!

Hmm, this is my very first blog post so: "Hello World!". My name is Stefan, I'm about 30 years old and a professional software developer with focus on object oriented technologies. Beside this, I'm currently attending to a Master course in software technology at the Unveristy of Lueneburg. This blog will be about thoughts on software development and my projects.