Posts

Ruminations of an IT contractor

Today was my last full time day on this contract.  Tomorrow I start up full-time with another.  Personally, I’ve gotten in the habit of looking a my past contract and conducting my own personal retrospective on what I learned or how I would do things differently.  I figured that because my memory is getting worse in my old age, I’d started putting these things down on my blog.

For a greenfield project, don’t use the database someone hands off to you

What is In A Name?

As I was driving home today, I couldn’t help notice something.  Microsoft’s ASP.NET MVC framework is still in beta, and was only announced last October.  To my knowledge, there are currently three projects in the Edmonton area based off this framework.

Castle Monorail has been around for much longer, three years or so?  It’s still listed as a release candidate on it’s website, but I’d say Monorail is suitable for production.  Currently, I am not aware of any projects in the Edmonton that are based off this framework.

Squawking About The Manning Early Access Program

*Note:  I originally wrote this post on August 23, 2008.  As things change with the book NHibernate in Action, I will be updating this post and resetting the date. *

I’d like to take a break from boring you two readers of my blog, and take a moment to annoy you with a rant.  Diversity is the spice of life after all.

This little remonstration of mine is about the Manning Early Access Program (MEAP).  Well, specifically just  one book.  I’ve got my eye on a couple of other books available with MEAP to see how they pan out before considering the whole “early access” useless.  Anyway…

Unit Testing in JavaScript

Well, I don’t know why it’s taken me so long to get to get around to this: but I must say that there are now a couple of “must haves” in my web developer’s tool box.  One of them is jQuery, and now the other is QUnit.

Chad Myers has a good, quick, post introducing QUnit, I’d strongly suggest checking it out if you do web development (which, IMHO, implies some use of JavaScript, right?).  Chad’s post covers the basics pretty good, and I think I would just be duplicating/plagiarizing Chad’s work if I were to blog the hour or two I spent getting to know QUnit here.

How Much TDD is Enough?

At the last Edmonton Agile Methods User Group meeting, we had a brief discussion around code coverage, and what should be an acceptable number to shoot for.  Is it okay when the unit tests cover 80% of the code?  Or should 100% be the only acceptable value?  After all, how can you be confident in your code knowing that 20% of it isn’t tested.

Allow me to go out on a limb here, and state with absolute certainty that the correct answer is “It depends on your situation”.  Allow me to elaborate.

Rod Paddock at EDMUG

Last night (Thursday, June 26th) Rod Paddock gave a talk on using Silverlight 2.0 to the Edmonton .NET User Group.  I’d say that Rod did a pretty good job, despite the fact that the beta of both Silverlight and Expression Blend didn’t exactly want to play nice all the time.  It’s definitely perked my interest in the technology, and I can see a lot of business potential for it.

The rich user experience that Silverlight brings to the web-browser, will, I think raise the bar for what web applications will do for businesses.  Forget all the buzz about ASP.NET MVC or MonoRail or ASP.NET 3.5.  This is just another layer of makeup on the tired, old, hooker that is application development in .NET.  Silverlight is what will make business users oh and ah and get excited about web apps again.

On the Functional Apex of Mainstream Build Tools in .NET

Wordy title.  To wordy.  Kind of like build files these days. I remember when I first discovered Ant, and then Nant*.  I was pretty happy, as it allow a decent way to compile my Java (and C#) without using make files.  Life was good as I could finally introduce some structure into HOW code was compiled.  The build process was no longer using whatever “build” command the IDE exposed, hoping that I didn’t forget a compiler directive or a file or a reference to some other library along the way.  Other programmers could also compile the code with out fear as well. 

ALT.NET Session \#6: Maintaining A Framework

Jeremy Miller talking about the trials and tribulations of keeping a codebase viable and useful over the past four years.  A lot of tips and explanations were backed with diagrams on the whiteboard.  Kind of hard to blog that stuff, so this will probably be just a collection of bullets.

Lessons learned - a lot of them relate back to what are considered good, OO practices:

  • DRY, especially with the very small things.  When Jeremy was adding support for .NET 2.0, the generic support was problematic.  
    Example:  Want to resolve a Repository<T>.  You can’t just look for the class Repository`1: i.e. was trying to resolve the class by using  typeof(Repository`1).  This did not work.
  • Tell, Don’t Ask.  Didn’t follow this to heavily at first, and so now effort has to be taken to rewrite code to adhere to this principle.
  • Using a lot of Double Dispatch (hah!  look Jeremy the picture did turn out):
  • If you need to refactor, do it now.  Procrastination only makes it (refactoring) harder and more costly.
  • If you want to build a .NET framework and keep it around for four to five years, you should probably learn a bit about the fundamentals of .NET.
  • Small steps, frequent commits to source code.
  • Good solid battery of unit tests really helps with major changes.
  • Moving more towards coarser grained tests.  Does the test check the functionality?  Not to worried about the intermediate steps.
    • Assertions based on side effects really don’t work well.  Not very expressive, sometimes hard to figure out what what you’re trying to test.
  • It helps have tooling inside your tests in order to help you quickly create tests, especially the difficult to setup/create tests.  Will result in a faster feedback cycle.  This infrastructure is more strategic, can be very help.
  • Jeremy recommends “Pragmatic Programmers”

Brief discussion about where to start learning all these pattern.  Advice is given to learn principles first (DRY, OCP, SRP, SOC, etc) as this will greatly help with the understanding and proper use of design patterns.

ALT.NET Session #4: Sprocs Good Or Evil / NHibernate with Cartoon Bears

Two topics merged into one.  Rod Paddock wants to talk about stored procs, and others want to learn how to explain NHibernate to other people who aren’t familiar with it (and minimize the jargon).

Rod uses a custom code-gen solution based heavily on sprocs - a data driven approach.  Sounds like it works well for him.  Oren concurs that this technique could be very effective in certain circumstances.  It will have problems with complex situations that deal with convoluted/difficult data scenarios.  He’s giving an example, but I just can’t keep up with him.  The point of Oren’s story is that a domain driven approach will would better when you’re not dealing with data but with data and behavior.

ALT.NET Session #5: Mono - Not Just For Linux

Joe starts polling to see what people want to talk about.  Most seem to be interest the libraries for Mono (being that they also work on Windows/.NET.  So, Joe starts talking about libraries for/from Mono.

  1. Mono.Cecil.  For all your reflecting and assembly modification needs.
  2. Mono.Addins.  I’ve been looking at this off and on today, and I have to admit it looks pretty intriguing
  3. Mono.Rocks:  Handy extension methods.
  4. Mono.Zeroconf: Zero configuration networking library
  5. DBus#:  A C# implementation of D-Bus.
  6. MonoCurses: An API for console based applications
  7. GTK# vs Windows:
    • My suggestion is to consider the target environment.  If you targeting Windows, stick with WinForms.  If you’re targetting Linux/Mac, go with GTK#. 
    • Another issue that might influence your decision is that the documentation for GTK# is pretty sketchy, not very good.
  8. IOMap.  Turning this flag on, will help you with some of the cross-platform development issues.  This is a portable library that will help resolve things like directory seperators, case sensitivity in paths, and that sort of thing.

A short session, which isn’t bad.  Gives me a chance to float around to check out some other things.