Thursday, August 03, 2006

Lots of new posts

Just copied across the interesting posts from my old blog, enjoy!

DesignerSerializationVisibility attribute

When writing .NET components, often you don't want properties to appear in the Property Window. This is well documented and is achieved with the following [Browsable(false)] But what you also generally want to happen is for the property not to get persisted to the form in the InitializeComponent method. Unfortunately the Browsable attribute doesn't do this part of the job, but thanks to one of my colleagues, this is how you achieve that. [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] Perhaps there are occasions where these would be used separately but I can't think when they'd be

Use the tool, tool part 8

OK I lied, the last post wasn't my last post on .NET tools, there's one more. NAnt is a handy tool for automating builds. Although it's possible to drive Visual Studio.NET from the command-line, NAnt does lots of other things, like running your unit tests and zipping up files etc etc via an XML configuration file. I haven't used it a great deal myself, but I will be shortly.

Use the tool, tool part 7

Right I have one more .NET tool to recommend and then I'm done. And that is FxCop. This will analyse your assemblies and tell you all the problems it finds. And my word, does it find a lot of things. The fact is a lot of the rules are just plain anal, but it still finds stuff that could be a problem. And whats more, you can add your own rules, although I can't say I've ever done this.

Use the tool, tool part 6

Documentation is a right pain the behind, or at least it used to be. C# simplifies it a great deal by providing in-built support for it. XML tags can be added to your source code as you go along, so that 2 week task at the end of the project can be avoided. So once you've tagged all your code, what next? Download NDoc and you can generate help files just like the ones in Visual Studio. If it hadn't been for this tool, I'd probably never have got round to releasing a little project of my own into the wild. Another useful tool for generating documentation is GhostDoc, which automatically generates a first attempt at the documentation based on parameter names and method names. It doesn't always get it right, but it's often good enough.

Use the tool, tool part 5

I haven't covered the most useful .NET tool yet, the wonderful Reflector. If you haven't got this yet, download it now. One of the great things about Delphi development was the fact that Borland provides the source to the whole component library, which really helps tracking down weird bugs and work out how their stuff works. Microsoft don't provide the source to the .NET Framework, but with Reflector it doesn't matter. It can reverse-engineer any .NET assembly and you can see how it works. Yes, some class library developers obfuscate their libraries, but Microsoft don't and that's the most important library. Reflector also has several add-ins that do useful things like reverse-engineering a whole assembly which is useful for, er, more nefarious deeds. There are also plug-ins to generate Delphi code and other languages. So, as I said before, if you haven't got it, get it NOW!

Use the tool, tool part 4

If you've written some unit tests, the next thing to find out is how much of your code is covered, since you want to get as close to 100% as possible. This is where AQTime comes in. This profiler does all kinds of profiling but the coverage profiler is what you'll want to use here. AQTime may cost quite a bit of cash but it's worth every penny. Another use of AQTime is to track down performance problems. If I have a performance issue in some code, the first thing I do is turn to AQTime. Some people will think about what is causing their performance problems, but frankly what's the point? The theories they come up with are invariably wrong, because more often than not, the actual problem is caused by some poorly implemented algorithm, that manual analysis completely missed. Performance analysis should always be undertaken with the help of a profiler, since not only will it tell you the cause of the problem, but will also tell you exactly how much time you'll save by fixing it.

Use the tool, tool part 3

According to 'Working effectively with legacy code', any code without unit tests can be considered legacy code. That means pretty much every piece of software I've ever worked on is legacy code. Before .NET, writing unit tests was hard. In my Delphi days I tried to use DUnit but the language didn't lend itself to writing a tool that was simple to use. In .NET, attributes and reflection make it much easier. So we have NUnit, which has been the tipping point for me writing unit tests. As well as testing functionality, unit testing also helps validate the design of a system. If it's hard to write tests for your classes, chances are the design isn't too great. It suggests too much coupling and cohesion between the classes. Unit tests are always mentioned in the context of agile development, but there is no reason why they can't be used without adopting the whole philosophy. I have my doubts about some of the agile approach but I still believe unit tests are worthwhile. In the short term, they certainly add time to the development process, but I believe in the long run they save time and improve code quality. Of course management are often more interested in the short term (understandably since in the short term bills have to be paid), so unit tests may be a hard sell.

Use the tool, tool part 2

OK, before I get onto .NET tools, a bit of a diversion first into the realm of web based tools and HTTP. Fiddler is a great tool to see the traffic between IE and any web servers it's talking to. I've used it to track down performance problems and to see what cookies applications are using so I can hack them (meaning interact with them in a non-supported manner rather than steal credit card details...) If you're interested in HTTP calls that are made through some other app than IE, then TcpTrace is the tool for you. It's a little bit harder to set up than Fiddler (but not exactly difficult) and the UI isn't quite as polished but it gets the job done. It also supports any protocol, not just HTTP.

Use the tool, tool part 1

OK, the title is pinched from an article by Malcolm Groves, but I like it. After a week of having to work on an XLA written in the worst development language of all time, VBA, I suddenly realised the importance of using the right tools. You can be the best programmer in the world, but if you're using crap tools, your solution will still be crap. So here is the first in an occasional series of articles highlighting what I reckon are the best development tools. I spend most of my time doing .NET development, so I'm going to concentrate on that side of things. The first and probably most important tool is your IDE. And the clear choice is VS.NET 2003. OK, it falls over occasionally but I've very rarely lost any work. The choice is also easy just by a process of elimination. VS.NET 2002 was essentially a 1.0 product, so best avoided. VS.NET 2005 is a beta, so best avoided. And is just me, or is it one of the most butt ugly pieces of software ever? Delphi 2005 is, by all accounts, flaky as hell. Note, I still think Delphi is the best development language for Win32 client-side development, but for .NET forget it. SharpDevelop has one thing going for it, it's free, but other than that, it's pretty poor. So, almost by default VS.NET 2003 wins. Next time, more .NET tools

Wednesday, August 02, 2006

BPM software comparison

Over the coming days/weeks/months (depending on when I get bored) I'm going to take a look at some Business Process Management (BPM) software and see if it's any good. What is BPM software? Good question. I'm in no position to give a definitive answer to that and I'm sure a BPM expert would give a different answer but to me it's all about automating all the boring repetitive crap associated with any business so workers can get on with more interesting stuff. Or alternatively workers discover they aren't needed anymore and get shown the door... The BPM market is growing and there are heaps of vendors out there producing software so I'm only going to look at products that meet one criteria, they have to provide a downloadable demo version of their software I can play with. If a company doesn't have the confidence to provide a demo then I am deeply skeptical of their software. So the vendors I'll be looking at will be (in no particular order) Savvion, Fuego, Metastorm, Tibco, Fujitsu and Microsoft. I may cover some more if I find they have demo versions I can download. Keep reading!

Monday, July 31, 2006

House price crash? I hope so

When we bought our first flat in 1998, it cost us £99,950. At the time I thought it was a huge amount of money and I thought house prices couldn't rise any more. How wrong I was. Two years later we sold it for £175,000 and bought our current house for £220,000. Again I thought house prices couldn't rise any further and again I was way off the mark. In both cases I wasn't particularly concerned with house prices, since I never thought of buying a house as an investment but rather somewhere to live. Buying was (and still is) cheaper than renting for us since we were lucky enough to buy at a good time. Now our house is worth over £300,000 and by all accounts still rising, although the price rises have certainly slowed down. If we were starting over and looking to buy a place now we couldn't afford to, certainly not where we bought our first flat. I do wonder who can afford to buy somewhere now. But rising prices don't help us either. If we ever did want to move house, chances are anywhere we bought would be over the magic £250,000 mark, meaning our fees would be about £10,000. I can think of lots of things I could do with £10,000 and handing it over to the government doesn't seem the most appealing option. The guys at House Price Crash have been predicting a crash for some time, but they are still waiting for it to happen. The sooner the better as far as I'm concerned.

Friday, July 28, 2006

Windows Live Local vs Google Maps part 2

So I tried to switch to Live Local but my first problem with it is a bit of a showstopper. The map doesn't show tube or train stations, so for getting round London it's completely useless. Back to Google Maps... Windows Live Local 1 - Google Maps 1

Wednesday, July 26, 2006

Windows Live Local vs Google Maps

It all started with a trip to the wilds of Lincolnshire. We'd been there before but I didn't know the way too well, so thinking Google has the answer to everything I thought I'd use Google Maps to give us directions. Turns out the directions it gave us weren't too hot, causing much screaming and shouting between me and my other half who was trying to decipher the instructions. Admittedly where we were didn't help, all the roads and countryside looked the same. In the end we had to call the people we were visiting and ask for their help. Somehow they worked out where we were and guided us in. So for my next little trip I thought I'd give Windows Live Local a try. I was dropping my brother off at Heathrow airport so searched for directions for that. It's been a while since I've used the MS mapping stuff and it has certainly improved, in fact I think it may well have moved ahead of Google Maps. Google may have been first with the whole draggable map thing but they don't seem to have done a great deal since. But back to Heathrow, Windows Live gave sensible driving instructions and printing was completely customisable. Google Maps on the other hand suggested a completely insane route, via the M4. For the reverse trip it suggested a completely different insane route via the M25 and M3. Looks like Google thinks motorways are super fast which in the case of London certainly isn't the case. Final score, Windows Live Local 1 - Google Maps 0

Cunts are still running the world

Jarvis Cocker is back with a new ditty that won't be getting much airplay I guess. Not a great song but I can't help agreeing with the sentiment.

Tuesday, July 18, 2006

An unobjective review of Metastorm BPM 7

First the disclaimer, I used to work for Metastorm, I use Metastorm e-Work/BPM most days for my job and I'm a techy so may not be interested in the same things as a business user of the software. Finally I haven't got my hands on the software yet, so can't comment on stability etc. And because of all that, this review will be completely unobjective and uninformed. First up, and possibly the least important new change, the name. To my mind, e-Work was a good name, if only because my boss's company ranks highly on the search term 'Metastorm e-Work'. BPM on the other hand doesn't set the software apart from every other BPM product out there. It's like Microsoft calling their word processor software 'Word', what they did? OK, perhaps I'm wrong... Having had a quick look at the webinar, there are quite a few new features. Metastorm seem to be making a lot of fuss about the SharePoint integration, I'm not hugely interested in this but if you're a SharePoint shop already it looks pretty sweet and much improved over the previous ActiveX implementation, perhaps not in features but certainly in acceptability in the corporate world. The Designer gets a makeover, going down the Visual Studio route with dockable windows, which should be pretty useful in terms of screen real estate. There are new icons, but they look pretty ugly to my eyes. There are a few new features (including the ability to specify roles in a library which made me laugh since this used to be possible until it was pulled out of the product for some reason). You can now find which procedures use which libraries in the database, which is most welcome. Internationalization has improved but is not complete. It also hasn't been added to the Outlook client which is a shame and perhaps signifies the Outlook client may be coming towards the end of its life. There is a new Integration Manager, although I'm unclear what this is for, integrating with the bought out CommerceQuest stuff I guess. Overall I'm pleased to see there has been a reasonable amount of time spent on the core product, rather than features required to be buzzword compliant (anybody using that rules engine integration?). My personal bugbear with the product is the e-Work scripting language that just isn't powerful enough as a scripting language. Unfortunately the integration with other scripting languages still needs improving and it looks like these two issues haven't been addressed at all.

Friday, July 14, 2006

MMC RIP?

I never quite understood the point of Microsoft Management Console. It is a framework for building administration tools that allows end users to create their own admin environments by adding together as many 'snap-ins' as they like. But the cost of this is that any snap-ins have to fit into the MMC framework, which is fairly inflexible and forces an Explorer style interface on every snap-in. And who actually uses the customisation facilities provided? I certainly don't and have never seen a machine where the admin tools have been customised. So I was intrigued to see that the main admin tools in SQL Server 2005 are no longer MMC-based, they are just standard Windows applications (written in .NET methinks). So although Microsoft continue developing MMC (version 3 is coming out soon with support for .NET based snap-ins) it seems to me that the end may be nigh for MMC. As an aside, I helped develop an MMC snap-in for some software I worked on. Although they are generally pretty tricky to develop, Colin Wilson has written a great Delphi component set to help with the job if you really must develop one.

Friday, July 07, 2006

How to choose colours for a website

With my grade E in GCSE Art, my art skills have never been up to much. So my website colour choices have always been pretty ugly. I was therefore very pleased to find Colour Blender, which makes the choices for you.

Wednesday, July 05, 2006

Ajax.NET Professional

As always I'm late to the party, but I've finally got into some AJAX development. Since the project I'm working on is an ASP.NET 1.1 website, Atlas is no use to me, so I was pleased to find the free Ajax.NET toolkit. It makes development of AJAX based websites really simple. Add a line to web.config, add an attribute to a server-side method and then call it from client-side Javascript, it's that easy. The lovely thing about it is the way it copes with classes as well, my server-side method can return a class that can then be used in my client-side code. It may not actually be using magic but it sure feels like it.

Sunday, July 02, 2006

England suffer completely predictable World cup exit

It came as no great surprise to see England getting knocked out of the World Cup yesterday. As ever, the first time they had to play a decent team, they failed to progress. But what made this worse than previous efforts was that we appeared to have a squad capable of making a real challenge. Unfortunately our manager was clueless and decided to only bring 3 strikers (OK 4 if you count Walcott who Sven was clearly never going to select), 2 of whom were not fully fit. That meant when Owen was injured we were forced to play a formation that clearly didn't work. If we'd been able to play a more attacking formation, we might have got a goal that we could have protected when we went down to ten men. But with two strikers, Rooney would probably not have been so frustrated in the first place and might have been on the pitch for the whole match.