Friday, December 26, 2008

Shortenting the Feedback Loop - Aftermath


Well, I finally had opportunity to give a presentation in front of a large audience. Ok the audience wasn't that large. There were about 40 to 50 people. December 2008 my colleagues and I gave a presentation entitled "Shortening the Feedback loop - Our sprint in a nutshell" to the Calgary Agile Methodologies User Group.  

Seeing as this was my first presentation outside of school I think that it went pretty good. To make things more interesting our President Ben Snyman and Vice President TJ Snyman attended our presentation. They even chimed in a few times to answer questions and express their opinions during the presentation. I still have a lot to learn about becoming a great presenter but now at least I can check off presenting on my list of goals. The next time I gave a presentation I'll have to remember to ask someone to take a picture... We were way to focused on the presentation to even remember snapping a picture of this momentous occasion. On Luu 's blog you can find our slides and Mo managed to snap a picture of the audience on his cell phone.

The best part about doing this presentation as a group is that it gave us a chance to really sit down and find a way to articulate what we do to others. If Agile software development could be broken down into one concept I would call it "shortening the feedback loop".

Here's a synopsis of our presentation:
Under the Agile software development umbrella there are many principals, processes, methodologies, and practices that fit this style of development. Many companies are relentlessly seeking and implementing ways to continually improve how they design, develop and deliver software. We believe and have found in practice that the Agile way of software development enables, supports and drives this continuous quest for efficiency and improvement. One of the primary goals of Agile software development is to satisfy customer needs through early and continuous delivery of valuable software. We find that most of the business value comes from creating an environment where a shorter feedback loop allows our team to be more proactive and adapt quickly as and when necessary. In this presentation we will share and walk you through a typical sprint/iteration at eCompliance.ca and highlight to where we have shortened the feedback loop and increased efficiency and feedback quality.

Sunday, December 7, 2008

Merry Christmas From eCompliance

Take a look at our Christmas logo. It has a Christmas hat.

Saturday, December 6, 2008

Shortening the Feedback Loop - Our Sprint in a Nutshell

Check it out. ThirdAngle is doing a presentation for Calgary Agile Methods User Group.

Link to the presentation

It's kind of cool to see my name appear on the CAMUG website.

Thursday, September 11, 2008

2008 Lancer

Here are a few pictures of my car.




Thursday, April 10, 2008

Welcome To The Layer Cake

Your born, you take shit.
You get out in the world, you take more shit.
You climb a little higher, you take less shit.
Till one day you're up in the rarefied atmosphere and you've forgotten what shit even looks like.
Welcome to the layer cake son...

Health and Safety in Alberta

For the last little while my focus has been directed towards working on software for the health and safety industry. The following is a short description of concepts that are related to the health and safety industry for the province of Alberta. Some of the terminology and concepts mentioned are crosscutting among the health and safety industry in other provinces and countries...

What is a Certifying Partner?

A certifying partner is an organization that is responsible for assessing the quality of health and safety program's of its members. Alberta has 14 different certifying partners that target different industries. If a certifying partner approves your health and safety program your organization will be issued a certificate of recognition(COR).

Why are they called certifying partners?

The reason that we call these organizations certifying partners is that they have a partnership with Alberta Employment and Immigration. Each certificate that is issued by a certifying partner is co-signed by Alberta Employment and Immigration.

What is a certificate of recognition?

A certificate of recognition signifies that your organizations health and safety management system meets certain established standards.

What are the benefits of obtaining a certificate of recognition?

Other than providing a safe place to work for employees your organization may be entitled to a discount on your WCB insurance. Year after year companies are sued for poor health and safety practices. By establishing a health and safety management system your organization can save lives and prevent law suites. The end goal of a health and safety management system is zero incidents.

How do I get a Certificate of Recognition?

A certificate of recognition is rewarded to a company after the completion of a successful audit by an external auditor.

Who is eCompliance?

eCompliance provides solutions to increase health and safety awareness, decrease incidents and streamline the auditing process.

Who is ThirdAngle?

I work for ThirdAngle a division of eCompliance that focuses on creating many of the products that eCompliance customers use on a daily basis. For more information please check out: http://www.ecompliance.ca.

Thursday, April 3, 2008

Gagnez un Cafe / Win a Coffee

It finally happened. The unthinkable. The unimaginable.

Fifty cups of coffee over a period of five weeks coming to a grand total of $82.50 has finally paid off. I won a FREE COFFEE. I bet that you are jealous. I'm sure that it gets you steamed to know that I will use my free coffee to switch from my usual large double double to an Extra large double double. It's not entirely clear on the label but the rules state that you can use your winning rim tab for tea, hot chocolate or coffee at any size. The possibilities and combinations are limitless you can get medium, large, extra large, etc..

Yeah, I'm a Tim Horton's winner. Deal with it!



Tuesday, March 25, 2008

A Delightful Business Model

This post is not related to my current employer eCompliance. However, this post is related to many of my previous employers.

Wouldn't it be delightful to work in an environment where your salary is based purely upon friendship and the attendants of social functions. That's right, working hard and striving to be the best in your field are not predicts for success. These actions are frowned upon. After all, they don't help you climb the corporate ladder. So put that book down, turn your brain off and let's help someone else achieve their dreams at our expense.

Unfortunately, the business model described above is a sad reality. At one time or another we have all fallen victim to inconsiderate and greedy employers out to make a quick buck. Our hard work and dedication to our craft is exploited to help achieve the dreams and aspirations of someone else other than ourselves. This type of environment is characterized by: high turn over, water cooler talk, loss of passion and a never ending downward spiral.

Don't despair, there is a solution. In fact the solution is simple, find another job. Better yet, find a career. Find a career that allows you to perfect your craft. Some of you might be asking "but how do I do this Adam? ". To be honest, it's not easy. Here are a few options to consider:

  1. Become a consultant
    Consulting allows you to pick and choose the projects you work on.

  2. Find a company that cares about it's employees
    Start up companies often value and appreciate the hard work and dedication of its employees. After all, the success of a startup is very dependant on its employees. If startup's aren't your thing you can always work for a large corporation like Google, Microsoft or ThoughtWorks. If anything at least the aforementioned companies care about their employees.

  3. Win the lottery
    With the right amount of money you can spend your days perfecting your craft to your heart's content.

Don't get me wrong, there are negatives associated with each of the options stated above.

Aesop Rock is a underground hip hop artist who's lyrics helped to inspire this along awaited blog post.

9-5ers Anthem
We the American working population
Hate the fact that eight hours a day
Is wasted on chasing the dream of someone that isn't us
And we may not hate our jobs
But we hate jobs in general
That don't have to do with fighting our own causes

We the American working population
Hate the nine to five day-in day-out
But we'd rather be supporting ourselves
By being paid to perfect the past times
That we have harboured based solely on the fact
That it makes us smile if it sounds dope

The complete lyrics can be found here
more on Aesop Rock

Monday, March 24, 2008

Polymorphic PodCast

I just stumbled upon a new podcast called Polymorphic Podcast. Polymorphic is hosted by Craig Shoemaker. I'm still trying to figure out if shoemaker is his real last name. The podcast series focuses on software development in the .Net industry.

What I like about the podcast is that Craig seems like a down to earth type of guy. Unlike the .Net Rocks series there are a fewer number of podcasts. To be frank I have no Idea how Carl Franklin and Richard Campbell have time to record two podcasts a week. On another note the .Net Rocks podcast audio quality is vastly superior to polymorphics. I also enjoy the fact that the polymorphic series show length is about 30 to 45 minutes long and doesn't include commercials for Telerik products. I really enjoy the .Net Rocks series but can't stand to hear those commercials. I think the problem stems from that the fact that I have been listening to the .Net Rocks series non-stop for the last several weeks and those commercials are driving me nuts.

You can find the polymorphic podcast at http://polymorphicpodcast.com/

Sunday, March 23, 2008

A Filing Cabinet For Design Documents

From here on out, this is where I'm going to keep my design documents.


Tuesday, March 18, 2008

The Ultimate Whiteboard

Here are a few pictures of our whiteboard. April 1st 2008 ThirdAngle is moving to a new office and I think we may have to leave our whiteboard behind. There is no doubt that we will have to hire a team of about 20 people to build another ultimate whiteboard. Sadly the materials need to build such a whiteboard can only be found on the outer most reaches of Calgary.















Last but not least here is a photo of us building our monolithic whiteboad.



Sure it's not the prettiest office but we have a really big whiteboard. Come to think of it, it's not an office but a studio. To find out more check out Mo's thoughts on the office vs the studio.

Sunday, March 16, 2008

NAnt FTP Task

I came across the NAnt FTP task while automating the deployment of an application. This task is not included with NAnt. However, NAnt has made it really simple to install third party tasks. You can download the NAnt FTP task from:  http://www.spinthemoose.com/~ftptask/

To install this task you will need to do the following:

  1. Unzip the bin contents to your folder of choice. My choice was tools/nant/tasks/ftptask/

  2. Leverage the loadTasks task in your build file to load the assembly:

    <loadtasks assembly="${tools.dir}\nant\tasks\nantFtp\ftptask.dll" />

  3. That's it. Your finished. You can start to use the FTP task.

Here is an example of how I used the NAnt FTP task.

<loadtasks assembly="${tools.dir}\nant\tasks\nantFtp\ftptask.dll" />

 

<connection id="liveAuditToolConnection"

        server="YourServerName"

        username="Umm Your User Name"

        password="Umm Your Password" />

 

<target name="upload.application.only">

  <echo message="The application is being deployed to the live server"/>

  <ftp connection="liveAuditToolConnection" connectmode="PASSIVE">

    <put type="bin" localdir="${clickonce.dir}" remotedir="" flatten="false">

      <include name="${version}/**"/>

      <include name="setup.exe"/>

      <include name="index.aspx"/>

      <include name="${app.exe}.application"/>

    </put>

  </ftp>

</target>

Saturday, March 15, 2008

test.what.I.want target for NAnt

Allow me to introduce the test.what.I.want target. For this post I'm going to assume that you have or are using NAnt with MbUnit.

A special argument

The MbUnit application provides a very special argument called /filter-namespace. If you haven't guessed it yet this argument allows you to filter a suite of tests by a namespace.

mbunit.cons.exe /filter-namespace

An awesome target

The test.what.I.want target is very straight forward. The target first amalgamates the xunit.console.args property and the the namespace.to.test property into a single property called xunit.args. Next MbUnit.cons.exe is executed with the arguments supplied by the xunit.args property. The awesomeness of this target is categorized by its reusability.

<target name="test.what.I.want" depends="test.compile, test.copy.dependencies"

 

  <property name="xunit.args" value="${xunit.console.args} /filter-namespace:${namespace.to.test} "/>

 

  <exec basedir="${tools.dir}\mbunit\bin"

    useruntimeengine="true"

    workingdir="${build.dir}"

    failonerror="false"

    program="mbunit.Cons.exe"

    commandline="${xunit.args}" />

 

</target>

The bat file

This is where the magic happens. In order to make our test.what.I.want target dynamic we need a way to override the namespace.to.test property. Thankfully, the Nant.exe allows you to supply an argument that can override the value of a property. This argument is simply called "D". "D" is my new best friend. His only purpose in life is to set the value for a given property and he does it like nobodies business. Taking advantage of D's sick skillz we can achieve a level of dynamicisim never thought of before. D will allow us to change the namespace.to.test property to any namespace space we desire to filter by.

typical build.bat

@echo off
tools\pskill.exe notepad.exe (not typical but check out my previous posts to learn why)
tools\pskill.exe Ec.Aasp.OfflineTool.exe (not typical but check out my previous posts to learn why)

cls
tools\nant\bin\NAnt.exe -buildfile:Ec.Aasp.OfflineTool.build -nologo -logfile:build.txt %*
echo %time%


test.bat leverages build.bat
build -D:namespace.to.test="%*" test.what.I.want

Just incase you your new to bat files the %* is a placeholder for an argument.

An example using test.bat
>test Ec.Aasp.OfflineTool.Test.DataAccess

Expanding on this target

Now that you have this wicked little target, how can you take advantage of it.

  1. The first and most obvious benefit is that you can now test a single namespace on the fly at the command prompt. This comes in very handy when you want to test just one part of your project and you have not created an additional target. 

  2. Using this new target you can easily create additional targets. For example, here is a target that I recently created to only test the domain.

    <target name="test.domain" depends="test.compile, test.copy.dependencies">

      <property name="namespace.to.test" value="Ec.Aasp.OfflineTool.Test.unit.Domain" />

      <call target="test.what.I.want" />

    </target>

  3. Why not create more bat files. Lets face it, reduced key strokes equals increased productivity. Instead of typing "build test.domain" why not type "domain" or "test.domain". With our new test.bat file we can eliminate creating additional targets in our NAnt script. We can eliminate the test.domain target by leveraging the test.bat file.

    domain.bat leveraging test.bat
    test Ec.Aasp.OfflineTool.Test.Unit.Domain

    From the command prompt just type:
    >domain

Your creativity does not have to be limited to C# or your programming language of choice. NAnt, batch files, SQL, etc are all venues and opportunities where you can flex your creative muscles.

Thursday, March 13, 2008

Tests run: 1805, Failures: 0, Skipped: 0, Ignored: 0

This post is slight delayed but I figured it deserves some mentioning. We have been working on our current application for about 5 months. With each iteration our velocity for writing tests has been steadily increasing. Three months ago our development team consisted of roughly four developers. Today we only have two developers. Even though we are down two developers we have been able to surpass the number of tests that we could write with four developers. Now I know what your thinking, the other two developers were no good. Your wrong, the reason our test numbers have been increasing is that we have been ramping up our skill levels. When the other developers return I'm sure that we will be able to double our test numbers.

Anyhow our current number of tests is 1805. The important thing to remember is that tests are not the only metric for success. If you look closely at the agile principles I'm sure you can figure the other ones out.

Thursday, March 6, 2008

Domain Driven Design In a Nutshell

If you know anything about domain driven design, you know that the domain is the heart of your application. It is the warm little centre that the life of your project crowds around.

Jeff Palermo is the man. Jeff eloquently explained on DotNetRocks that he has a problem with layered architectures. Each layer talks only to the layer below it and so forth. This is the traditionalist view of a system architecture. Jeff likes to think of a system's architecture like an onion. At the core of the onion is the domain model. The layers around the domain model provide more functionality. This extra functionality can include persistence, reporting, aggregating concepts into different forms and much more. The outer most layers of the onion deal with human interaction. The outer most layer of an application could be a command window, windows form, web app, the buttons on a toaster. The neat thing is that if you peel away all the layers of the onion you are left with the domain model. In my opinion the domain model is king. Whenever, I have a new story to work on I focus on the domain first, then the UI and lastly everything in between.

(It kind of looks like an onion, but it most likely is crop circle.)

Map image

Saturday, March 1, 2008

Alan Turing

Alan Turing said:

"A man provided with paper, pen and rubber and subject to strict discipline with no understanding of the problem, should be able to solve any solvable problem."

I said(as a joke):

"A programmer provided with frameworks, wizards and drag and drop controls with no understanding of the problem, should be able to build any software application."

Friday, February 29, 2008

I Want...

If I had to make a list of wants this is what it would like:

  1. I want to develop applications using test driven development and domain driven design.
  2. I want good object orientated practices to be the norm.
  3. I want to be creative with design patterns.
  4. I want to work in a true agile environment.
  5. I want pair programming to be accepted by management.
  6. I want to work with XP.
  7. I want to work with Scrum.
  8. I want to help my team grow.
  9. I want to learn from my team.
  10. I want to work in a self organizing team.
  11. I want to work in iterations that range from 2-4 weeks.
  12. I want failing iterations to be caught fast and early.
  13. I want to introduce tests into legacy code.
  14. I want to work with bleeding edge technology.
  15. I want to work with passionate people.
  16. I want to work with knowledgeable people.
  17. I want to work with individuals who I can learn from.
  18. I want to work with fun people.
  19. I want to have friends rather than coworkers.
  20. I want to work in an environment that enables creativity.
  21. I want to work with a team of high performers.
  22. I want to use a build tool like NAnt.
  23. I want to have a CI Box.
  24. I want lots of whiteboards.
  25. I want to have time to read books, read articles and attend conferences.
  26. I want to take control of the .Net Framework rather than allowing it to control me.
  27. I want to have a chance to understand how a tool works before I use.
  28. I want my work to be appreciated.
  29. I want to help my company grow.
  30. I want to be active in the .Net community(present,attend presentations).
  31. I want to inspire others.
  32. I want to become a great software developer.
  33. I want my work to matter.
  34. I want to show people that I am Artist and software development is my canvas.
  35. I want to wake up every single day and be pumped about being a software developer.

It's remarkable but every single one of my wants is being fulfilled. I'm not sure why, but it took sometime before I came to the conclusion that I'm happy. I hope that every single one of your wants is being fulfilled.

Tuesday, February 26, 2008

Automating your Deployment

Check out this wicked NAnt target for clickOnce deployment. MageFileUpdater is a command line tool that I created for updating various parts of the deployment manifest and application manifest files. MageFileUpdater makes up for Mage.exe weak command line support. Mage via command line does not allow you to add an icon in the windows start menu or update the publisher name and product name. According to MSDN documentation the new version of mage packaged with visual studio 2008 allows you to update the publisher name. Even though that's kind of cool they are still missing a multitude of features.

In addition to this neat little target I am working on leveraging msbuild(exe) from nant to execute a msbuild file to create the boot strap that will install prerequisites for a clickOnce application.

The good thing about automating your deployment is that you only have to do it once. Hopefully in the near future I can throw together a few more posts about how we automated our deployment with NAnt and the many hurdles we had to jump. 

<target name="create.clickonce">   

    <call target="create.clickonce.dir" />

    <!--  Generates the application manifest file. -->

    <exec program="${dotnet.sdk.dir}\mage.exe" commandline="${mage.console.args.new.application}" verbose="true" />

    <!--  updates the application manifest file with the icon to be displayed in the start menu. -->

    <exec program="${tools.dir}\mageUpdater\MageFileUpdater.exe" commandline="${mageFileUpdaterConsoleArgumentsForApplication}"/>

    <!--  signs the  application manifest file -->

    <exec program="${dotnet.sdk.dir}\mage.exe" commandline="${mage.console.args.sign.application}" verbose="true" />

 

    <!--  Creates deployment manifest file -->

    <exec program="${dotnet.sdk.dir}\mage.exe" commandline="${mage.console.args.new.deployment}" verbose="true" />

    <!--  Updates the deployment manifest file with an association to the application manifest file. -->

    <exec program="${dotnet.sdk.dir}\mage.exe" commandline="${mage.console.args.update.deployment}" verbose="true" />

    <!-- Changes the deployment type in the deployment manifest. -->

    <exec program="${tools.dir}\click.once\click.once.console.exe" commandline="${clickonce.dir}\${app.exe}.application" verbose="true" />

    <!--  Updates the name of the publisher and product name. -->

    <exec program="${tools.dir}\mageUpdater\MageFileUpdater.exe" commandline="${mageFileUpdaterConsoleArgumentsForDeployment}"/> 

    <!-- Lastly deployment manifest file is signed -->

    <exec program="${dotnet.sdk.dir}\mage.exe" commandline="${mage.console.args.sign.deployment}" verbose="true" />

  </target>

Wednesday, February 20, 2008

What will this code YIELD

Can you figure out what the following code will yield on the screen.

using System.Collections.Generic;

using System.Windows.Forms;

 

namespace YieldReturnSpike

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

 

            uxPeopleGridUsingYield.DataSource =

                          new People().GetPeopleIWorkWith();

 

            uxPeopleGridNotUsingYield.DataSource =

                          new List<Person>(new People().GetPeopleIWorkWith());

        }

    }

 

    public class People

    {

        public IEnumerable<Person> GetPeopleIWorkWith()

        {

            yield return new Person("Mo Khan");

            yield return new Person("Joel Briggs");

            yield return new Person("Luu Duong");

            yield return new Person("Matt Gardiner");

        }

    }

 

    public class Person

    {

        private readonly string name;

 

        public Person(string name)

        {

            this.name = name;

        }

 

        public string Name

        {

            get { return name; }

        }

    }

}

Here are the puzzling results:

As you can see when the data source is set to a list with deferred execution the list is not bound to the data grid. I really don't understand why this happens. In order to figure this one out I will have to gain more insight into how the databinding works under the hood. I'll post my findings once I get some answers.

Saturday, February 16, 2008

Yield Return is Evil :-(Sometimes)

If you don't already know Justice Gray has put the word out that if don't read Mo's Khan Blog you are a loser. I would like to let everybody know that I read Mo's blog. Mo recently wrote up a great post about testing and deferred execution. Even though I was well informed by Mo's blog post I still fell victim to the evils of deferred execution.

I have decided to include the actual code that I was working on. I came to the conclusion that although a contrived example is a great tool for learning a real world example is better suited to exhibit how you can fall prey to deferred execution in the wild.

The Test Failure Message:

IMapper`2.MapFrom(any); Expected #1, Actual #0.
   at Rhino.Mocks.MockRepository.VerifyAll()
   at Rhino.Mocks.PlaybackModeChanger.Dispose()
   at...

The failure message simple states that the expected method MapFrom was never invoked.

The Test:

private MockRepository mockery;

private IXmlToIndustryCodesMapper mockXmlToIndustryCodeMapper;

 

[SetUp]

public void Setup()

{

    mockery = new MockRepository();

    mockXmlToIndustryCodeMapper = mockery.DynamicMock<IXmlToIndustryCodesMapper>();

}

 

public IXmlToWcbAccountMapper CreateSUTWithMock()

{

    return new XmlToWcbAccountMapper(mockXmlToIndustryCodeMapper);

}

[Test]

public void Should_leverage_the_industry_codes_mapper()

{

    StringBuilder xml = new StringBuilder();

 

    WcbAccountElementDefintion wcbAccountElementDefintion = new WcbAccountElementDefintion();

 

    string accountNumber = "123";

 

    xml.Append(wcbAccountElementDefintion.OpenTag);

    xml.Append(wcbAccountElementDefintion.AccountNumberElement.CreateElementFor(accountNumber));

    xml.Append(wcbAccountElementDefintion.CloseTag);

 

 

    using (mockery.Record()) {

        Expect.Call(mockXmlToIndustryCodeMapper.MapFrom(null)).IgnoreArguments().Return(new List<IIndustryCode>());

    }

 

    using (mockery.Playback()) {

        IEnumerable<IWcbAccount> wcbAccounts = CreateSUTWithMock().MapFrom(new XmlElementFactory().From(xml.ToString()));

    }

}

The implementation:

public IEnumerable<IWcbAccount> MapFrom(IXmlElement input)

{

    WcbAccountElementDefintion wcbAccountElementDefintion = new WcbAccountElementDefintion();

 

    foreach (IXmlElement wcbAccountElement in Parse.Xml(input).AllElementsNamed(wcbAccountElementDefintion.Name))

    {

        string accountNumber = Parse.Xml(wcbAccountElement).ForValueOfElement<string>     

                               (wcbAccountElementDefintion.AccountNumberElement.Name);

 

        IEnumerable<IIndustryCode> industryCodes = xmlToIndustryCodeMapper.MapFrom(wcbAccountElement);

 

        yield return new WcbAccount(accountNumber, industryCodes);

    }

}

The Problem:

The reason that this code fails is because of deferred execution. The following line is our culprit.

yield return new WcbAccount(accountNumber, industryCodes);

Simply calling MapFrom on the XmlToWcbAccountMapper will not invoke the MapFrom method.

IEnumerable<IWcbAccount> wcbAccounts = CreateSUTWithMock().MapFrom(new XmlElementFactory().From(xml.ToString()));

 

It's kind of like the wcbAccounts collection has a pointer to the MapFrom method. Once the Enumerator moves to the first item the MapFrom method will be invoked.

 

Since wcbAccounts is waiting to be iterated over the following line will never be called.

 

IEnumerable<IIndustryCode> industryCodes = xmlToIndustryCodeMapper.MapFrom(wcbAccountElement);

 

Actually none of the lines in the MapFrom Method will be invoked

 

The Solution:

 

The solve this problem we need to somehow cause the MapFrom Method to be invoked.

 

The first thing that comes to mind is that we could just loop over the collection of items.

 

foreach (IWcbAccount account in wcbAccounts) {}

 

If you were just interested in invoking the first call to yield you could do the following:

 

CreateSUTWithMock().MapFrom(new XmlElementFactory().From(xml.ToString())).GetEnumerator().MoveNext();

 

By moving to the fist element in the enumerator we are forcing the MapFrom method to be invoked.

 

To make this solution a little cleaner we could just create a new collection and pass the enumerable in as a parameter in the constructor. This would cause the new list to iterate over the collection.

 

new List<IWcbAccount>(wcbAccounts);

 

This is the final line of code that I ended up with:

 

new List<IWcbAccount>(CreateSUTWithMock().MapFrom(new XmlElementFactory().From(xml.ToString())));

 

Even though deferred execution has a few pitfalls it really is a powerful feature of the .Net Framework.

Wednesday, February 13, 2008

How to Avoid Embarrassing Build Errors

It happens to all of us at some point. We pull up the command window, type "build test" and before you know your knee deep in compilation errors. To make a situation worse your pairing partner has lost all faith in your coding abilities. Your partner no longer wants to work with and you are convinced that the other developers are laughing at you behind your back. Well don't fret, thankfully the good folks at JetBrains have a new feature in ReSharper 3.1 called Solution Wide Analysis. Solution Wide Analysis will help you avoid those embarrassing build errors by catching them before you even compile.

Honestly, you are losing productivity if you don't turn this feature on. By default solution wide analysis is turned off. To turn on solution wide analysis follow these steps:

1. With the Keyboard: Alt + R,  O

From here I recommend using the mouse since JetBrains seemingly forgot to add keyboard support. If you are listening JetBrains please add keyboard support to your options screen. It's some what silly that a product with so many keyboard shortcuts doesn't even have proper keyboard shortcuts in their own options screen. It's almost like the options screen was developed by a different development team or something. Anyhow back to the steps.

2. In the tree view under the code inspection heading click solution wide analysis.
3. Check the checkbox that says "Analyze errors in whole solution" I would have wrote "Analyze Errors" or "Analyze Errors in the whole solution". Now that I have found a grammar mistake please feel free to tear apart my blog posts.
4. Finally click the ok button and ReSharper will start to analyze your code.

If you look at the very bottom right corner you will notice a round icon. This round icon will display as green when the solution has no errors and red when there are errors. Double clicking on the icon will bring up a window that lists all errors. As an added bonus us keyboard junkies can simple press Alt + F12 to jump from error to error. If you would like to jump to a previous error just press Shift+Alt+F12. If you just want to jump to errors on the current page you can press F12.

This feature really comes in handy when you forget to implement a new method or property on an interface. I find that this typically happens when I mock out an object with Rhino Mocks. Everything appears to be fine with the test however a quick glance to the right corner of visual studio tells me immediately that there is an error. From there I just give it the old Alt + F12 and correct the error. Once the icon is green I know that I can build my solution without embarrassment.

What are you doing.... Go turn on this feature... Now... No excuses...

Tuesday, February 12, 2008

ThirdAngle has a Web Site !!!


Check it out, the company that I work for finally has a web site for our division: www.ThirdAngle.ca Just a little background: The company that I work for is called Media Logic. Media Logic has several divisions from software development to marketing to blah blah blah... etc... Anyhow the important thing is that you checkout our divisions web site.