Stuff that's in my head

Can open... Worms? everywhere! The blog of Colin Angus Mackay
posts - 330, comments - 360, trackbacks - 43

Tuesday, June 30, 2009

Open Source Risk Management

Open Source Initiative Logo There are some pretty cool things happening in the open source space on the .NET platform these days and new projects are being started every day. However how do you sort the wheat from the chaff? How do you manage risk when using open source?

In this post I hope to address this issue as it relates specifically to open source frameworks that target .NET. Although I am sure the ideas are probably equally applicable to other forms of open source, I don’t have much experience outside of this field so I can’t really comment.

I have a some fairly simple rules when it comes to open source frameworks and perhaps they show me as being somewhat conservative but it works for me. I see that as trying to manage risks as effectively as I can. These rules are:

  • It must have a “buzz” surrounding it.
  • It must have reached at least version 1
  • It must have at the very least prebuilt libraries/assemblies/executables (as needed)

The “Buzz”

The first rule is that there must be a “buzz” surrounding it. By “buzz” what I really mean is that there is a viable community of people who are using the open source software so that if I need support there will be forums or discussion groups that I can join and ask my questions. This community will also have produced good quality documentation, tutorials, articles, blog posts, and so on.

When I start using a some open source framework I want to be able to ramp up quickly and get using it. I want to see that there is MSDN style documentation for when I need to dig into individual methods, properties and the like. I want to see that there are walk-throughs and tutorials so I can see immediately how everything fits together. If there are videos available they need to be good quality because it is really off putting to try and read source code on a video that’s been over-compressed. Podcasts discussing the high level stuff can be useful, but it has to be of the type that I can easily listen to in the car or while walking down the street because I will rarely listen to a podcast while sat at my PC.

A good open source project will also have fairly active support forums with questions being answered from those that understand the technology. It is interesting that lack of “support” is what many people claim as being one of the big risks with open source. However, how many times have you called Microsoft for support? (assuming you are developing on the Microsoft platform) In the last 14 years I’ve phoned them exactly once. Meanwhile, I’ve used newsgroups and support forums more times than I care to remember. The response from forums is usually quite good and well within the length of time I would generally wish.

However, not everything is rosy with forums, open source or otherwise. A couple of years ago I saw a forum dealing with an open source project where the main (possibly only) developer was an arrogant arse in response to any request for help. His standard response was “read the code”. That was it, end of discussion. There didn’t seem to be that many other people using his library so perhaps he put many people off. If this were a commercial operation, that person would have been removed as a support engineer for fear of losing sales. Then again, how many times do you hear of companies with poor after-sales support.

Incidentally, I’ve heard the response “just read the code” or “read the unit tests” from a number of open source advocates. That is one way to turn me away from the project. I really don’t have time to read the code when I’m evaluating a number of frameworks that do similar things. I want to see if the framework will do the job I want it to do. If it doesn’t do what I want it to do I want a quick easy way to short circuit the evaluation.

Don’t get me wrong here. I am not saying I never read the code. It can be extremely useful to read the code when tracking down a bug somewhere and you need to see what the framework is actually doing. What I’m saying is that it should not be the only source of documentation. I will often get around to reading some of the code before fully committing to the open source framework.

Release Version

The second rule is that it must have reached at least version 1. I’m not interested in using betas, CTPs or nightly builds. There are very few things I will use prior to a release. (Curiously as I type this, I’m doing so on a pre-release version of Windows 7. The other thing I’ll use in a pre-release form is Visual Studio – both major products in an already fairly mature state. I’ve been using Windows since 1992 and Visual Studio since 1995.)

What a version number gives above all else is a point where the developers stick their flag in the ground that people can rally around. Without that I could end up having to use various nightly builds. While the nightly builds are great for the testers and developers on a software system, I don’t think they are good for those building upon the system.

For example, if I have an issue and I go to a forum dealing with the framework I can very easily say I’m using, say, Version 2.1 and know that there will be a good number of people also using that version. If however I go along and say I’m using nightly build 518 then I might find that there are very few other people using that specific nightly build and that any potential solutions to my problem by people using other nightly builds may not be able to take into account some weird quirk that only happened in that specific nightly build.

The “standard” response would likely be to download the latest nightly build and use that. However, I see that as adding extra risk into my project. Apart from anything else I would now have to retest all the places where that new nightly build is being used. Sure, unit tests can help at this stage, but integration tests still need to be run, end-to-end testing, user testing and so on.

One of the advantages of open source is its speedy resolution and it may sound that my strategy here is negating that effort. I don’t believe that is so.

When a project has milestones and release goals the development gets to a point where all the features are there and the public interface has solidified although there may still be some bugs. At this point betas are released and a wider audience can evaluate the framework, report bugs, and generally give it a much more thorough testing that the core development team could do. By the time the framework is RTM’ed (although RTW maybe more appropriate in this internet age) the major bugs will have been worked out.

Once a release has been made even more people will start using it, so some of the more esoteric bugs will be found and a service release will likely become available shortly afterwards that rolls up a number of bug fixes. This is still a lot faster than most commercial offerings.

Pre-built Assemblies

The third rule is that the assemblies must already be built in advance. I don’t want the hassle of building these myself. The process is too prone to error in my opinion.

If I build the assemblies then there are risks based on the way my machine may be set up. I’ve seen systems where the build process is quite flake to begin with and I simply don’t want to add to that. I also don’t want to waste lots of time  having to faff about with a build process trying to get it to work as it can easily eat up a lot of time.

Incidentally, I may concede this point once The Horn Package Management Project reaches some level of maturity. However, it looks like it may be more useful for those developing complimentary open source projects to keep up with each other rather than someone like me.

Where’s the risk?

As I said at the start, I’m probably fairly conservative when it comes to using open source. I want to see that others are getting benefits and that the major bugs have been ironed out. Yet, I have no real concerns about using open source projects that are clearly maturing or are mature. In that scenario the risk is fairly minimal, and probably a lot less than using an equivalent commercial offering – After all, you still have the source code if the project stops, what do you have if the company fails?

 

CC-Attribution:

  • OSI Logo by Ken Coar (June 10th, 2009)

posted @ Tuesday, June 30, 2009 11:06 PM | Feedback (0)

Saturday, June 27, 2009

40% off Microsoft Press Books at Books24x7

If you are like me, then you spend hundreds of pounds per year on books, yet at the end I still don’t think I have access to all the books I’d like. I can’t go to my local library because they don’t stock the books I’m interested in. So for the past year I’ve been using Books 24x7 which gives me access to many more books than I’d ever be able to afford to buy for myself. I can search the books for the information I’m looking for on the web and if I want to take it off-line I can download a PDF.

At the moment they have an offer where by you can get 40% the subscription fee.

Follow these steps to receive a 40% discount to Books 24x7 E-Reference Library for Microsoft Press Titles, a virtual library that contains over 500 technology books that are published by Microsoft Press.

  1. Go to http://www.microsoft.com/learning/books/ereference/default.mspx

    Note: You can also watch a demo of E-Reference Library by clicking the "Watch an E-Reference demo" link on the page.

  2. Click the "Subscribe to an E-Reference Library" link at the top of the page.
  3. Click the link to the type of library that you would like to purchase. On the next page, you can review a description of the library.
  4. Click the Add to Cart..
  5. Type the discount code below that corresponds to the library type that you selected, and then click Apply.. The discounted price will be reflected.

    Discount Codes:

    • Desktop Library: EREFDESKB
    • IT Professional Library: EREFPROB
    • Developer Library: EREFDEVB
    • Complete Library: EREFCOMPLETEB
  6. Complete the checkout process to purchase the E-Reference Library at the discounted price.

posted @ Saturday, June 27, 2009 8:10 PM | Feedback (0)

Wednesday, June 24, 2009

Go Directly to Funky

In our office we have a notice board for the development team. It was there when I joined and I suspect its original function has long since been superseded by its new function of displaying any quotes, pearls of wisdom or witticisms of the day that members of the development team happen to find sufficiently amusing that it requires a degree of permanence.

So I give you, our notice board:

Developer's Noticeboard

Have fun looking through that lot.

posted @ Wednesday, June 24, 2009 11:23 PM | Feedback (0)

Friday, June 12, 2009

How to get a value from a text box into the database

This question was asked on a forum and I took some time to construct a reasonably lengthy reply so I’m copying it to my blog for a bit of permanence.

I suspect that many of my regular readers will be dismayed at the lack of proper architecture (e.g. layering) but we all had to start somewhere and I suspect that your first programs were not properly layered or structured either. I know mine certainly weren’t. My aim with this was to show how a simple goal can be achieved, what basic things are needed and how to fit it all together by doing the simplest thing that would work (a mantra from the agile world).

Here’s the post (slightly edited to put back some of the original context):

Okay - Let's step back and show the whole thing from text box to database. NOTE: that this example shows everything in one place. This is generally considered poor practice, but as you are only just starting I'll not burden you with the principles of layered architecture and the single responsibility principle and so on. (Just be aware they exist and one day you'll have to learn about them)

So, let's say you have a form with two text boxes, one for a name, and one for an age. Lets call them NameTB and AgeTB. The user can enter information in these text boxes and press a button that adds them to the database.

First, we need to get the data from the text boxes into a form we can use.

string name = NameTB.Text;
int age = Convert.ToInt32(AgeTB.Text);

Since text boxes only deal with strings we have to convert the string into a number (an Int32 - a 32bit integer) for the age value.

Now, we need to set up the database connection and command in order to insert this. I'll assume you already have a connections string to your database, I've called it myConnectionString for this example.

SqlConnection myConnection = new SqlConnection(myConnectionString);
SqlCommand myCommand = new SqlCommand("INSERT Person(NameField, AgeField) "+
VALUES (@nameParam, @ageParam)", myConnection);
I've now set up the SQL Command with an insert statement. I've assumed there is a table called Person and it has two columns called NameField and AgeField. I'm also going to insert the values via parameters, which I've indicated with @nameParam and @ageParam. SQL Server requires that all parameter names start with an @ symbol. Other databases may vary.
myCommand.Parameters.AddWithValue("@nameParam", name);
myCommand.Parameters.AddWithValue("@ageParam", age);
We've now added the parameters into the SQL command and we've given each parameter the value we got earlier. Finally:
myConnection.Open();
myComment.ExecuteNonQuery();
myConnection.Close();

This opens the connection, runs the INSERT statement and closes the connection again. We're using ExecuteNonQuery because we don't expect any results back from SQL Server. If we were expecting data back (e.g. because we were using a SELECT statement) we could use ExecuteReader (for many rows/columns) or ExecuteScalar (for a single value).

This is a very basic example. I’ve not shown any error checking or exception handling. There is also the implicit assumption that all this code resides inside a button click event, which is considered poor practice for anything but a small or throw away application.

posted @ Friday, June 12, 2009 10:39 PM | Feedback (0)

Scot ALT.NET: An Evening of O/RM

O/RMs help us bridge the gap between the database and the code base we love to write. On the night we will be looking at two O/RMs, NHibernate the most mature O/RM in the Alt.Net space and Microsoft's recently released Enitiy Framework, the young pretender to the O/RM thrown.

ScottLogic, a leading financial software and consultancy company based in Edinburgh, have been kind enough to offer the use of their premises for an evening of O/RM knowlege sharing and dicussion.  The event will take place on 2nd of July at 7pm, 17 Gayfield Square Edinburgh EH1 3NX.  All are welcome!

The agenda

19:00 – 19:30 Paul Cowan - An Introuction to NHibernate
19:30 – 20:00 Chris Canal - FluentNHibernate in 15 minutes
20:00 - 20:10 Break
20:10 – 20:40 Colin Gemmell - NHibernate vs Entity Framework - which is best?

After the meeting we will retire for a beer and some heated discussion.  If you are planning to attend, please let us know by registering at the Scot Alt.Net Edinburgh EventBrite page (http://altdotnetedinburgh.eventbrite.com/).

About the speakers

Paul Cowan has recently started his own business Cutting-Edge Solutions.  He is a keen advocate of iterative development, test driven development, continuous integration and modern techniques.  Paul is a regular committer to the horn open source project.  He recently gave a presentation on horn at the Dsl DevCon at Microsoft in Seattle.  You can follow his blog here.

Chris Canal has worked at a Web Developer for the past 7 years. Starting with procedural languages like ASP and PHP, he quickly moved onto the .NET Platform when first released. A great believer is continual–improvement, Chris is constantly looking for new technologies, tools and methodologies that will help in creating robust and maintainable software applications. Having felt the pain of using Microsoft "Demoware", Chris has become an active member of the Scottish Alt.Net Community to share his findings and ideas with like-minded developers.

Colin Gemmel is a Web/Application Developer working in the Medical Faculty of Glasgow University for the past 3 years. An avid follower of agile principles and practices he is always happy to pass on his views of software development to anyone that will listen. Colin is also a regular participant of the Scottish Alt.Net Community

http://scotalt.net/blog/2009/06/11/an-evening-of-orm/
http://www.scottlogic.co.uk/contact_info
http://altdotnetedinburgh.eventbrite.com/
http://groups.google.com/group/scotaltnet

posted @ Friday, June 12, 2009 12:28 AM | Feedback (0)

Tuesday, June 09, 2009

Things I’ve retweeted

I just had this fantastic idea. I share things I like on twitter by “retweeting” it. But I thought I’d spread the link love a bit more by blogging an aggregate of these retweets from time-to-time. The retweets here have been modified slightly so that links are more “normal”

 

 

* Actually, this was one of my comments that was retweeted by a few other folk.

posted @ Tuesday, June 09, 2009 8:47 PM | Feedback (0)

Sunday, June 07, 2009

Granny’s Shortbread

By request from Betsy Weber, I’m revealing my granny’s shortbread recipe (with permission).

Ingredients

  • 200g plain flour
  • 100g Butter
  • 50g Castor Sugar (called superfine sugar in the US)

Method

  • Mix the flour and sugar together
  • Cut the butter in to pieces.
  • Using fingertips rub it into the mixture until evenly distributed (almost like bread crumbs)
  • Knead the mixture together into a soft but not sticky dough.
  • Divide the mixture and shape into rounds (about 1cm thick).
  • Place rounds on greased baking tray(s)
  • Bake at gas mark 3 / 325°F / 160°C for about 45 minutes until the shortbread is a pale golden colour.
  • Cool before storing in an air-tight container

Variations

Instead of rounds, the mix can be spread out over a rectangular tray and cut in to fingers after baking, but before cooling.

I should also note that following the recipe above will not give the same results as the 8 decades worth of expertise in lovingly baking shortbread that my granny has. As a child the first thing I asked for when visiting was always: Did you make any shortbread?

posted @ Sunday, June 07, 2009 10:41 PM | Feedback (0)

Powered by: