The bar is higher now

Michael Feathers tells it like it is:

You think your design is good? Pick a class, any class, and try to instantiate it in a test harness. I used to think that my earlier designs were good until I started to apply that test. We can talk about coupling and encapsulation and all those nice pretty things, but put your money where your mouth is.

Whither Prolog

Just read a Byte article dating back to 1995 that predicted that Constraint Logic Programming in Prolog would be the programming paradigm that would gain the most commercial significance over the next 5 years.

Hands up if you’ve heard of Constraint Logic Programming.

Slightly sad thing is that CLP does actually look very interesting, as it seeks to tackle the NP-complete class of problems that traditional programming solutions are generally bad at.

Genetic algorithms appear to be more in vogue for NP-complete problems at the moment, possibly because to implement a performant CLP system you generally need an implementation of Prolog, whereas its possible to write a genetic algorithm in any current commodity OO language.

No, Windows will NOT restart now

‘StupidSoft PointlessTool X has been installed. Your computer will now be rebooted. Press OK to reboot’.

What gives a piece of software the right to decide when I reboot my computer? Its such a nonsensical myth anyway. It just doesn’t have to be necessary to shut down the whole operating system simply to install an application. How can Windows be taken seriously as a server platform while this sort of thing is still going on?

Comparison of .NET and Java Communities

I’ve recently been working in the .NET environment, and have had occasion to go wandering the web looking for various tools and libraries to speed up the development effort. One thing that has become very clear is that there is a very fundamental difference in mindset between the .NET and Java communities when it comes to tools. In general, its possible to find open source utilities and libraries for Java to accomplish most common tasks, whereas in .NET it seems far more likely that a similar search will arrive at the website of a commercial company with a product to sell.

It may simply be that there are more open source tools for the Java platform because it has been around longer. But it may also be the case that the Windows development community is larger, and more used to paying for their tools. There appears to be a second-tier of companies who make their living primarily by making and selling tools to the developer community. It seems to me that this tier can only really be profitable if there are a sufficient number of organisations selling software to the end-user community, and that those organisations feel there is a cost-saving to be had from buying tools and libraries rather than building their own.

Assuming those two speculations are true, what does this mean for open source in the .NET world?

My take is this: any company that sells products to developers to make those developers’ projects more cost effective is probably under constant pressure to perform. If their product isn’t powerful enough, their customers can simply roll their own (which is usually not the case for end-users), and if the price is too high, the ‘buy vs build’ pendulum will swing against them.

Open source projects traditionally fall into this developer-tools space, and as such, probably cause a lot of concern. How do you compete on price when something is free? On the other hand, you have a community that is used to buying its tools, and the tools are probably of pretty high quality, due to the competitive pressures I alluded to earlier. My gut feeling is that there is a higher barrier to entry for open source in the .NET world than the Java world.

Ultimately it comes down to the cost-benefit. If organisations developing end-user software can do so more cheaply by buying their tools, they will do so. The more complex and innovative the library, the less likely it is that an open source competitor will emerge. Commodity libraries that are closer to the buy-vs-build inflection point may well be supplanted by free alternatives, but this is simply market forces in action, and probably no bad thing.

On the nature of time in distributed applications

Tracking the sequence of events in distributed applications is tricky, especially when queues are involved. Messages can get backed up at certain points, arrive on dead-letter queues and be subsequently requeued, arrive out of sequence etc. This has the added effect that it may not be possible to accurately report on all the in-flight transactions at a given point in time until a certain period after that time.

Meanwhile, your application may have internal counters and time based identifiers that rollover periodically (at midnight for example). So how to reconcile temporally decoupled events with time-sensitive counters?

One approach is to go back to first principles, and use timestamps to tag messages at critical points (for example, the time they are created). Then when they arrive at their destinations, the timestamp on the message can be reconciled to the internal counter value that was in force at that time. This way, even messages that languish on dead letter queues and get subsequently requeued can be slotted into the correct place when they finally arrive.

This approach only works if your systems have a very precise agreement about what time it is. Thankfully there is a protocol that exists specifically for this very purpose, and is built in to both Windows and every flavour of Unix-like system, called Network Time Protocol (NTP). In Windows its sometimes controlled via the ‘NET TIME’ command or ‘w32tm.exe’ or ‘w32time.exe’ depending on your windows version.

NTP is a client-server based protocol, based on hierarchical tiers (NTP calls them strata) of servers, with the authoritative time servers being machines with atomic clocks, or other highly accurate time device. There are many public NTP servers out there, links to which can be found at the site mentioned below.

Its really pretty straightforward to setup an internal NTP server group, and as having a consistent enterprise-wide picture of time is so useful, should really be done as a matter of course when setting up distributed enterprise systems.

More information:

Notes to self about DB systems

Mostly for myself this one:

UPDATE and DELETE considered harmful for OLTP. Everything can be captured with INSERTion of deltas. (Ref: Journaling).

Timelines. Very useful.

Revisionism is bad. See note about UPDATE and DELETE.

Interesting parallel with source code control systems.

To recapitulate: Everything can be captured as a delta and a reason, including correction of errors. Don’t use UPDATE.

You’re welcome, Sun Microsystems

My first official Java bug:

From: Sun Microsystems
To: Darren Hobbs

Hi Darren Hobbs,

Thank you for using our bug submit page.

We have determined that this report is a new bug and entered the bug into our
internal bug tracking system under Bug Id: 5018137.

You can monitor this bug and look for related issues on The Java Developer
Connection Bug Database at:
http://developer.java.sun.com/developer/bugParade/bugs/5018137.html

Later… looks like it got fixed already in an internal build.