Archive for the ‘Smalltalk’ Category

Working by the Seaside

For a long time I’ve wished I could get a programming job using Smalltalk, but, since I’m so new to Smalltalk I doubt that will happen for a while. So, I’ve decided to manufacture one for myself.

You see, at the company I work for I’m the Information Technology Manager. I’ve been kicking around the idea of making our intranet a bit more dynamic in it’s content. Right now we only have static content on it. I’ve been thinking about implementing some application like content (expense report entry, time sheet entry, etc.) on the intranet to try to get internal users to use the intranet more.

I “tossed and turned” over what I should use to develop these dynamic applications. My main choice was between PHP and Seaside. Neither my staff nor myself know anything of great significance about either (although I do know a bit about Smalltalk). In a moment of insanity I actually thought about going with PHP, because, for my staff’s sake, its more “mainstream”. After thinking about it a little further I decided to go with Seaside because while Smalltalk and Seaside are at this point a bit niche, I, in all good conscience can’t choose to go with an inferior language and I can’t choose to throw away a framework like Seaside.

So, I’m going ahead with Seaside and my staff will have to learn to love Smalltalk like I do.

Advertisements

VisualWork-ing Again!

About a month ago I purchased my first Mac. In summary, I love it — but that’s another story.

I tried to install VisualWorks NC on the Mac but found out that the non-commercial edition isn’t supported with the Intel Mac and the Net Installer doesn’t work. I quickly found out, through the VWNC mailing list, that while it isn’t officially supported you can run it under X11. Being a Mac newbie I had no idea how to accomplish this despite all the excellent advice from the mailing list. I gave it a try a few weeks ago but wasn’t successful. I thought I’d wait until 7.5 came out since, from what I understand, 7.5 is supported on the Intel Mac. Well, taking a month off from VW is just too long so I decided this weekend to give it another try and I was successful. I’m not sure if anyone else out there is interested but here’s what needs to be done:

Install X11 on the Mac

  1. Pop the Mac OS X Install Disk 1 into the Mac and when the Finder window opens on it scroll down and double click on Optional Installs
  2. Follow the prompts and when you Custom Install on… page open the Applications list and select X11
  3. When its done you should see X11 under Applications > Utilities

Install VisualWorks – As far as I can figure this can be done one of two ways:

  1. I copied the vw7.4.1nc folder from by old Windows install (C:/Program Files/vw7.4.1nc) to my Documents folder on the Mac.
  2. You could also download the individual files/packages from the Cincom website. These are only used for base image, documentation, parcel loading, etc. You won’t actually be running the VM from here.

Install customized Mac Intel applicationLukas Renggli has created an application that starts up X11 and runs VisualWorks when you drop an image on the application. You can find the file here.

  1. Download the file and drag the application (its the only file in the zipped file) to your Application folder
  2. Edit the .bash_profile file in your home folder. You probably can’t see this file (if it does in fact exist) since Mac OS X hides files and folders that start with “.”. I was successful in opening the file even though I couldn’t see if. See below for instructions on how to see hidden files.
  3. Put the following line into the file: export VISUALWORKS=~/Documents/vw7.4.1nc/image . This is your working folder and doesn’t have to be the VW image folder. I use /Documents/Smalltalk/images. [Update] Apparently this does have to be the root of the VisualWorks folder structure. When it wasn’t I was running into strangeness when trying to load a new package from the public repository.

At this point you should be able to drag an image onto the visual-mac-intel-741d application and it should open.


Showing hidden files

In a terminal window type the following two commands:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

Finder will close and then re-open with the “.” files and folders showing. To hide the files and folders again execute these:

defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder

The gods have taste

David Pollak talks about Smalltalk being the language of the gods. To summarize he talks favorably about the language and community surrounding Smalltalk but also the “requirements” [my word] that the language demands. Here’s a quote that sums his post up:

“I am not sure I’d make the commitment to being a god that Smalltalk requires. Most of the developers I meet on a day-to-day basis… the kind of developers who work hard and are conscientious in the work for 10 or so hours a day are not looking for an environment that requires a mind meld. They’re looking for a tool to achieve their goals. From what I’ve experienced with Smalltalk, I don’t think Smalltalk is that kind of tool.”

He goes onto say that the “requirements” of Smalltalk will relegate it to being a niche language.

I agree with a lot of what he says. I agree Smalltalk does require more from it’s users then other languages. I agree that it, as a result of that commitment, delivers more to it’s users. I agree that it is a thing of beauty and could possible be the language of the gods. However, I don’t agree that it will always be a niche language. The jury’s still out.

When I was younger I too looked for the path of least resistance. Heck, for a long time I didn’t even bother to comment my code because it was more important to churn out the programs then to “document.” Well, now that I’m firmly ensconced in the second half of my life I’ve learned to appreciate spending some extra time to get a better “product.” Because of that I have, so to speak, truly learned to love Smalltalk and to be willing to spend that extra time to reap the rewards.

While I didn’t come out of the pioneers of computing I like to think I came out of the early days of computing. After all I do remember a world before the Internet and PC’s, where disks were stored in “packs” and were removable from their drives. I think it would be a safe bet to say that most of the programming population came after me (and was probably born after I started programming, gag!). Perhaps as the world’s programmers age and mature and start to appreciate the finer things in life, they too will learn to love and devote themselves to Smalltalk.

If not, I’m still OK with that. Things that stay niche tend to keep their beauty and don’t get watered down by the latest fad. We might be best served to keep Smalltalk as our own little secret.

My first Smalltalk ah-ha moment

When I first learned Smalltalk (back in the mid-1990’s), the instructor told us that it would take at least five years to become proficient in object oriented design and Smalltalk. Of course, at the time I didn’t believe him. After all, I was an excellent programmer and certainly pick this up quicker then everyone else. Now that I’m back into Smalltak and reading more about it, I’m starting to believe what he said.

A few months ago while reading Smalltalk-80: The Language I had my first Smalltalk ah-ha moment. It came when they talked about using SampleSpace to randomly hand out elements from a set (in the situation in the book, cards from a deck). They break that behavior out into an object that just does that, hand out elements from a set. Doesn’t care what the elements are, just randomly picks one.

Breaking out this behavior neverĀ  dawned on me before. In fact, I implemented the same card dealing logic into a Deck object in Java when I was doing a War simulation (War the card game, not fighting between armies). I was dumbfounded when I realized that by breaking out that behavior there were so many other places it could be used.

Now I understand what the instructor was talking about. He wasn’t talking about learning the language or OOD concepts but about being able to use them to their fullest advantage. Guess I need to resolve myself to the fact that it will take me five years.

Not alone

Thanks to a fellow blogger I’ve found out I’m not the only one launching into the world of Smalltalk. Dave Cope is talking about using Smalltalk for a project as well.

Through out my investigation phase I’ve always felt like I was way behind the curve in respect to all the other Smalltalkers out there writing and blogging. Half the time I had trouble following what they were talking about and the other half of the time I couldn’t follow it at all. Nice to know I’m not alone in my newness.

Smalltalk

History

First a bit about my programming background.

I’ve been programming since 1987 in RPG on various IBM midrange systems (System/38, AS/400, i5). Save your comments about how dismal my existence has been with RPG/AS/400–I’ve heard them all. The fact of the matter is, that RPG has paid the bills for the last (almost) 20 years.

Smalltalk, part 1

My first exposure to Smalltalk was in 1996 at an IBM users group (Common). Those were the days before Java, when IBM was convinced Smalltalk was the way for their midrange users to go in order to have sexy graphical front ends for their applications. There were a lot of sessions at the conference related to Smalltalk (VisualAge specifically) and I decided to sit in on one and hear what it was all about. I walked out of that hour-and-a-half long session with a ton of mixed emotions. I realized that I had always had a notion that the way we programmed was flawed and clumsy but couldn’t put a finger on what was wrong with the conventional wisdom. When I saw Smalltalk, I knew we’d been doing it all wrong. I had found the most elegant programming solution I’d ever seen.

Within a few months we (the company I work for) purchased a copy of VisualAge and I was sent to training with The Object People. I walked out of the training ready to take over the world with Smalltalk, but, unfortunately, reality set in, urgent demands took precedence over learning a new language, and dust built up on the Smalltalk books.

Java

Around the 1999 time frame I began playing with Java on my own. Not because I though the lanuage was any better then Smalltalk, only because the price was right (free!). These were in the good old days of typing code into text files and compiling them. I don’t even think NetBeans was out at the time. When I did stumble across NetBeans I started using that for development (even without a GUI builder) and switched to Eclipse when that came to my attention.

I didn’t have a problem with either tool, but I did have problems with Java. What never settled well with me was, even though it was called an object-oriented language, not everything was an object. For instance, every time I wanted to perform some Integer behavior with an integer (int) I had to cast the int into an Integer. This seemed wrong! The other thing that bothered me was the complexity with the language. I eventually wrote an application in Java (it organizes my CD collection and produces a random album playlist) but never really felt comfortable in the language. Quite frankly, there were a lot of things I got working in the application but really didn’t know how–and that bothered me.

Smalltalk, part 2

At the beginning of 2006 I came up with the idea of writing an application to sell as an “off the shelf, shrink-wrapped product”. I’ve had a need at work for a system that would let me track non-recurring and recurring tasks like MS Project does (with sub-tasks, precedence, etc.). I just couldn’t find anything that does this, so I though, I’ll write one and sell it.

The prospect of doing this in Java didn’t thrill me so I decided to take a look at Smalltalk again. I was surprised how many free or non-commercial offerings there are now of Smalltalk environments.

I dabbled around with Smalltalk/X for a while and, while I think it’s a great tool, I didn’t meet my needs. I work in Windows and want to produce packages primarily for Windows but the Windows version of ST/X, I’ve found, is a bit buggy and the documentation related to using it under Windows is scarce. I also need, since I’m such a novice at this, a strong user community to fall back on if I run into problems. I did however like the fact that you could develop for a number of platforms and compile exe’s out of your packages.

I’ve finally decided to focus on VisualWorks as my development platform. It supports multiple OS’s, the performance is good and there is a huge user community. The one choking point I had was on the price but I do like their creative licensing model.
Two other candidates I did look at seriously were Dolphin and Squeak. Dolphin is great for Windows development but doesn’t have the cross platform capibilities that I want and Squeak, well, lets be honest, doesn’t have “the look” that most business people would feel comfortable with. If it doesn’t look like XP, they won’t buy it. I may be wrong on all this, and there is a way to get native Windows look and feel (without any open source licencing issues) but that’s the conclusion I came to.

So my journey into learning and exploiting VisualWork and Smalltalk begins. I’m exhilirated by the prospect!