Send to Printer

development

Prototype in ST First?

January 27, 2003 8:16:48.001

I've seen this idea in cls recently, and now in this article on O'Reilley: Prototype in (Smalltalk, Python), then build in Java.

I like programming problems where you think, "There has to be something really interesting over there, but I can't see it clearly." All you can do is move one step over there, with a small bit of code, and start exploring to see it more clearly. And maybe it actually wasn't there, it was over here. Or it had a different shape than you thought initially. Maybe it wasn't interesting at all, and you didn't waste a lot of time. The danger of planning is that you plan for the contingencies you know about, but by definition you don't plan for things you don't know you'll encounter. So when you do encounter an unexpected event in your programming endeavor, you have to fix many interfaces and change multiple method signatures. If you've already committed to your original plan and that's no longer where you're going, then you have a problem. I'm not particularly worried by the fact that people say you can prototype more easily in Python, but eventually the Java version makes it easier to build a robust large system. You can prototype in Python. Once you've explored the space more, you can do the planning and design that the Java version requires. If you start writing in Java knowing as little as you did when you started writing the Python version, you'll waste way more time exploring than actually building the system you'll eventually build.
Here's a hot tip - just build the system in Smalltalk or Python. If you skip the (unproductive) porting step, how much further along would you be?

Comments

Porting from Smalltalk

[David Buck] January 27, 2003 11:58:15.053

I once worked on a project where management wanted to prototype the code in Smalltalk then have a separate team translate the code into Object Oriented COBOL. They had their own extensions to COBOL to allow it to handle objects and polymorphic dispatching. We wrote up the prototype in Smalltalk and it worked well. Since they needed to run the production environment on an IBM mainframe, Smalltalk wasn't a choice for deployment (in 1993). When the team started porting the Smalltalk code to COBOL, they came to us with a problem. They were flabergasted that the Smalltalk code used recursion. COBOL doesn't support recursion. They asked us to re-write those parts to not use recursion. In theory, this sounds good, but in practice it's almost impossible. Their definition was "you can't run a method that causes the same method to run a second time regardless of the receiver." Delegation was almost impossible. Tree structures were almost impossible to traverse. This restriction was so contrary to encapsulation that we had a terrible time trying to impose the restriction. In the end, the project failed. The COBOL programmers couldn't do some of the simple things we do in Smalltalk all the time. And, with each message send requiring at least 4 lines in COBOL, the code was so verbose that it was almost impossible to read. As Sam Shuster says "And so it goes"

Prototyoe in ST First?

[Tom Sattler] January 27, 2003 13:16:22.098

James, Don't knock this. Use your imagination. Fast forward, if you will, to a conversation at XYZ MegaCrap Inc., in which a system has just been prototyped in Smalltalk: PHB: "Hey, this is a good prototype you have here." SP(Smalltalk Programmer): "Thanks." PHB: "OK, Java guys, give me your estimate of how long it'll take to write this, now that you have all the specs flushed out, and you can see the prototype running here." JP(Java Programmer): "My estimate is about eight months." SP: "But it only took us five weeks to do the prototype." PHB: "Wow, that was fast. Too bad Smalltalk is only good for prototyping." SP: "Smalltalk is good for a running system. Here, let me show you the Smalltalk - Java speed comparisons on this web site here." PHB: "Wow, it looks like Smalltalk is good for a running system too. Can you make this a running system in less than eight months?" SP: "How about by tomorrow?" Remember the old saying: "A Foot in the Door is a Good Thing." Well, maybe it's not an old saying, but it should be.

I'm hardly against Prototyping in ST....

[James Robertson] January 27, 2003 20:32:09.520

Just pointing out that the last step (porting to Blah) is typically going to be a waste of time and resources....

 Share Tweet This