Ideas and essays on code development

Location: United Kingdom

I am a software developer and consultant with more than a quarter of a century of technology change and challenges to draw experience from. While I maintain and exercise some skills from the dark ages of computing I also enjoy taming the new technologies as they turn up – always looking for ways to deliver truly effective software systems to my customers.

Friday, December 07, 2007

Is JQuery now top dog in the JavaScript framework world?

A pretty fair and balanced review of Dojo, MochiKit, YUI, Scriptaculous (with Prototype), and JQuery (including the widgets) saw JQuery a winner by a short head.

Given the impact of Ruby and the Rails framework on modern web development – the effective endorsement of the JQuery client side framework represented by JRails (a ‘drop in’ Rails replacement for the prototype/scriptaculous combination) is an important marker for the growing importance of JQuery.

The Tuesday announcement of an early release of flot, a JQuery plotting widget, was pure icing on the cake for me. The flot code by the way is hosted at Google.

In an interesting twist Google also announced their Charting API which adds a new facility for those who want to use Google resources to display on line data. The approach is described at the link shown above and includes both a novel way of encoding values with a reasonably thorough treatment of 2D charts.

Regular Expressions

I was tweaking a couple of regular expressions used to validate user entry on a customer’s web site – playing with positive and negative “look ahead” to get the result I wanted from various trial input –

reminded of an old but good post by Mark Jason Dominus outlining how Regular expressions are implemented. Yes it’s a bit about perl but it should be interesting to anyone keen on knowing how these things are made to work.

Tuesday, December 04, 2007

Shopping Online – the death of or dearth of, the small trader?

Only slightly off topic this one – stick with me for a few moments, it is about software.

In theory, the online shopping revolution gives the small specialist trader equal billing with the big online retail brands – in practice it is surprisingly difficult to buy anything from most smaller online traders.

Case in point – I just did a search for a particular kind of liquor chocolate that my wife is very partial to. The Google listing came up with two “paid for” search results that headed the list. I knew that one of them did not stock what I wanted, so tried the other. None of the links from the main landing page would work. This retailer had paid for what looked like an expensive design job – paid for near top Google ranking but could not sell me any chocolate. They have thrown all that money away.

I was using MS Internet Explorer 6 by the way – I know not to go looking for specialist items using a browser as exotic as FireFox.

Every year I always buy a side of hot smoked salmon for Christmas. If you have never tried this product by the way – take time out to give it a whirl – it is fantastic and nothing like the clammy insipid stuff that is most smoked salmon. I did my usual online round of the UK based suppliers – and they are collectively dreadful web sites – seemingly designed to ensure that you can’t locate the products you are looking for. Information – forget it. In the end I plumped for the Salar Smokehouse on South Uist because I know their product is usually superb – even if their web site misses the mark.

Everywhere you look, you find poorly designed web sites that require near fanatical perseverance on the user’s part to navigate to a successful purchase. Keyword searches that fail – mostly because there is no sensible content to search. There perhaps is the rub – instead of the web presence being central to the business it must be that it is perceived as “extra” or peripheral – bringing in additional (possibly marginal) sales.

Then there is the brief given to those responsible for building a given web site. As a favour, one of my colleagues reviewed a customer’s web site recently as it was failing one of the key metrics, as perceived by that customer. It was pretty obvious why it was failing and I don’t suppose it was the fault of the shop that built the web site – they were just given the wrong brief. Quite a lot of cash has already been spent on this web site but it has largely been wasted. There was no clear marketing idea behind it – well not one that was expressed in terms that the designers understood anyway. In this case completely the wrong site got built.

The hot smoked salmon thing got me thinking about small business online marketing as well. I seem to only buy this splendid food at Christmas – but I might well buy it at other times of the year (fantastic for a summer lunchtime garden party) if only I remembered it was there. So where are the “get 10% off and free shipping” offers through the rest of the year? They have my email address and postal address but you get the feeling they can’t be bothered – and that’s a shame. Smokehouses operate in a seasonal business climate – but they make so little effort to build a continuous trade – which is why so many fail at regular intervals.

Proper targeted, occasional emails that make relevant offers to people you know already buy your product is not spam – come on guys – let’s sell some product!

So if you are unsure about your software business web marketing then make a new year’s resolution to take a good long look at Eric Sink’s web site where there is masses of sound marketing advice and downloadable ebooks. All free stuff to get you thinking clearly about the subject. Then resolve to track Seth Godin’s blog to keep you thinking.

Seth posted today to point out that a very popular Reebok advertisement series running over at YouTube ends with a splash page sending viewers to a web page – which 404s. It’s the same with Vista – the OS screens have lots of links to Microsoft sites but each one I clicked ended up with a “Your page was not found” message. If the people who maintain the Microsoft web sites can’t be bothered to keep a list of the direct links from the company’s flagship product (whatever you might think of it) then what hope is there?

Well I got my fish but can’t find the chocolates. Santa’s sack is going to be light this year.

Thursday, November 29, 2007

JavaScript Dates

Sometimes I have to kick myself – I had better confess all.

I followed a link, proclaiming the “holy grail” of JavaScript Date functionality had been found, to a post by Mark Hopkins at Mashable demonstrating some of the functionality of date.js.

Very good I thought although I noted that the demonstration posited that 05/11/07 was a date in May (a peculiarly US idea). After I had followed the link to to download the code I dropped by the project Issues page – but somehow completely missed the main project page (to be fair to myself these are often devoid of anything useful).

I reported my issue with the date although I had noted that when a date was unambiguous (say 23/11/07) date.js recognised the normal day, month, year order. My shame was that I had not looked at the code before jumping in – I just thought it was an issue that had been skipped while the project was still in Alpha.

I got a very nice email explaining about the culture settings which I quote in full below:

Please check out the Getting Started with Datejs tutorial.

Currently the library supports 150+ cultures and including the appropriate
culture-specific date.js file the Parser will automatically switch to
the correct
parsing order for your country/culture/language.

The sample on the Datejs home page uses the "en-US" CultureInfo file
which expects a
dateElementOrder of "mdy". We're in Canada and use the "date-en-CA.js"
file in all
our internal apps. In Canada the expected dateElement order is "dmy".

The full download package includes all 150+ pre-compiled CultureInfo
files. See

I hope my humble apology and this post makes amends for my wasting the team’s time.

What’s all the fuss about? Well date.js has a capacity to take just about any user input (no matter how formatted or descriptive) and turns it into a date.

date.js reminds me of some very old code that is still used in some VMS applications I maintain that was written (by my brother I think) to do a similar “trick”. The user can enter (say) “t” for today, “t+2” for the day after tomorrow, use “long” or “short” date formats and always (well nearly always) end up with a sensible date that can be stored or used by the application.

Date.js goes rather further than that. It offers some sophisticated date manipulation, date comparison and date formatting options – frankly I can’t see anything left out.

The code is published under the generous MIT license so you can use it as part of any sort of application.

There are some open issues with date.js (to be expected in an Alpha) but I am sure that this code is going to end up in my toolkit. Check it out or monitor the main project page to await a full release.

Tuesday, November 27, 2007

Text Editing

Quite some time ago I took a look at the range of text editors for Windows with a view to getting something to replace the now moribund “Developer’s pad” and to meet a couple of additional needs for something rather more intelligent than notepad. The sheer range of options completely overwhelmed my enthusiasm and I got nowhere.

There was one feature in particular that I was looking for and that was the ability to select a column of data out of a text file – not something that is generally available but very useful when trying to extract specific data items from reports or other Customer generated input to the daily toil.

I picked up on a post that looked at a survey of Ruby developers and their tools organised by Tim Bray. This generally showed a preference for TextMate as a programmers editor. Now TextMate runs on an Apple Mac (where a lot of Ruby developers hang out) but I prefer the (slightly) more open Windows platform – well that’s what I keep telling myself anyway.

It turns out that the e Text Editor is a Windows clone of TextMate that can take advantage of all of the hard work contributed by the TextMate community to create settings for a wide variety of programming languages and developers “add-ins”. Unsurprisingly, VMS Basic is not in the list I saw but interestingly VB.NET is.

Oh yeah and the e Text Editor can select columns of data as well as provide effective support for the syntax of JavaScript , ASP.NET, CSS, HTML, PostScript, Python, XML and Ruby of course. Plus a host of others – there is a list you can check.

Add in a revisions tool and the ability to shell out to a language of your choice (via cygwin) then this really does look like the tool I’ve been hunting for sitting around waiting to magically turn up by itself.

e Text Editor has a free trial period – that is pretty gently enforced and a very reasonable purchase price. Now the thing is to make sure that I have enough work for a text editor right now so that it gets a fair evaluation.


Monday, November 26, 2007

Ancient Vistas

OK – so I am a year late but I booted up the first Vista machine on the home network this weekend.

First impression – Windows Vista is the finest argument yet for a return to the command line. I am truly sorry for supporting Windows all those years ago – I thought it would make the user’s life simpler and let them get useful things done – I now see the error of my ways.

Seriously though, some good news – the d***d search dog has gone; but I am not yet sold on the replacement.

Goodish news – I was encouraged to set up a password protected administrator’s account and to then set up user accounts – in this instance for my children. Even better news – when logged in as one of the children I am prompted to select an administrators account (I created two) and to type in a password to install a game. Bad news – when I am logged in to the administrators account I keep getting hassled to “give Windows permission” to do what I just told it to do. So its a pain in the butt doing straightforward maintenance tasks after deliberately logging in as administrator to do them.

Plus the usual – “why do something with one click if you can get the dumb user to click four or five times” Microsoft syndrome. Usability – try clicking the “Add a new user” hyperlink from the Control Panel – you have to click three more times before you actually start adding a user – so what was the point of the link?

Plus - actually I don’t like the transparent bits around the edge of the app windows – sorry and all that but I think they look untidy and distracting.

If you boot a new XP machine hooked up to the network (or within sniffing distance of a wifi hub) then the initialisation process politely informs you that a network is out there and asks permission to get connected. The Vista machine stayed quiet on the subject of networks and I had to explicitly set up a connection. To be fair this might be a symptom of the pre-installed Acer crapware on the machine that seems to permanently waste CPU cycles (and memory) duplicating standard Windows control features.

The big question is – is Vista fit for business use? Probably too early for me to hazard an opinion. If suitable remote administrative tools exist to set up “standardised” installations and to get around the somewhat pathetic security layer apparently sewn into the fabric of the OS - then maybe. Is it worth the cost to upgrade existing XP machines – definitely not from what I’ve seen. Plus (warning – I am reporting other people’s findings here) it sounds like XP Service Pack 3 brings a performance boost with it – great for any machines that are beginning to feel a bit tired while Vista performance is little improved by it’s very own Service Pack.

Still – you don’t have to listen to me – I thought NT 3.51 was pretty good and that Windows 2000 was just about the pinnacle of the current design concept. So what do I know?

Wednesday, November 21, 2007

More on Android

A very good first project piece from Reto Meier that nicely links the address book to the GPS to a map. A very good demonstration from a C# programmer (although with a background in Java).

For an intelligently critical viewpoint try Unqualified Reservations – a blog often more about politics than software. I think the most interesting point raised here is to do with Android graphics. Here the choice of pixel drawing functions looks plain wrong – despite the fact that such functions will certainly run faster on the current generation of devices than a vector based approach – the trick is to write for tomorrows devices f you want to be tomorrows winner. However it got me thinking about the browser end of the package – surely Google’s strength is Internet based - so why isn’t more of the SDK about Internet applications – with a brilliant JavaScript engine? Interesting that.

Amazon saves the trees?

I think that Mark Pilgrim is exactly (and amusingly) on the money with his The Future of Reading (A Play in six acts). Ebooks just do not cut it when you factor in DRM and high device costs. I had been wondering how I could amortise a Kindle unit purchase over an anticipated device lifetime of two years on purchases of (say) two books a month – and that’s assuming that all the books I wanted would be available in the specified format. It just does not look a sensible option – and no electronic format available today is going to match the versatility of a simple book.

I suspect that the problem here is that Jeff Bezos and Amazon are trying to lead this market. The iPod came after the initial successes of MP3 and user driven format shifting for music. Apple made the format convenient and makes a bundle of money on the back of that convenience. There is no established format shifting mechanism for books. I suspect that “home copying” (more properly format shifting) of books will have to become a reality – fixing an effective digital format on the way – before eBook reading devices (if they turn out not to be an existing device) have a chance in the market place. It would be convenient to be able to carry around a couple of novels and a good portion of my technical library but the limitations (and price) of the current proposals from Amazon do not look that convenient.

The OLPC looks like a pretty good text reading device – so any ideas on how best to quickly and conveniently shift my newly purchased paper based books to a format that I can carry around on one of those?

Friday, November 16, 2007

The Rise and Falter of Visual Basic

I read an excellent review of the history and current status of Visual Basic at DevTopics but I would change the post title from “The Rise and Fall of Visual Basic” by substituting “Falter” for “Fall” as this post’s title suggests.

I am not sure where the figures supposedly showing the death of Visual Basic come from. If you are happily working with VB then you are probably doing so without making a lot of noise about it – that could be the problem. However take hear from the following.

  • Visual Basic is the number one .NET language
  • Visual Basic is the number one downloaded and number one registered Express Edition (by a margin over the next of 20%)
  • Visual Basic is the number one language gauged by the MSDN centre and blog
  • The Visual Basic team blog is the number one MS blog.

Figures taken from Paul Vick’s post on the subject where he is now suggesting that it is time to “lose” the Mort persona used to label VB developers and replace him with Ben (Franklin). Ben is the guy you call when something needs to be done – a bit of a polymath – but practical through and through.

And perhaps there is the rub. VB.NET is for the Bens of this world and has left the Morts behind. I know plenty of lone developers and development team members who are Morts – making their contribution to those “Big balls of Mud” that serve Industry and Commerce so well. There are still a lot of Bens writing VB6 applications but they have the choice of future tools – what’s left for the guys who want a solid, pragmatic development platform that does not demand a theoretical model to hang the code on?

Me – I’m off to write a quick and dirty data analysis in VB6. The Visual Studio 6 IDE might feel somewhat lacking nowadays (you have to type in your own “End If” lines) but it’s still faster to hack a report than .NET and there are no deployment issues in my target domain.

Google’s Android Again

Top class post by John Lombardo titled “A developers Perspective on Google’s Android” should be on the “must read” list for anyone serious about playing with this SDK.