SAFI Technologies Ltd

david@safi

An Ordinary Developer’s Rants
  • Home
  • About
  • Resources
  • Articles
Rss feed Subscribe

Software: Build or Buy?

Sep.22, 2009 in Project Management Leave a Comment

Good article explaining why customising off-the-shelf software is not always better value than building from scratch.

You will find that extending and customising COTS (Commercial Off-The-Shelf) systems is often a horrible variant of ugly hackery that’s almost impossible to do with good software craftsmanship. You will still have to hire developers, but instead of allowing them to build well architected solutions, you will be forcing them to do a dirty and thankless job. You can guess the calibre of developer that will be attracted to such a position.

Anyone who has tried to build a system on top of Sharepoint, or customise MSCRM will know the pain involved. It’s the same for pretty much any enterprise software system.

Each additional requirement over and above the out-of-the-box features will cost significantly more than the equivalent additional requirement of a custom system.

This is the 80/20 rule biting us. It’s tempting to assume that since an off the shelf product gives us 80% of the functionality we need, that’s 80% of the work done. However 80/20 tells us that all to often it can be as little as 20% of the work done. And the work we still need to do will be harder to do, because we’re working with a closed system that probably had slightly different objectives to our objectives, which will have quirks and bugs that we’ll only discover as we go, and whose extensibility points are generally going to be poorly documented, if at all.

CMS is the classic example of build v buy. Since there’s a bunch of free CMS’s out there, it should be a no-brainer. Most developers seemed to have had a go at writing one at some point or other, mostly as an exercise, and there have been a number of serious open-source efforts, but even with all the choice available, folk still find that writing their own CMS is the best bet.

So should you always build from scratch? Of course not. If you’re extending an existing product, then it effectively becomes part of your toolkit. Like all tools, you choose it based on how productively you can work with it (or you find people who can work effectively with it). And on the other hand, sometimes its easier or more cost-effective just to adapt your needs to the tools that are available.

Can’t Stop VS2008 from debugging JavaScript?

Jul.23, 2009 in ASP.NET, MS WTF, Visual Studio Leave a Comment

Blame IE8…

Visual Studio 2008 shipped with a feature to automatically enable script debugging when starting IE8 from Visual Studio. In other words, if you are using VS 2008 and IE8, there is no longer a need to tweak IE options to debug your site.

However, this feature unfortunately created a problem which we didn’t notice before VS 2008 shipped - web sites which create a large number of dynamic documents can perform quite poorly under the debugger, and now there is no option to run your site outside the debugger. If you open solution explorer and see the document list under ‘Script Documents’ dance up and down, you are running into this problem.

Apparently the workaround options are: Install Silverlight 2 Tools for Visual Studio 2008 SP1 (WTF??!) or hack the registry. Nice…

Or use Firefox instead.

Why you need software development…

May.26, 2009 in General Leave a Comment

If you put tomfoolery into a computer, nothing comes out of it but tomfoolery. But this tomfoolery, having passed through a very expensive machine, is somehow ennobled and no-one dares criticize it.

Pierre Gallois, via The Press (Christchurch newspaper), last weekend.

ASP.NET Page Lifecycle

Mar.12, 2009 in ASP.NET Leave a Comment

I always thought the ASP.NET Page Lifecycle was a bit of a minefield!

One of the comments intrigued me:

The Asp.Net postback functionality gives a lot of functionality out of the box. The average development shop does not have developers who have mastered SOLID principles, read every one of Uncle Bob’s books, implemented TDD with mocks and 85% code coverage etc etc.  For most of these shops, web forms IS simpler.

Unfortunately the commenter there is probably correct, but I don’t think that’s really a good defense of WebForms.  For two reasons:

  1. As soon as you try to do anything non-trivial in ASP.NET, you will need to know about the ASP.NET Page Lifecycle.  That’s time you could have spent learning good coding and design practices.
  2. Those points he’s talking about are not esoteric concepts.  The SOLID principles are fundamental design principles of Object Oriented Programming.  Developers who can’t grasp those are going to struggle with any complex development.  And if you’re using ASP.NET, you should either be doing simple Intranet stuff, or you should be doing a reasonably complex web app.  Otherwise you should be using something like PHP that’s cheaper and easier to host.

I can and have made complex apps work with ASP.NET WebForms, but too much of the complexity I had to manage was due to ASP.NET rather than to the business problems I was solving.  Now that a more maintainable platform is becoming available, there’s no way I’d willingly go back to WebForms.

The Best Part of Vista…

Feb.27, 2009 in General Leave a Comment

Is actually the User Account Control!

Okay, it isn’t really.  But it is gratifying having a quick way to tell Adobe, Java and all the other automatic update services to just Go Away.

Two wrongs may not make a right, but at least they cancelled each other out in this case.

Choosing a Laptop for Visual Studio development

Feb.17, 2009 in General 4 Comments

I was looking around for a laptop a wee while back. I wanted something for doing Visual Studio development on home projects. I also store photos and some music, but I’m not bothered about gaming.

[Read the rest of this entry...]

Tags: hardware, hp, laptop, review, thinkpad

Vista v XP

Jan.22, 2009 in General Leave a Comment

A new laptop came with Vista pre-installed so I finally was forced to got a chance to play with it.

So far Vista hasn’t been as painful as I expected it to be. Admittedly the laptop is pretty fast - a Lenovo T61 - and Vista SP1 was also pre-installed, but I have a similarly specc’ed HP running SP, and they feel pretty similar to each other.

The main differences I’ve noticed so far:

  • The UI is more pleasant to look at, with or without Aero. To me, XP always looked like it had been beaten pretty heavily with the proverbial ugly stick, though the Windows Media Theme and the Zune Theme did help with that. I still prefer Ubuntu, which lets you create pretty much whatever theme you like, and I wish MS would open up to this.
  • I’m pretty sure file transfers are a lot slower on XP. Even with SP1, there is a real problem with the File Transfer dialog, which gives you a Time Remaining estimate that isn’t even accurate on a calendar-scale. Coping my photo collection from XP onto an external hard drive took 10 minutes or so. Vista estimated that transferring them back would take over a day. For a few seconds the estimate went up to over 5 days. In the end it took about 30 minutes - still a lot slower, but at least not exponentially so.
  • I much prefer the new start menu. Partly because it doesn’t spread itself out over the screen, more because it provides a quick and effective search for programs and files.
  • Every few days I still hit some odd issues. Most recently - it seems that under certain circumstances Vista leaves a bunch of services running when you hibernate.

That’s pretty much it. I’m sure there are a lot of other differences, but none that I really care about. I prefer Yahoo Widgets to the Sidebar, Picasa to any in-built photo management, and iTunes to Windows Media Player, so I don’t really care about the software that comes with Vista.

Broad conclusions so far. I can’t see enough between them to care which comes installed. If I had a blank slate, I’d probably choose Vista if the machine was powerful enough, but I might change my mind if odd issues keep popping up.

(And I’d still prefer Ubuntu over either.)

Tags: XP Vista

ASP.NET and the Enter Key

Jan.15, 2009 in ASP.NET Leave a Comment

Because the Web Browser is very much a mouse-driven interface, we Web Developers we tend to forget to make web applications keyboard friendly.

The basic bit of functionality here is making sure the Enter key does something sensible.  By default ASP.NET will just simulate a click on the first control on the form, which is rarely what you want.

As of ASP.NET 2.0 there are actually two sensible mechanisms for setting the Enter Key:

  • You can set the DefaultButton attribute of  the main Form control; and
  • You can set the DefaultButton attribute of any Panel control.

The DefaultButton will act throughout the form, but any Panels that have a DefaultButton specified will override it.

I’m not aware that any other Controls have this attribute, so you may need to sprinkle Panels around your site.  I’ve noticed that, eg if you press enter while in the DetailsView, this does not necessarily submit the DetailsView, which should have been the default behaviour.

It’s easy to wrap your actual forms in Panels and set the DefaultButton of each panel to the submit button for that form.





When you use Master Pages, you normally won’t want any action at all when the user presses the Enter key.  A quick solution is to:

  • Add a Button within the Form control;
  • Add an OnClientClick attribute that returns false to cancel the click event.
  • For non-JS users, add an OnClick event handler that does nothing
  • Add a style=”display:none” attribute.  (Simply setting Visible=false won’t work - the DefaultButton won’t be set to a button that’s hidden server-side)
  • Set the DefaultButton for the form to that Button.
    protected void btnHidden_Click(object sender, EventArgs e)
    {
    }

Bizarre Programming Languages

Jan.14, 2009 in Programming Leave a Comment

As a good programmer you’re no doubt thinking of learning a new programming language this year. Here’s a great article linking to 10 bizarre programming languages.

In particular, I think Piet deserved an entry in Oreilly’s Beautiful Code:

Design Principles

  • Program code will be in the form of abstract art.
This says 'Piet' in Piet

This says Piet in Piet

Create Zoom buttons in Visual Studio

Jan.10, 2009 in Visual Studio 1 Comment

I’ve got involved in a project where some of the programmers have the habit of creating very long lines of code. When I’m scanning the code, I’m finding it helpful to shrink the font sizes so I can see more of the text, but after a while this becomes a little tiring on the eyes, so when I start writing code, I want to be able to increase the font-sizes again. I can do this through Tools - Options, but it’s a little slow. What I want is basically a Zoom function.

Happily I stumbled across a very easy way to create this. Visual Studio comes with a collection of sample Macros, among which are two to increase and decrease font sizes in the code editor window.

All you have to do is:

  • Go to Customize Toolbars (View - Toolbars - Customize)
  • Create a New Toolbar (the New button), giving it a name like My Macros, or My Toolbar, or whatever. This will create a new blank toolbar, which you can leave floating or drag into the toolbars area.
  • Click on the Commands Tab of the Customize Toolbars dialog and select Macros from the list on the left. The first couple of items should be the ones you want.
  • Drag them onto your newly created toolbar to create the new buttons.
  • You’ll probably want to Right-click on each to shorten the names.
  • When you’re done editing, close the Customize Toolbars dialog.

Because VS doesn’t give you any particularly good button images, I used the labels “aA” and “Aa” for my zoom buttons.

« previous entries  
  • Pages

    • About
    • Articles
    • Resources
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Recent Posts

    • Software: Build or Buy?
    • Can’t Stop VS2008 from debugging JavaScript?
    • Why you need software development…
    • ASP.NET Page Lifecycle
    • The Best Part of Vista…
  • Archives

    • September 2009
    • July 2009
    • May 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
  • Categories

    • ASP.NET
    • General
    • MS WTF
    • Programming
    • Project Management
    • SAFI
    • Visual Studio
    • Web Design
  • Tags

    .NET Accessibility ActiveRecord Architecture ASP.NET ASP.NET AJAX ASPX Buttons Communication CSS DataBinding DropDownList Essay FindControl Frameworks GridView hardware imagebutton jQuery LinkButton LinkButtons Monorail MS MultiView Naming Containers NHibernate Open Source Page Lifecycle PHP Project Management Projects Quotes Resources review Ruby on Rails SAFI Software Development Specifications SQL Tips Tutorial Validation Web Design WebForms XP
  • Blogroll

    • John Miller
    • Safitech
    • Scott Guthrie
    • Tim@SAFI
    • Toby@jethost

© 2007 david@safi - SafiTech Theme

Full RSS - Comments RSS