Programming
General programming issues, thoughts and ideas.


Programming







Subscribe to "Programming" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.
 

 

Thursday, March 11, 2004
 

Java as Baby Step. James Robertson thinks that Java is an interruption in the forward progress of software development. Itís nice to see this meme spread a bit; Iíve thought the same thing since 1996 or so. During ë95 and ë96, watching Java start to gain traction, I was amazed by the ignorance and ire surrounding many of what I considered Javaís best features:
  • the virtual machine
  • garbage collection
  • methods "virtual" (in C++ parlance) by default
  • a singly-rooted class hierarchy

I came to view Java as a baby step that would serve primarily to soften up developersí attitudes toward these things, thus shortening the leap required to adopt even better languages like Lisp, Smalltalk, and their ilk. I donít think I was alone in believing that, but I didnít hear anyone else saying it for a while.

It is nice to see people returning to serious language research again. Efforts like the Feyerabend Project and more practically focused offshoots like OOPSLAís Onward! track and the Post-Java Workshops (as well as increasing grass-roots interest in languages like Ruby, Haskell, Squeak, Oz, and even an ongoing Lisp revival) give me hope that weíll be ready to take a larger step soon.

[Glenn Vanderburg: Blog]

I'm with Glenn and James on this:  I think that Java's success was in part due to it's packaging of the features that Glenn listed above in a form that was easy for C developers to swallow.  All of those features had been around for years in various other languages, but those languages didn't resonate well with the general IT population for a variety of reasons.  Java acted as the sugar coating that made accepting those features fairly easy, but in my opinion Java has not added any significant new concepts to the world of programming languages.  It's time for something better.


10:38:07 AM    comment []

Job Scheduling in Java. Scheduling recurring execution of a piece of code is a common task for Java developers. The Timer class has its place, but as Dejan Bosanac explains, developers with more sophisticated requirements might want to check out the Quartz API. [O'Reilly Network Articles]
9:58:37 AM    comment []

Wednesday, February 18, 2004
 

Why's Poignant Guide. A few months back, why the lucky stiff offered up a great warranty. Now heís at it again, tis time giving us the first glimpse of what looks like a pretty unique approach to learning a computer language, in this case Ruby. Itís one of those sites thatís hard to stop reading: I hope we can convince him to produce a print version for the Pragmatic Bookshelf. [PragDave]
4:03:50 PM    comment []

Tuesday, February 17, 2004
 

IBM has released an Autonomic Computing Toolkit for Java (and that integrates with Eclipse).
3:41:47 PM    comment []

Yahoo has an interesting story about how Sun's Project Looking Glass got its start as the personal project of one developer with a cool idea.


8:41:44 AM    comment []

Friday, February 13, 2004
 

Martin Fowler on Domain Specific Languages. Martin Fowler on DSLs...

I've always used the analogy of creating a DSL to help think about building up a design - developing classes and methods with an eye to making them be a DSL. As much as possible I do this within the language I'm using, but if I can't I'm very ready to switch to code generation. At ThoughtWorks we've used code generation and similar techniques widely on our larger systems. The point at which I pull the separate language DSL lever is clearly different between languages. I never really felt the need in Smalltalk to use a separate language, while it's quite common in C++/Java/C#. [Lambda the Ultimate]


4:31:14 PM    comment []

Udell: Programs that write programs. Worth a look.

Jon Bentley in Bumper-Sticker Computer Science quotes Dick Sites as saying I'd rather write programs to write programs than write programs.

For some reason I remembered this quote as saying I'd rather write programs to write programs to write programs than write programs to write programs.

But maybe that's just me...

[Lambda the Ultimate]


4:29:27 PM    comment []

Wednesday, January 21, 2004
 

The Simplest Thing That Could Possibly Work. Ward Cunningham talks with Bill Venners about complexity that empowers versus complexity that creates difficulty, simplicity as the shortest path to a solution, and coding the simplest thing when you're stuck. [Artima Articles]
8:59:33 AM    comment []

Friday, January 9, 2004
 

Mechanism and Policy. Iíve been reading Eric Raymondís "The Art of Unix Programming" (a good book that could have been great had he managed to find a more balanced voice). In the section on user interfaces, he reminds his readers of the decision of the designers of the X windowing system not to impose look-and-feel constraints on X applications. The designers say that X supports "mechanism, not policy."

The X windowing system provides the underlying graphical user interface for most Unix systems (the Mac is a notable exception, as weíll see). Perhaps surprisingly, X itself offers almost no user-level features. Instead, it concentrates on providing a set of low-level primitives for drawing windows and filling those windows with graphics and text.

In order to make X usable, you need to supply an application program called a "window manager." This hooks in to X and handles events: for example, X may create a window, but the window manager can decide where to place it on the screen. To fill windows with widgets (standard interface components) you need another layer of software, the various X toolkits.

The designers of X felt that building a lot of behavior and standard interaction models into X would limit the user of X. Instead, they provided a (fairly low-level) API, and allowed their users to build any style of interface they wanted. They provide the mechanism, but enforce no policies on how that mechanism is used.

By contrast, the windowing systems from Microsoft and Apple (as well as those from Be and NeXT) were rich in policy. The windowing systems imposed a number of look-and-feel constraints and behavioral similarities between applications. There were even documents for application designers dictating just how their applications should look and react.

So what are the tradeoffs? Raymond says:

The difference in approach [between X and Mac/Windows] ensured that X would have a long-run evolutionary advantage by remaining adaptable as new discoveries were made about human factors in interface designóbut it also ensured that the X world would be divided by multiple toolkits, a profusion of window managers, and many experiments in look and feel.

Ignoring the interesting spin on "evolutionary advantage" (I donít often see X applications edging out Windows and Mac ones on my clientís desktops), the point is a good one. By keeping the underlying framework free of particular implementation decisions, you make it more flexible. This flexibility is a two-edged sword. One the one hand, it allows multiple competing ideas to duke it out: the winners will be selected by their users, and not just by developers (perhaps this is what he meant by evolution). But on the other hand, it also leads to the fragmentation he describes.

But heís also being disingenuous here: the reality is that it isnít the X windowing system itself thatís adapting at all. Instead, itís the efforts of hundreds of people writing the stuff on top of X that has provided the ongoing evolving interfaces he describes. Underneath the covers, X is basically the same old X. In some way, you could say that all their efforts were expended making up for stuff that X didnít provide itself.

So, by providing policy, the designers of Windows and Mac interfaces have provided their end-users with a consistent look and feel, and a base set of application behaviors. By instead focusing on mechanism and ignoring policy, the designers of X allowed developers to experiment, but gave the users of X applications a very inconsistent interface experience. Arguing one approach is better than the other is pretty pointless: theyíre just different.

What can we learn here when it comes to applications and designs?

When I first started thinking about this, I was reminded of the audience discussions that sometimes erupt when I talk about Naked Objects. A Naked Objects application exposes the core business objects of an application directly to the end user. They can manipulate these in any way the objects allow: there is no overall application GUI imposing a certain way of doing things. A Naked Objects system provides mechanism, but little in the way of policy. When I describe this, some folks have a strong reaction against the idea. "Without high-level policy imposed by the GUI (scripting, or series of modal dialogs that have to be filled in in a proscribed order) how can we ensure our users do everything that needs to be done?" they ask. And its a good question. Experienced users, folks who understand the domain, love Naked Object systems because they get the control and flexibility they need to get the job done. But inexperienced users can be confounded by that same flexibilityó"what should I do now?". (In a way, this also relates back to the Dreyfus model of skills acquisition: beginners need to be guided, while experts need to be left alone to get on with their jobs.)

In the Naked Objects world, it turns out that thereís a compromise. Because the Naked Objects are themselves just Java business objects, thereís nothing stopping you putting a more conventional view and controller on top of them, converting your Naked Objects application into a conventional GUI or Struts-style app. And, because the objects are the same beneath the covers, you could probably arrange to run both the Naked Objects and conventional application at the same time. The conventional application would have less flexibility and functionality, but would be easier for casual users. The Naked Objects system would have full flexibility for more experienced users.

In a way, this seems like the OSX way of doing things. Apple have taking a Unix operating system and wrapped it with a fantastic user interface. Not only does this interface work at the application level, but it also gives you the ability to do most of the administration of a box without dropping to the command line or editing files. I love this: Iíve spent all too many years administering Unix boxes the hard way. But what I love just as much is that when I need to, I can still get down and dirty. Itís the best of both worlds: regular users get a great, easy-to-use interface, but power users get to strip away the facade and work down at the lower levels.

Increasingly, I think the "one-size-fits-all" mentality is going to break down. We need to think about delivering our application functionality using multiple modalities, each targeted at specific user communities. Mechanism versus policy is one axis we need to consider, and one thatís relatively easily addressed in a well-designed application. We donít need to decide up front whether to deliver one or the other; instead we need to work out how to provide both.

[PragDave]
4:11:20 PM    comment []

Monday, December 15, 2003
 

SolarMetric has release version 3.0 of Kodo, their JDO implementation.  I used Kodo on my last project and really liked it.  Its ability to reverse engineer a database schema into a set of classes saved us a huge amount of time and effort.

This release adds a lot of very cool new features that address a lot of the shortcomings that I encountered with version 2.5.  At the top of this list include:

  • More hooks for controlling the reverse mapping output (class/method/field names).
  • Aggregates and projections in queries (yahoo!) .  count, sum, min, max, and avg are built in, and you can create your own custom functions.
  • Now supports direct SQL queries (you can give Kodo your own query and it will return the resulting JDO objects)
  • More control over handling of very large result sets (using cursors).
  • Many more object-relational mapping options
  • Better cache locking, which is supposed to increase concurrent access speed

All told, this is good stuff!


1:01:18 PM    comment []


Click here to visit the Radio UserLand website. © Copyright 2004 Jon Israelson.
Last update: 3/17/04; 2:58:48 PM.
This theme is based on the SoundWaves (blue) Manila theme.
March 2004
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Feb   Apr