« November 2007 | Main | February 2008 »

January 28, 2008

Values

Listen to this articleListen to this article

I was chatting with the lads over at Cogent last Friday about our new venture and the discussion turned to company values. Most of us think of company values as those totally nebulous statements CEOs love to have plastered all over the walls in the vain hope that employees will feel as though being made to work ridiculously long hours was all for a good cause. Thankfully, Cogent's values aren't much like other's and in fact Marty made a great point: values should be actionable in some concrete and meaningful way. Cogent's values certainly appeal to me but I'm sure they won't appeal to everyone. Financial transparency being one of particular favourites.

One of the less tangible values is "fairness and equality." That is, treat everyone fairly and equally, as human-beings. Which got me thinking. It reminded me of "treat others as you would yourself" which I've always had a bit of an issue with. Not that I disagree with the sentiment, not at all, but something about it never sits quite right. After a little thinking I settled on "hold yourself to a higher standard than you do others". I think it fits nicely with treating others fairly and equally.

January 27, 2008

HELP: Developing with WebSphere

Listen to this articleListen to this article

I have to know. Is it just me or is the compile, deploy, debug cycle with WAS just so ridiculously long and slow that it's practically impossible to do anything productive with it? Does anyone ACTUALLY use WAS for development? If so, how do you manage? If not, what do you use instead and how do you then make sure that it still runs in WAS when it can take 10 minutes just to re-deploy an application? Is there some secret to determining why WAS silently rolls back transactions, for no apparent reason (WLTC0033W and WLTC0032W), before control has even returned to the container and with no exceptions; doesn't seem to be able set transaction isolation levels on SQL Server but instead creates extra connections with the correct isolation level (READ_COMMITTED) leaving the original one handed back from the DataSource as the default (REPEATABLE_READ); and mysteriously times-out waiting for Oracle connections from a pool of 10 even it only ever seems to need at most 3 when the maximum pool size is set to 100!

January 25, 2008

Making del.icio.us work for me

Listen to this articleListen to this article

I've been posting links to del.icio.us for sometime now. Mainly things I can't get to right now or don't access frequently enough to warrant cluttering up my bookmarks with but don't want to loose track of. When I first started, I would tag things with whatever keywords I could think of. After a while of doing this, I ended up with a huge number of tags but still couldn't find anything. There was just too much random stuff to filter on.

Attempt #2: I decided to whittle my tags down to the smallest set possible. This was better however every time I went to tag something I found needed to sift through the existing tags and decide which one(s) suited, remember if I had used the plural or singular form, etc. and even then, there was just too much stuff to sift through because now all my links were concentrated in only a few tags.

Attempt #3: My most recent attempt, and the one that has been working brilliantly for me now, is to not worry too much about what exact tags I'm using but, rather than tag it with everything I can think of, I instead use exactly the same keywords I would use were I to search for the link on Google. This sometimes means I have tags that wouldn't seem to make sense as categories on their own.

Now when I want to find something I've bookmarked, I go to my del.icio.us page and search through "your bookmarks"--shouldn't that be "my bookmarks"?--as if I were doing a search on Google. I reckon I have a close to 100% hit rate and at most 2 or 3 results for any given search. I've finally managed to make del.icio.us useful!

Even better, I have set up a custom search in LaunchBar: http://del.icio.us/search/?type=user&p=*

January 18, 2008

Call for Survey Participants

Listen to this articleListen to this article

I'm looking to do a survey on software quality using source code duplication, cyclmatic complexity and npath complexity as the measure.

The general idea is to take open and closed source projects and measure the "quality". The results will then be analysed to determine:

  • How open/closed source compare;
  • How individual projects compare to the "norm"; and
  • What, if any, discernible factors have influenced the quality of the code.

Once the data has been compiled and analysed, I will make the results available to the participants and to the general public. The identity of participants, projects, resources and people involved will be completely confidential--indeed even I don't actually need to know the names of projects nor will I have access to or need access to the source code--and will not be disclosed to third-parties.

At the request of the study participants, I will be more than happy to present the findings--in person if possible--and make any recommendations that may arise. I will also make myself available to perform a repeat survey in 12-18 months time should this be so desired.

For largely pragmatic reasons, there are several requirements for participation:

  • The project MUST be in a subversion repository;
  • The source code MUST be Java;
  • The project SHOULD NOT be using Simain or CPD (or for that matter any other duplicate code checking tool);
  • The project SHOULD NOT be using Complexian (or for that matter any other complexity checking tool); and
  • An environment that can execute Java and Subversion command-line tools.

Participation couldn't be simpler. After you contact me, I'll send you a package containing some processing scripts. To run, simply checkout the HEAD of your project's source tree into a directory using subversion and run one of the batch scripts contained in the package. For Windows use bin\process.bat src_dir cvs_file For *nix, use bin/process src_dir cvs_file. The scripts will process each revision starting from the currently checked out revision to the first revision.

This processing may take considerable time so if you need to interrupt the process at any point you may do so in the usual manner--eg. ctrl+c. You can then re-start the processing at a later date and it will pick-up where it left off.

Once processing has finished, you can email me the CSV file.

If you think you have a project that fits the profile and would be willing to share some processing time, your participation would be greatly appreciated.

January 13, 2008

Out on the Range

Listen to this articleListen to this article

I'm pretty sure I've blogged before about my dislike of prefix/suffix pairs such as from/to and start/end. They smell of a missing abstraction. There are however languages that provide a nice solution.

We have an application that stores a date against a record in the database. At various times, we want to see if that date falls between a specific date range. The initial implementation of the code looked something like this:

def within?(from_date, to_date)
  @date >= from && @date <= to
end

Which you would then be used along the lines of:

puts "Not available" if record.within?(start_date, end_date)

This immediately activated my olfactory senses: Not only do we have some common suffixes, we also have comparison code that looks like pretty much like every other kind of range comparison code you're ever likely to write.

As it happens, Ruby has a Range class built-in that I don't see being used nearly as much as I think it deserves. Using a range we could re-write the example to look something like:

def within?(date_range)
  date_range.includes?(@date)
end

And then in the worst case, call it like this:

puts "Not available" if record.within?(start_date..end_date)

I say worst case because here the client code still uses two separate dates which are then converted to a Range for the purposes of the call. (Interestingly the use of use of .. to construct a Range out of two individual values uses the same number of keystrokes as passing the parameters individually!) However, in the best case, we'd have been using a Range to store the dates in the first place.

Content Management Simplicity

Listen to this articleListen to this article

I've been wanting to put together a new website for my Aikido School for some time now and had been looking around for possible tools to help out. Possible choices included: continuing to maintain it by hand with a redesign; use some kind of site generation tool; write a Rails app; or find a CMS tool.

The first wasn't really an option--I'm time poor as it is. The second didn't seem like a much better solution either to be honest. And If the first two didn't seem like attractive solutions the third was possibly even worse. So, it came to finding a CMS tool and after a little investigation, googling, reading forums and talking with friends, colleagues, ISPs and a few drinks I had narrowed the field down to two: Joomla; or Drupal.

(Interestingly, both are built on Perl/PHP--quite frankly the idea of a Java-based CMS running inside a J2EE container makes me feel ill just thinking about it and I couldn't find any Ruby-based solutions that even rate a mention.)

Both Joomla and Drupal are solid, mature products. Both are open source and have a thriving community. Both support extensions/plugins/modules and both have had books written about them. All good things. But in the end I settled on Drupal for a number of reasons some emotive, some based on other's experience and some technical--perhaps the fact that Joomla only runs on MySQL could be considered both technical AND emotive.

So far, I'm highly impressed. It was very easy to install and setup. The admin screens even tell me when the underlying OS or database isn't configured properly and even go as far as telling me how to fix the problem! There are a bewildering number of modules available that do almost everything you can imagine. And when I finally wanted to do something outside the "box"--aggregating images based on taxonomies and displayed in the side navigation of the home page--it was almost trivial to programatically construct the content. My distinct impression is that for many sites I've traditionally built as yet another new application, a CMS like Drupal plus some custom code would be sufficient.

I'm still not a huge fan of Perl. I like many of the language features such as built in regular expressions, etc. making it ideal for command-line scripting, but it still feels a little too close to the metal for me and lacks much of the syntactic sugar around objects that make languages like Ruby more attractive. That said, I've thus far only needed to write custom PHP code once and I reckon it would make a nice module--assuming I could find the time to publish yet another open source project destined to become abandonware ;-)

If only someone in the Ruby community would put something together that's as good as these two, I'd consider switching. Perhaps something built around merb however maturity and a strong community are certainly big selling points for me, perhaps making it difficult for a new player to gain traction?

January 12, 2008

Yes, more Rails plugins

Listen to this articleListen to this article

FWIW, I've just created two very new, very simple and VERY BETA Rails plugins.

The first, Simian, is pretty obvious: it adds a couple of rake tasks to run duplicate code checks against your rails project using, you guessed it, simian.

The second is Restful Transactions. This plugin ensures that your controller's create, update and destroy actions are wrapped in a database transaction meaning you don't have to think about it.

As always, you'll find these plugins and more over at the RedHill on Rails plugin page

Update: The plugin now wraps any action executed as a POST, PUT or DELETE rather than just the create, update and destroy actions.