Archive for the ‘Software development’ Category

Javascript explosion

December 17, 2007

I was looking at some blog today, having found a link to it on Reddit. The content was looking a bit odd, and, as most people these days don’t seem to test their websites with Javascript turned off these days, I decided to see what NoScript was protecting me from.

Javascript sources

 

LibraryThing.com
Probably some sort of widget “thing” for showing people what books you have/like
Flickr.com
Because serving images with a <img> tag is not good enough anymore
Blogger.com
Presumably he uses this as his blog host
Amazon.co.uk
For affiliate links
Bibulus.org
This was the domain the blog was on
GoogleSyndication.com
Google ads
WebStatus4u.com
As a guess, providing visitor statistics

Javascript from all these places is being pulled in for a fairly simple blog site. WordPress hasn’t quite thrown that much onto my blog here, but there is wordpress.com itself, Google Analytics, and another that seems to rank my traffic compared to other sites.

Kinda reminds of the way that everyone seems to be having a great time introducing dependency hell into all their desktop apps too.

I sometimes wonder about the privacy implications for users if visiting one site requires hits on a dozen other servers. It’s getting a bit crazy.

Beginning WPF

December 16, 2007

I’ve decided to start learning WPF. No real reason, I just felt like switching context for a while. I went out and bought Adam Nathan’s book Windows Presentation Foundation Unleashed, on account of all those nice reviews of it that I’ve been reading. But this isn’t about Nathan’s book – I’ve barely even started on Chapter 3 just yet.

I was going along merrily, writing up some code XAML code from the book and just running it in the browser. The first examples, about creating a button, were working just fine that way. Until I tried a bigger example, creating a simple window:
Example WPF window

When I ran that, it gave me a huge stack trace, a dump, and I’m pretty sure I saw a MD5 hash of Bill Gates’ full name in there somewhere. It’s two A4 pages of SecurityException goodness. Based on some vague memories of the cause last time I had a SecurityException, trying to run .NET code off a network drive, and from what was different in the code this time around, I figured that perhaps you couldn’t have a <Window> in a browser. In that 175-line error message, the closest thing to something useful was this:
at System.Windows.Window..ctor()

And then only because I happen to know that in .NET, a .ctor() is a constructor, so I’m figuring here that there’s an exception in the constructor for a System.Windows.Window. Really. Those other 174 lines might be useful from time to time, but would it really be unthinkable to create something that says, “The current environment lacks permissions to create a System.Windows.Window” up top. Or something like that?’

I wonder if doing it in Visual Studio .NET (2008) gives better results. One would certainly hope so.

On Windows Vista

December 15, 2007

I loved reading Coding Sanity’s review of the experience of upgrading from Windows Vista to XP.
… I notice that the Reliability Report is also gone, again a sore loss, I really enjoyed charting the downward spiral of my Vista reliability, there were those occasional humps that got you all excited, and then the graph would continue its steady sojourn downwards.

Personally, my experience with Vista was basically that something broke every time I used any shutdown option. Restart, and the monitor stopped working. Hibernate, and the thing didn’t wake up again. Log off, and it would freeze. Shut down, and the thing would stop part-way through booting, and the only way to get it working again was to go into safe mode and then restart. That magically fixed it. Eventually, safe mode stopped fixing it and I was forced to upgrade to XP myself. That computer, now back to XP, has been running flawlessly for months since.

Many people are finding things work fine on Vista. Maybe that was my mistake. I should have, I guess, gone out and bought a new computer for it, because that way presumably the OEM would have tested that model and all its drivers on Vista. But, let’s be frank, I’m not feeling any great compulsion to buy a new computer right now. This one works fine – with XP, anyway. Framerate’s just fine for the games I enjoy playing, even though it is true that they aren’t always the newest releases. Well, ok, they’re never the newest releases. I still miss Zone 66, preinstalled by the manufacturer on the old MS-DOS/Windows 3.11 computer.

There are a few things I like about Vista – the enhancements to Explorer, for example, the almost-instant search in the Start menu (Launchy, for example, is “more” instant). And it’s about time that they recognised that the Date/Time control panel is a calendar.

But it’s not enough for a computer that I can’t shutdown without a feeling of gloom and despair in the pit of my stomach. My next desktop computer will probably come with Vista preinstalled, and that will presumably work. And I’ll be happy with it, then.

Any email function is a target

December 8, 2007

I regularly post in the Joel on Software forums. The JoS forums have a very simplistic interface, but they do have allow you to send an email to a poster who has provided their email address.

The thing is, there’s nothing stopping spammers from making use of that. The forum’s presumably-quite-effective Bayesian filters (there is usually very little spam) don’t seem to check emails out, and there’s not even a CAPTCHA.

I received my first spam email through JoS about 2 months ago, but none since. Until this week.

Spam from the Joel on Software forums

I use Gmail for my email, which is usually quite good at picking out spam, but, presumably thanks to the JoS connection, these spam messages are getting through just fine.

If you are offering users an option to send emails to third parties, you should take steps to try and prevent spam. Otherwise, spammers will take advantage of your name, your service, and your bandwidth to send emails – potentially even result in you ending up being blacklisted. And not entirely unfairly.

Why you shouldn’t use LinkButtons

September 1, 2007

ASP.NET has a LinkButton control, which looks like a link but works like a button. Almost.
ASP.NET Linkbutton

Generally speaking, when you hover over a link in your browser, you get to see the URL of the link, so you know where you’re going. With a LinkButton, however, you get gibberish.

Normal link LinkButton
Normal link LinkButton

Right-clicking a link gives users a range of options for doing what they want with that link. A LinkButton doesn’t allow this – it looks like a link, but it doesn’t work like one. Not doing things like your users expect leads to confusion.

Normal link LinkButton
Normal right-click LinkButton right-click

In some browsers, you can middle-click to open up a link in a new tab. Personally, this is something I use all the time. Indeed, there’s even a Firefox extension, SubmitToTab, which lets you do the same thing with a button. LinkButtons, however, break this, and break it badly. It’s not that it doesn’t work, but it also sends you to a blank page with gibberish in the address bar.
LinkButton middle-click

Now, granted, so far, everything’s working as though it was a button, not a link – and a LinkButton is supposed to be a button, after all (which happens to look like a link). However, a user expects that if it looks like a link, then it will be a link, and behave like a link, and vice versa. Putting actions behind (what looks like) a link is dangerous because users might not realise that they are committing an action. If it’s supposed to be a button, why use what looks like a link? You’ll just confuse things!

Anyway, most of the sites that I’ve seen using LinkButtons have been using them for what is, effectively, navigation.
LinkButton used for navigation

None of that, however, compares to the big weakness of LinkButtons – and that is Javascript. Using a LinkButton unnecessarily requires Javascript to be enabled in the user’s browser. Otherwise, they end up getting a Page Not Found error message when they click it!

Some percentage of your users will have Javascript disabled. Perhaps they’re using a mobile phone or PDA which doesn’t support Javascript, or using NoScript, or maybe it’s company policy to disable Javascript on Internet Explorer (and, frequently, this can’t even be changed by the users). Do you really want to stop all these users out from using your site?

There are alternatives. For example, if you have a button, and, for some reason, you absolutely need to display it as a link, you could use a little CSS magic to get pretty much all of the way there. The results work without Javascript and will degrade even if CSS is disabled (unlikely) or the user is using a browser that predates CSS (it will just look like a button).

That Old Marshmallow Maze Spell

June 12, 2007

First off, if you haven’t read Steve Yegge’s latest blog post, a 15-page allegorical story entitled That Old Marshmallow Maze Spell (or, I suppose, at least tried to :p), this won’t really make much sense. Well, maybe it will. Anyway, I’m going to try and summarize it, and unmuddle it. For those who want to compare my interpretation to their own, I suppose.

For the purposes of this story, I will assume the viewpoint of Stevie’s first person.


I’ve been out of the loop for a few months. A bit busy, dealing with… things. I’ve just wandered back into the old watering hole – I think I’m more or less over it now. I’m feeling a bit older, and maybe a bit wiser. Everyone else, full of enthusiasm and spark – I certainly feel much older than the passage of time would suggest.And here’s my old friend, Rauser. Garn, I haven’t seen him in months. He looks a bit older too. Turns out – he’s been gone a few months as well. Busy. With things. But now he’s back – and he feels up to telling his tale.See, Rauser had – indeed, still has – a client. His client has this old system, and it’s not a bad program. It works just fine. But it’s getting on in years, and it’s showing it. Little bits have been added on, by all sorts – and it doesn’t seem to “flow”. The client wants a new system. A complete rewrite. One that will fix all the problems with the old system, and add a number of new features.

The client really doesn’t understand what this will take. He’s well-intentioned, and all, but he doesn’t have the experience to know just how long developing an application of this size will take, nor how much it will cost. Fortunately, he’s willing enough to listen to Rauser’s advice on how much time it really will take.

Now, this is going to be a big and complex project. These sorts of things don’t always work. We all know that. Sometimes the client runs out of money. Sometimes a few of the workers get a bit fed up with the whole thing. Sometimes the client doesn’t think that the current team is doing a good job. And sometimes, despite everyone’s best efforts, nothing useful comes out the end. You need a lot of things to go right for this sort of project to succeed.

Rauser has this really interesting idea for developing this project. An exciting new architecture, one that’s never been tried before – not on anything of this scale, at least. The client is enthusiastic. He decides to give Rauser the architectural lead on the project.

Still, there’s a solid chance that this project will fail. That sort of thing happens in this industry.

Work on the platform begins. And it’s going well. Things are going together just right. And then the platform – the bit with Rauser’s exciting new architecture – is finished, on schedule. Now we just need the application 🙂 They still don’t have a full spec for the project, but it’s not actually due yet anyway. All seems good.

Months advance. Progress is going well on the new application. But rumours are starting to spread. Some say the application is going to be overdue. It doesn’t actually look that way, yet, but those rumours are still coming from somewhere. Suddenly, new features start being added to the spec. Noone really knows who’s driving this change, but they’re turning up nonetheless. Still, it’s not much. Noone really minds. Some of this stuff actually looks interesting, anyway.

Extra resources are being added to the project. Too fast. Communications are starting to break down. A few streamlined paths to the getting to work, however, are visible. But they’re becoming increasingly complex. People are starting to need a lot of training just to figure out what they’re supposed to be doing and figure out how it all works. Remember the Mythical Man Month! And these new features keep being added to the spec – faster and faster. And nothing can be done about them. They can’t be held off, or pushed to the side. They need to go in now.

Management is getting antsy. They’re starting to get worried that things aren’t coming together. Communications between management and the people actually working on the project are breaking down. They’re putting pressure on for deliverables to be delivered, ahead of the nominal schedule. Well, what the workers understood the schedule to be. It all seems so fuzzy now.

The spiffy new architecture is working fine, though it’s not without its own problems, let’s just say. It doesn’t quite support the full load of the application’s needs, and so there’s there are very haphazard additions to it that they need just to get the application built. But it’s starting to stress everyone out. Particularly as the spec keeps changing. The client was this now, and this, and then that.

The project’s on schedule, and yet Rauser is feeling pressured to put 20 hour days into it. Everything that is normally part of his personal life is being left behind. He no longer goes and sees friends, or for a walk, or down to the pub for a few drinks after work. There is no after work. There is just work… and sleep. But not enough of that, even.

There’s a vague hint that maybe the architecture was wrong. It’s still working, but everyone is under a lot of stress. People are beginning to suspect that the project is doomed. Rauser, feeling responsible, is overworking himself. He’s sleeping at work, only eating the company food, not leaving at all. Communication between workers and management is completely nonexistant – probably just as well, as no-one’s had time to shower – let alone shave – for a couple of weeks.

One of the developers has quit. It became too much for him. They’re all starting to wish that they had the guts to follow him. They’re all being killed by this project, by the stress.

A couple more people have now completely burnt out. They just don’t have the will to work on it anymore. They’ve left too, and this is starting to look more and more like a death march.

And now Rauser finally realises what is happening. He knows he’s just spinning his wheels. He realises where he’s got to, what it’s doing to him. And he returns to life. He starts sleeping properly again. He goes down to the pub. This sort of project can devour the people working on it, who aren’t quite prepared for this sort of thing, he’s realised. The workers are naïve. They accept the 20 hour days, no sleep, no personal life – it’s just a result of their own incompetence, right?

And Rauser resolves, he’s going to spend some time teaching the workers how to keep their work and personal lives seperate. And fixing up those things that have been becoming a problem. He’s going to build out the platform, so that it can properly support the application. He’s going to organise the lines of communication, and document the work to date so people can easily see where things belong. And he’s going to get the spec frozen. He’s tired of marshmallows all the time.


And now, I’m me again. This is already longer than I intended, and I haven’t really said it yet. The crowd from Monty Python and the Holy Grail are yelling at me to get on with it.I’m young at this. I’ve only been in this industry for… not yet even 3 years. But as I read through this, and wrote up my interpretation of it – I realised that I’ve already had one of these projects. Just the one, and a small one at that. I had my own little architecture, a clever one, a nice way of building a solution to solve the problem. I’ve had a never-ending queue of changes, blocking the path to getting the work finished. The platform was neglected until it became a bit of a haphazard mess, not capable of supporting all the changes that are being thrown on top of it. And the changes kept coming.I was lucky. I had some people around who yanked me out of the devouring project’s mouth before I got swallowed up. And yet I saw it. I saw what was down there. And I can see what other people’s wolves look like now.

This writing here is not as good, not as elegant as Steve Yegge’s. It’s a translation, not my own story, even if I’m not ready to tell that one just yet myself either. So, if you hadn’t finished it (or yet started it), go and read That Old Marshmallow Maze Spell. You’ve seen the movie, now read the book!

Writing specifications

October 18, 2006

Shock horror! I’m actually posting something here about software design. Well, try and adjust: I’m going to be trying to shift things in this general direction in the future. No guarantees on just how often these posts might come about.

So you know, this is partially a reaction to Joel Spolsky’s (2000) 4-part article, Painless Functional Specifications. Excellent reading. Indeed, it’s probably best to be reading that first (all four parts). I’ll take “quality specifications are a good thing” as assumed here.

Now, as I see it, an intended user of a specification should want to pick it up and casually read through the whole thing.

Spolsky offers a number of tips for writing a specification that all its intended users want to read, and these seems solid.

Basically, if an intended user doesn’t feel like casually reading the whole thing, I see five possible results:

  1. They read it out of a sense of obligation and duty (“Someone’s gone to all this trouble to write this spec, I really should read it). In which case they’ll probably skip all the parts that they think they already probably know and anything that seems boring, and probably won’t thoroughly digest the rest of it.
  2. They read it because they’re bored and see an email attachment which they could kill 10-15 minutes by reading – for much the same result as a).
  3. They only read it when they want to find out how the user is notified that the input is invalid (or whatever). In which case all you can guarantee the specification to have achieved is that some people might know some things about some parts of the system (aka “we’d all have been better off playing Solitaire”).
  4. They don’t read it.
  5. They open the Word document, glance at the heading, scroll through the rest of it in the same way they probably read the MS Office EULA (ie. without actually looking at it, but maybe they notice some formatting), say “that’s nice” and close it. Which is effectively the same as d).

Note that I’m saying here that I have to be able to take the specification and want to read it on the bus ride home in the same way I might want to read a new Tom Clancy thriller, the point is just that reading a specification should be seen as something constructive, enjoyable and worthwhile.

The 10 worst ways to communicate with end users

August 10, 2006

Tonight I read an article “The 10 worst ways to communicate with end users“, and all of them seemed quite solid advice. One of the tips (#2 Showing Off), however, stated “Just because we happen to know all the correct technical terms and concepts does not mean we should use them when communicating with users”. Very fine and all, I just wish users would stop trying to use the correct technical terms when talking with me. Because let’s face it, they’re usually not very good at it.

It does so frustrate me when I see advice to turn off my CPU and VDU at the end of each day. Folks, it’s a computer, or, if you prefer, PC. Worst case scenario, maybe it’s a Mac. Unless maybe you want me disassemble my machine when I finish using it? And that other device? Screen. Monitor. Computer display. People use these terms every day. I have (had) never, ever heard someone slip the term “VDU” into a conversation. To make things worse, this then sparked a debate over whether you should turn off your VDU if you’re leaving for a few minutes. Not one of the participants used any of the commonly accepted versions. Why???

And then someone with (clearly) no technical background posts in an online forum regarding some improvements to the site’s interface, who informed all and sundry that they’d spent some time time researching the issue, and seemed to think that replacing the site’s HTML interface with GIFs would be a good idea. Not just have more pictures, but completely replacing the entire site (including form inputs…). A few minutes later, he posted that, after some more research, maybe PNG would be better? After some initial criticism, maybe the entire (highly dynamic) site could be replaced by PDFs?

When I have a cold of some description, I don’t first spend 15 minutes on the internet trying to figure out what it is on the internet, then go to the doctor and tell them I think I have somelatinnamitis. I tell the doctor I think I’ve got a cold and describe the symptoms. And let someone with training, experience, and a number of thick textbooks on the subject figure out what it might be. It’s really not that hard.

Rant out.