Learning F# Using Project Euler

I’ve decided that immersion is the best way for me to learn new programming concepts. My exposure to WPF came 4 years ago when I started at a new employer and was told that my first assignment was to learn the application codebase and create a WPF Datagrid that could display data from our application (the view of the data was dynamically composed using metadata from an EAV database). Needless to say, the effort helped bring me up to speed quickly with both the internal codebase and WPF.

I want to learn F# and have been looking for a way to immerse myself in it. Enter Project Euler, an online collection of math/computer science puzzles. I’m using F# to solve the problems one by one, purposefully using the functional aspects of the language rather than the OO aspects. Here is my solution for the first problem in F#

let list =
    [1..999]
    |>List.map(fun n ->
               if n % 3 = 0 || n % 5=0 then
                n
               else
                0)
    |>List.sum

printfn "Sum of integers %d" list

I’m trying to figure if there’s a way for me to remove the if…then…else clause (possibly using pattern matching). But I guess it’s a good start for now.

Posted by Mike Brown | 3 comment(s)

What is MVVM?

There has been a lot of confusion lately over just what MVVM is and what it isn’t. I think this confusion has led many to throw their hands up in disgust and/or frustration and swear off MVVM altogether. I think the confusion comes because people aren’t clear about the delineation between the pattern itself and the details of implementing the pattern. So here is my definition of MVVM.

Model-View-ViewModel (aka Presentation Model)

Problem: You have a UI with complex, interdependent interactions.
Solution: Separate the UI from the UI logic using a ViewModel that encapsulates the interactions and provides properties for a View to retrieve its state (and the state of its elements).

This is the long and short of MVVM Nothing more nothing less. Everything else is an implementation detail. If you use INPC or not, if you use Code-Behind in ASP.NET or Data binding in WPF/Silverlight. If you use DelegateCommands, RelayCommands, or RoutedCommands. If you use attached behaviors or Blend behaviors, VSM, or data triggers is not a concern of the pattern. The pattern is overkill for "Calculator Examples" (unless of course your calculator is storing a stack of historical operations for undo/redo). The pattern is not mutually exclusive of using a Front Controller for navigation.

I think the majority of frustration regarding MVVM comes from a lack of this fundamental knowledge of what it is and what it isn't. So there, I've spelled it out. HOW the pattern is implemented is up to the individual.

Posted by Mike Brown | 8 comment(s)

Sacha Barber’s New WPF Framework

Today, Sacha Barber and a few of his colleagues released an article on CodeProject about their new framework for WPF. The article appears to be a preview for their upcoming book.  I looked a little closely at the article. And based on it my recommendation is that people not purchase the book. I mean it’s not even a great example of using baboons (seriously a tool tip? do you know what a baboon will do when the tooltip is hidden…you really don’t want to see the results). And the article (and book) only appears to deal with Baboon Converters which is just a tiny subset of Animal Conversion in WPF.

To me here are the core pillars of animal conversion:

  1. 800 Pound Gorrilas
  2. Elephants in the room
  3. Bulls in China shops

An ancillary topic would be bugs in rugs, but they are more advanced than the other three. I doubt Sacha has even considered the ramifications of implementing bugs in rugs? What about serialization (even though the bug is in the rug, you really should serialize the bug before the rug...serializing the rug first should get messy)? I mean seriously ANYBODY can handle Baboons. They're friggin baboons! Show me how you handle snakes in the grass (or worst yet on a plane) then I'll give you some credit. But don't expect me to pat you on the back for handling a conversion my 4 year old daughter can do.

I guess it's a good beginner's introduction to the concept of animal converters. But that's insulting to beginners when you think about it.

In summary, I recommend that you not buy “Learning Baboon Converters” As much as I respect Sacha…he’s a great guy. I can’t with good conscience recommend this book.

Posted by Mike Brown | 3 comment(s)

Equality

This is something that I’m surprised isn’t included in the framework out of the box. When using the Distinct Query operator, one of the overloads takes an IEqualityComparer<T> instance. There is friction in creating a separate IEqualityComparer<T> implementation for every object you want to compare and in some cases, Equality means something different depending on context so you don’t necessarily want to implement IEqualiyComparer<T> directly on your T (and/or you aren’t able to do so because it is a class from someone’s library).

Whatever your reason, here is a generic implementation of IEqualityComparer that works similar to my DelegateCommand. You create an instance of it on the spot (or cache an instance) passing in lambdas that represent your equality logic.

public class Equality<T> : IEqualityComparer<T>
{
    private readonly Func<T, int> _hashFunc;
    private readonly Func<T, T, bool> _equalsFunc;

    public Equality(Func<T,int>hashFunc)
    {
        _hashFunc = hashFunc;
        _equalsFunc = (x, y) => x.GetHashCode() == y.GetHashCode();
    }

    public Equality(Func<T,int>hashFunc, Func<T,T,bool>equalsFunc )
    {
        _hashFunc = hashFunc;
        _equalsFunc = equalsFunc;
    }

    public bool Equals(T x, T y)
    {
        //can't compare null
        if (typeof(T).IsClass)
        {
            if (x == null || y == null)
                return false;
        }
        return _equalsFunc(x, y);
    }

    public int GetHashCode(T obj)
    {
        return _hashFunc(obj);
    }
}

The first constructor overload takes just the hash function and specifies that the hashcode is your identifier (great for entities with an Int as their id). The second constructor takes a hash function and an equality function. Using Equality<T> is as simple as:

var manufacturers =
     Catalogs.Select(c => c.Product.ManuFacturer).Distinct(new Equality<ManuFacturer>(i => i.Id));

Hope it’s useful to you!

Posted by Mike Brown | with no comments

Intention Revealing Interfaces or Car.FuelInjectionSystem.FuelInjectionRate.Increase()

I was having a discussion with Josh Smith about my upcoming article in MSDN Magazine on enterprise patterns with RIA Services. It’s basically a deep-dive into the technology that goes beyond the Drag-n-Drop demos you’ve seen so far. Josh’s feedback was generally positive but he had one comment on my section on Domain Models and Intention-Revealing Interfaces. Here’s the section in question

…[quoting Eric Evans’ Domain Driven Design]

If a developer must consider the implementation of a component in order to use it, the value of encapsulation is lost. If someone other than the original developer must infer the purpose of an object or operation based on its implementation, that new developer may infer a purpose that the operation or class fulfills only by chance. If that was not the intent, the code may work for the moment, but the conceptual basis of the design will have been corrupted, and the two developers will be working at cross-purposes.[ (Evans, 2004) pg 246]

To put it simply, by explicitly naming the function for its purpose and encapsulating the logic (along with a few comments to make it clear what’s happening), I have made it easy for the next guy (even if the next guy is me 5 months from now) to determine what is happening before he even goes to the implementation.

Josh’s comment:

So what you’re saying is that I should name my functions according to what they do and write relevant comments?  Seriously? 

I had many similar moments when reading Eric Evan’s book where my response was “well d’uh”. But I got to thinking, how often have I seen code that doesn’t follow this simple rule. To make it patently obvious let’s look at some code that will make a car accelerate:

sCar.FuelInjectionSystem.FuelInjectionRate.Increase()

What’s that, you have an electric car okay:

switch(sCar.Engine.EngineType)
{
    case(EngineType.InternalCombustion)
    {
        sCar.FuelInjectionSystem.FuelInjectionRate.Increase();
    }
    case(EngineType.Electric)
    {
        sCar.Motor.Battery.Amperage.Increase();
    }
}

You’re on your own if you have a Mr. Fusion powered car. I have no idea how they work (although according to FuturePedia the Mr. Fusion doesn’t actually power the car only the Flux Capacitor). But I digress, as the consumer of the car API, I really don’t want to be concerned with fuel injection rates or battery amperages. Please don’t get technical on me and explain that it’s actually wattage that is adjusted on the battery not amperage or whatever snide remark you have regarding the accuracy of my functions. That’s the point of this post because of the car’s design I don’t have to know how it’s done. And neither should the consumer of your car’s API. It should be a simple call:

//look at that!
sCar.Go()

480_S-Car-Go-769045

 

 

That is the point of the intention revealing interface. Instead of making your consumers have intimate knowledge of the innards of your system to make it work, provide them with a simple interface that tells them exactly how to make it do what they want to do.

It may be obvious when you read “explicitly name the function according to its purpose”, but following that advice tends to be less commonplace than it implies.

Posted by Mike Brown | with no comments

Windows Phone 7 the Belle of the Ball

With its noticeable absence from PDC 2008 and 2009, it appeared that Windows Mobile had all but been abandoned. Yes and no. Windows Mobile is no more . Say hello to Windows Phone.

The opening keynote for Mix 2010 was all about Windows Phone 7. If it weren’t patently obvious from the various leaks and pseudo announcements, WP7 uses Silverlight as the primary developer platform. It also supports XNA for game development.

The developer tools for Windows Phone 7 are Free. Included in the tools:

  • Visual Studio 2010 Express
  • Blend 4 for Windows Phone
  • XNA Studio 4 for Windows Phone
  • Windows Phone 7 Device Emulator

All the tools except Blend 4 are included in one handy installer And Christian Schormann shows where you can get the Blend tools here.

The keynote will be available for download tomorrow (in case you missed it). There are a ton of features for Windows Phone 7 that were highlighted in the keynote (I’ll provide a synopsis later). But why are you waiting for me to tell you? Go download it yourself!

2010 MVP Summit Recap (Or How to Slay a Robeast)

No you’re not going to get an inside dish on what to expect at Mix (if you can make it, I HIGHLY suggest you go…unfortunately, an urgent contract popped up for me that prevents me from going…now that I think of it, considering the nature of the contract, I’m sure the client will understand my desire to go to Mix…so maybe I will be able to go). In fact, even if I were crazy enough to break my NDA (I think I can talk about my NDA without breaking it), I wouldn’t be in position to tell you anything. You see, the summit was scheduled at an inopportune time for me this year. Because of its dates:

  1. I was gone on Valentine’s Day
  2. I was still gone on my Wife’s birthday
  3. I wasn’t able to attend any sessions because of a focus group I was attending during the day.

Granted, the Summit alone wasn’t to blame for 1 and 2 because 3 would have had me in Redmond regardless, but missing the sessions was a heartbreaker for me. It’s an opportunity to interact with the product groups and give a lot of feedback and input on the direction they should take for next revs of the products. I can point to two features in Silverlight 4 that I can literally say “That was my idea.” from my participation in last year’s Summit.

DESPITE missing all of the sessions at the Summit, I can still tell you that I would go again in a heartbeat and here is why. I decided that I would fly the red eye on Friday so that I could participate in the side sessions during the day. I ended up…losing interest in the morning keynote and went to the lobby and pulled out the laptop to do some hacking. During a break to “get some fresh air” I met an Exchange MVP who mentioned that he had an idea for some software leveraging Exchange Web Services but that he wasn’t a developer so hasn’t had the time to do anything about it. I listened to his idea and it sounded very interesting. So I asked if he had time and would like to tinker with it.

Two hours later (would have been much quicker if I hadn’t screwed up my Hyper-V configuration…need to remember to blog that experience so that if I bump into it again, I know how to resolve it much more quickly), I’ve got an Exchange server configured for development and the core design of the solution. In addition working on that solution provided some ideas that would be useful in another project.

This is why I love the MVP program. It brings the most knowledgeable people about Microsoft’s products under one umbrella. Learning Exchange on my own would have probably taken me about a week to get it installed. Having an Exchange MVP helped me boil that effort down to about 30 minutes. It probably would have been quite a while before I had enough experience with Exchange before I would have thought of a similar idea independently.

On the other side my new associate who had little recent programming experience gained an “expert” who could help make his vision reality in short order…in fact we already have a simple internal solution in place, the next step is to make it “user friendly”(I’ve heard this is an important feature for commercial products).

What this anecdote demonstrates (and I have a few others from the week)  is a benefit that far outweighs any other that the program offers (although I’ll take those too thank you very much), being able to easily network with recognized community leaders in technology. Think of it like Voltron, individually the lions are powerful, combined they can slay any beast with a single slash of the blazing sword.

Posted by Mike Brown | with no comments

Make Cheap Software or Make Software Cheap

I came across two interesting items on the web today. The first was Rocky Lhotka’s mCSLA series in which he presents a DSL over CSLA. I know, I know but let’s put our opinions about CSLA aside and look at the really important point. Here is a sample of Rocky’s DSL

Object Customer in Test
{
    Allow Create{“Clerk”};
    Allow Edit{“Clerk”};
    Allow Delete{“Clerk”};

    Public ReadOnly int id;
    Public string Name{
        Allow Write {“Clerk”};
        Rule StringRequired;
        Rule StringMaxLength{50};
    }
} Identity Id;

Altogether, about 10 significant lines of code written. I’m going to let that simmer for a while and move to the second post of interest. This time from Uncle Bob. In this post, Uncle Bob points out that it costs about $11 per SLOC and points to a sample line of code:

StringBuffer nameBuffer = new StringBuffer();

So let’s look back at Rocky’s code (and I highly recommend watching the video). There’s a helluva lot more embedded in Allow Create{“Clerk”} than in StringBuffer nameBuffer=new StringBuffer();

That one line:

  • Tells Rocky’s framework to give the “Clerk” role permission to create a Customer object
  • Wires up the UI (although very rudimentary) to create a new Customer
  • Handles all the plumbing to save the Customer to the database

On top of all this, the code is generated CONSISTENTLY. So you don’t have to worry whether Uncle Bob remembered to dispose of his database connection, because once you program the framework to handle it, that’s the way it’s done. I would guess that each of those bullets would take an average of 7 lines of code to write by hand (that’s not even counting unit tests). 21 lines of code replaced by one. If this doesn’t sell the value of software factories to you, I don’t know what will.

Posted by Mike Brown | with no comments

Accounting for Cost of Sales with Currying

I have a quick question for you. If you’re selling a widget for $100 and the local sales tax is 8%, how much should you add to the cost of the item to cover the sales tax? If you said $8 or 8%, you’re losing money. To the tune of 64 cents a sale. (Do the math, 8% of 108 is $8.64.)

What’s 64 cents you ask? Over a hundred sales it’s $64, over a thousand it’s $640. And over a million sales it’s $640 thousand dollars! Granted, in the process of losing that 640 thousand dollars, you’ve made $108 Million in pre-tax revenue. But more than half a million dollars in lost profit is nothing to scoff at either. But that’s what every POS system out there does. I’ve just checked in the code for Azure POS (the Silverlight/.NET 4/Azure exemplar I’m developing for my Mix content submission) that does it right. The functionality gave me a good opportunity to demonstrate simulated currying in C#.

Indian Food, Lambdas, and Sales Tax

Currying is a feature of most purely functional languages (named after Haskell Curry) whereby a function that takes two parameters is transformed into two functions, the first function takes the first parameter and returns the second which takes the second parameter and returns the result. In fact most functional languages, multi-parameter functions are at their core represented just as that. To clarify let’s look at declaring a multi-parameter function in F#:

let applyTax(taxRate:double) (amount:double)
  //insert computation here and return result (declared as a double
  result;;

In C# this is equivalent to

public double applyTax(double taxRate, double amount)

Well not really. There’s a significant difference between the two and this is where currying comes in. The declaration in F#, when entered into the F# Interactive will give the following output:

val applyTax : double->double->double

This is read as “the value applyTax is a function that takes a double that returns a function that takes a double that returns a double.” So for instance if you know the tax rate (say .08) you can pass it to applyTax and have a handle to a function that will take the amount and apply an 8% tax to it. F# is pretty cool like that.

Getting Func<e> With It

So how can we do that in C#? Simply make an overload of ApplyTax that returns a func<double,double>

public func<double,double> ApplyTax(double taxRate)
{
    return (amount)=>{ApplyTax(taxrate,amount);}
}

Now I can create variables for the different tax rates at my various retail stores

var applyCookCountyTax = ApplyTax(.10);
var applyLakeCountyTax = ApplyTax(.08);

This is the plight of retailers in the Chicagoland area. There is a 10% sales tax in Cook county. That means you’re paying $20 more to buy a $1000 TV in Cook County than in Lake County and retailers close to the county line lose sales to this disparity. In reality you’d probably store the functions in a Dictionary rather than holding them in individual variables.

var taxAmount = store.TaxTable[“Cook”](100);
//taxAmount =8.70

The Secret Sauce

The solution to the question is simple algebra let x equal the amount of the sale and z be the tax rate you need to find y such that when x and y are added, multiplied by z and subtracted from their sum you get x.

x+y – z(x+y) = x
x+y – zx – zy = x
y-zy = zx

Given x and z solving for y is trivial. Now you can wear a smug smile when you make a purchase at Best Buy knowing that you’re not footing the bill for sales tax. That is until you realize that the REAL sales tax is the markup they add over their wholesale price for that TV you just bought.

Extra Credit

Wes Dyer has an interesting post about simulated currying in C# on his blog. Also I’d imagine that using dynamics it might be possible to declare a base class that auto curries any functions declared in

The Pomodoro Technique

I was going to talk about how my digital cleanse reminds me of a macro scale Pomodoro. Then I realized that I never really talked about the Pomodoro Technique. The Pomodoro Technique is a method for getting organized and being focused. It is a time management system created by Franesco Cirillo. I’m going to let him tell you how he came up with the concept:

One day in the classroom on campus where I used to study, I watched my classmates with a critical eye, and then looked even more critically at myself: how I got myself organized, how I interacted with others, how I studied. It was clear to me that the high number of distractions and interruptions and the low level of concentration and motivation were at the root of the confusion I was feeling.

So I made a bet with myself, as helpful as it was humiliating: “Can you study – really study - for 10 minutes?” I needed objective validation, a Time Tutor, and I found one in a kitchen timer shaped like a pomodoro (the Italian for tomato) – in other words, I found my “Pomodoro”.

So the basic concept is to take a block of time and devote it solely to a single task. Rather than saying “I’ll work on this task until it’s done” you say “I’m going to work on this task and ignore all distractions for X minutes. Then I will stop for a quick break. And work on it for another X minutes” The key to the Pomodoro is working within a box of time and then stopping to integrate what you’ve done up to that point. The break is just as important as the time box. Taking a break allows you to evaluate what you’ve done on the task up to this point. Cirillo recommends 25 minute time boxes with a 5 minute break.

Dealing with Interruptions

Invariably, when working on something, an interruption will occur. Someone will stop by your desk, your phone will ring, an IM will pop up, an email will arrive in your inbox, or your twitter client will chirp to alert you to a new tweet. Some of these can be avoided altogether turn off alerts for email and twitter; set your phone to DnD (send straight to voicemail or mute the ringer if you don’t have built in DnD); set your IM client not to disrupt you (use trillian to provide a nice auto-response saying you’re busy to help avoid offending someone who feels you’re ignoring them); and close your office door. Don’t have an office door you say. It’s still possible to address that issue. Just look at your timer and say “I’m busy right now can I get back to you in X minutes” and put your headphones back on that obviously didn’t provide a big enough hint that you didn’t want to be disturbed.

The standing rule is that if you can address the interruption within 15 seconds, you haven’t invalidated your Pomodoro.

That Five Minute Break

Remember that co-worker that tapped you on your shoulder 15 minutes ago? Follow up with him. Check your email, look at twitter, look up the name of that class that you needed to use for the matrix transform, take a five minute stroll around the office, get some water, go take a bathroom break. Do whatever it is you need to do just STOP WORKING ON WHAT YOU WERE DOING!

Multi-Pomodoro Tasks

No one is telling you to break down your tasks so that they all fit within a single Pomodoro. That’s as crazy as a soup sandwich. What the time box allows you to do is switch contexts if need be. Say the annoying co-worker (who sent an Email, IM, and Voice Message within the 25 minutes but still didn’t get the hint) alerts you that the client wants the header to be Teal instead of lime green and they need that update within the next hour (“make it 45 minutes since the hour started when I came to your desk”). You can reprioritize and use the next Pomodoro to make the lime green header teal.

The Activity Inventory

So how do you get these tasks? Just like lean and agile software development processes use a backlog for tasks that aren’t currently being performed, the Pomodoro technique uses an activity inventory. In addition because of the fine grained nature of Pomodoro there is a more localized activity inventory sheet: To Do Today. It’s just like it sounds, it contains the activities that you plan to do today. When a task arises (for instance that lime green header switch) add it to the appropriate activity inventory. For something that must be done today add it to the bottom of the to do today inventory. For something that can wait until another day put it in the general activity inventory.

A Lot More to It

Those are the basics, but there’s a lot more to the Pomodoro Technique. A key point to the technique is to eliminate interruptions. It gets easier with time. Practically everyone I’ve spoken to who uses the technique has marveled at how much more productive they have become. Just as important to the boxed time of focus is the break. The break allows you to “integrate” what you’ve done. Take a breather and note your progress. Think of it as a waking nap. As you advance the technique helps you go from recording how long tasks take in terms of Pomodori to estimating how many Pomodori a task will take. There are even practices to allow you to measure estimates against actuals and adjust your future estimates accordingly. In other words, it allows you to gauge you personal velocity.

Back to the Digital Cleanse

On a larger scale, my digital cleanse is like my break between Pomodori. It allows me to remove myself from my day to day and take a quick breath. I liked it so much that I will be starting each month with a DC. Looking at all I did with my last one, who knows what will happen this round.

Posted by Mike Brown | with no comments

Welcome to 2010

Yes I know I’ve already posted twice on here this year (more on that later). But this is my first post coming out of my Digital Cleanse. What did I do in that week away from twitter, facebook, and all the tech “news” sites like engadget, joystiq, etc.?

  1. Incorporated a company
  2. Finished the second book of the Icewind Dale Trilogy (I started reading that book 3 years ago and was only on the third chapter)
  3. Designed two inventions…one of which I will perform a patent search and if it’s clear file a patent
  4. Wrote high level visions of seven software products two of which I am combining into a single solution and developing
  5. Spent quality time with my girls every evening.
  6. Lost 12 pounds
  7. Got more organized
  8. Got my MVP Award renewed (this wasn’t the result of anything I did this week but rather over the course of last year)
  9. Reconnected with my network
  10. Celebrated my Grandmother in law’s 85th birthday.
  11. Posted twice to my blog in one week. (Three times if you count today).
  12. A few other things I’m not allowed to mention.

All in all it’s been an INCREDIBLE week. I’ve never felt so energized before. And there’s only more to come.

What I Learned

image

By forcing myself to forgo twitter and facebook and essentially “mindless” browsing, my mind had to fill the void somehow. It craved the stimulus that constant updates and bite sized nuggets of news used to provide. Fortunately, just before Christmas, I purchased a bunch of Piccadilly notebooks. I know Moleskines are all the rage, but I have a frugal mindset right now and these guys were heavily discounted at Barnes and Nobles. But I did see a really nice day planner Moleskine that caught my eye, I passed on it. One I selected to be my idea book (a soft covered ruled small notebook), another my journal and meeting note taking book (hard covered small graph paper), and a third is my design book (hard covered large graph paper). I feel naked without them. The first one that makes a Pomodoro notebook has a customer for life.

I bought some extras for my wife as well and showed her the pocket in the back where she can stuff all the receipts she likes to collect. She’s sticking with her other notebooks for the time being. But she does comment when she notices me opening my notebook “Uh-oh he’s pulling out the Piccadilly.”

I’ve decided that going forward, I will confine my usage of twitter to a set time each day. Facebook, it’ll be relegated to pure casual time. There’s not much there for me business wise. Most of my business socializing is through linkedin or Twitter. I’ve never really done the myspace or any of the other pure “social web” sites. Frankly, I don’t have the time.

Right now, I look at my time as an investment that is worth more than money. If I’m not doing something that gives me a return on that investment, I damn sure better enjoy it. Twitter in moderation is a good investment. Spending all day checking out your tweet stream isn’t (not that I really did that, but I spent more time than I care to mention with twitter open and having it closed for seven days made it patently obvious that there are better things that I can do with my time.

What did you do with your Digital Cleanse? If you didn’t do one, what are you waiting for?

Posted by Mike Brown | 3 comment(s)

The Duct Tape Programmer Revisited

Not too long ago, I responded to the reaction that many had to Joel Spolsky’s article “The Duct Tape Programmer”. My belief still remains that people missed the point due to the unfortunate titling (as well as the severe dating of the technologies mentioned). I think it might make the meaning of “duct tape programmer” more apparent to contrast the duct tape programmer with his antithesis: the bright shiny guy. And what better way to do that than with a case study: 3D Realms and Duke Nukem Forever.

Now for those who don’t know, Duke Nukem Forever was originally announced in 1997 as the follow up to wildly successful Duke Nukem 3D. How successful you ask? Duke Nukem 3D was self-published by 3D Realms and sold around 3.5 million copies. It doesn’t take a rocket scientist to realize that 3D Realms was sitting on a boatload of money. And therein lies the problem. Because 3D Realms was self financing development of Prey (which finally saw release a few years ago) and Duke Nukem Forever, they had full control over time and budget. 12 years later, 3D Realms threw in the towel and closed their doors.

The tragic thing is that Duke Nuke Forever had been “completed” five times over in those 12 years. Unfortunately just as they should have been marching toward development, George Broussard would see a new “must have” feature for Duke Forever demonstrated in a new engine. Instead of passing on that bright shiny object for this time and pushing on to release, he would have the team rebuild the game on the new engine. There are at least 4 documented instances of this occurring.

And that my friends is the difference between Joel’s Duct Tape Programmer and the Bright Shiny Guy. The duct tape programmer doesn’t give a damn about that new high resolution snowflake modeling, he wants to ship the product so he can start the next version using the high res snowflakes. That is why I wanted to be the Duct Tape Programmer. You go ahead and use products that are barely released on your enterprise critical system. I’ll use the tools that I’m familiar with. You can argue that the new stuff is sexy. What’s really sexy to me is shipping a product.

And in the end that’s what our job really is. Just ask the former developers at 3D Realms.

Posted by Mike Brown | 2 comment(s)

RIAlity TV

I am creating a video blog designed as a reality TV show called RIAlity TV. (Actually I'm designing it to be a Channel of RIAlity shows). The first show called "The Project Room:Catching the Wave" will document creating a software product from start to finish using the .NET 4 stack top to bottom.

Silverlight 4

MEF

WCF RIA Services

Entity Framework v2

Windows Azure

SQL Azure

The project will be a Point of Sale system (AzurePOS) designed based on the first example from Peter Coad's Object Modeling book. The goal is to have a V1 project ready to launch at Mix10. I've submitted a session to the open call for proposals. I'll recap the season and launch AzurePOS on stage. I’m looking for people interested in joining the fun. Right now I can use the help from people who can fill the following roles:

  • UI Designer: Take a concept and make it reality. Experience with Blend and Sketchflow is a plus. Integrator skills are a huge plus! We're going to put the Developer-Designer workflow through its paces. HTML/CSS/Javascript experience is good as well.
  • UI Developer/Integrator: Work with the designer to bring their vision into the application. Experience with Blend or a crazy XAML skills are a MUST. In addition experience with HTML/CSS/AJAX is helpful. The person in this role should be comfortable with the View Model pattern.
  • Backend Developer: A heads down C# coder who understands good Object Oriented Design. Knowledge of Entity Framework a plus. Experience with RIA Services a HUGE plus.
  • Web Developer: In addition to the main project, there will be some development needed for the RIAlity TV website. ASP.NET MVC 2 is the weapon of choice.
  • Web Content Manager: There’s a lot of content that needs to be edited for the site, experience with video editing is a plus.

If this sounds interesting to you, send me an email (mike.brown at azurecoding dot net) with a subject line “RIAlity TV”. There's a lot of information that I don't want to share publicly but at the very least this will be an opportunity to demonstrate your skills before an audience. I want to have the first episode in the can in time for voting (January 5-15). I’ll explain all privately.

Update:

The sessions are up on the mix site for voting, if you want to see it, add my session to your ballot.

Posted by Mike Brown | 1 comment(s)

What is “Lean”

This one comes from the Lean Startup Circle again. Someone posed the question what is the difference (if any) between capital ‘L’ “Lean” and “lean”. Having had the opportunity to attend a David Anderson presentation on the subject of Lean Software Development, I was sufficiently armed to talk about the subject. Hopefully, I did justice by my instructor but any errors, omissions, or brute handed oversimplifications are purely my own fault. The summary follows. I’ve fleshed out the original email (that I wrote on my G1) to add more background and information.

To understand the origins of “Lean” we need to look at Toyota, for they are the originators of the Toyota Production System which was later referred to as Lean Manufacturing.

Do a quick search on "what we can learn from Toyota". You'll come up with a lot of interesting information. For example, guess how many of Toyota's American employees were laid off over the past decade? Past 20 years? 30? 40? Would you believe that they haven't had a single round of layoffs in half a century (the layoff referenced in the previous link was averted)? We worry so much about preserving "American companies" when in reality Toyota employees more American workers and treats their employees with far greater respect than any of the big three. Rather than laying employees off during thin times they move them to other plants for training and improving their infrastructure (as the Reuters link mentioned, Toyota even went so far as to pay plant workers in San Antonio their FULL SALARY while the lines were shut down). Thus when times are better they have a workforce already trained to face the new challenges of the company.

That’s fine and dandy you may say but what does this have to do with “Lean”? Everything! Toyota’s success goes far beyond their manufacturing processes. It is the entire philosophy at Toyota that still persists to this day even as the largest auto maker in the world. This philosophy can be embodied in one word “Kaizen”. The idea is to make everybody responsible for improving the process instead of dictating how things are done based on theory or “because that’s how we’ve always done things”. To put it simply who is more qualified to identify a better way of laying bricks: the guy baking in the sun who wants to get his work done and doesn’t want to have to fix that section of the wall later; or the manager who hasn’t picked up a trowel in years. Frank Gilbreth, considered the father of Business Process Management based his life’s work answering that very question. Anyway, that’s another post of it’s own we’re talking about the Kaizen philosophy. Enable…correction…encourage employees to take ownership of their work, and opportunities for improved quality AND efficiency will naturally be injected into your process.

Let’s shift gears from Kaizen and talk about Lean Manufacturing. Toyota's approach came from necessity. They had to compete overseas against entrenched competition. There was no way they could establish a dealer network AND a service chain rapidly enough to compete. The solution? Make cars that didn't fail as much. Rather than cut corners to produce cars as rapidly (and cheaply) as possible, they spent the time to make sure they released a quality product that didn't require as much maintenance. There's a reason Toyota has a reputation for making long lasting vehicles...they couldn't afford to do otherwise.

In the same regard, Toyota couldn't afford to pump out cars continuously or build up a large inventory of materials. Thus they devised a system called Kanban to control the flow of supplies. The concept was adopted from observing grocery stores. A grocer can only stock as much product as he thinks his customers will purchase before it spoils or else he wastes the product (and the money spent to purchase it).
Toyota applied this just in time supply to their manufacturing process. And thus Lean manufacturing was born allowing Toyota to go from an upstart foreigner to the largest auto manufacturer in the US. It was a commitment to quality, process, and most importantly PEOPLE that made this possible.

Make no mistake, applying Lean processes alone is not enough to ensure success. You need the right people as well and you need to engender a system of trust and excellence. You need to truly commit to the the principles. Otherwise you're just falling into the cargo cult mentality.

Posted by Mike Brown | 1 comment(s)
Filed under: , ,

Stealth Disease

I am a member of the Lean Startup Circle group (was searching for the Lean Software Group which I still haven’t found). The conversations there are amazing and I highly recommend joining if you’re remotely interested in entrepreneurship (becoming one, helping one, or finding one). Anyway, a fellow group member referenced Eric Ries’ recent interview with tech crunch where he states plain and simple that you’re doing yourself a disservice by having a long term “stealth mode” for your startup. It prompted me to reply as follows:

I think that [keeping your idea a secret] is the first thing to get over as a startup. I see so many people saying, "I'll tell you what I'm doing after you sign an NDA." I'm sorry, I'm not doing that because I might already have the same idea or a similar one and I'm not going to preclude myself from executing on that idea because you might argue I've stolen it from you down the road.

Unless you're talking about some really deep technology that REALLY pushes the bounds of what we do (think Project Natal from Microsof), you most likely aren't the only one doing what you're doing. In fact unless you can name five competitors in your space, you should stop what you're doing and find them. If you are on the lines of Natal, why the hell haven't you filed a patent to protect your work?

The sooner you get a working product that your users can play with. The sooner you can get feedback and in many cases ideas that will significantly improve your product. Going stealth I would argue is a Waterfall startup (opposite of Lean). Think about it in terms of software development. With Lean (or agile) one primary goal is to get a working application in front of your stakeholders quickly so that they can provide feedback as the application is evolving, it avoids the problem of spending a year working on a project only to get feedback at the end from the customer that you totally missed the mark.

If you want to kill a startup, the quickest way is to spend a year developing a product that no one wants because you were in "stealth mode". Especially when your competitor announced their product before it was even available, got feedback on the alpha a week later, and adjusted the trajectory for the beta a month later all the while building a huge viral buzz from previewers who "get the vision" and like it. By the time you've announced a product your competitor has beat you to market without you even knowing they exist.

By letting people know what you're doing, you're likely to get a lot of feedback that you'd pay a lot of money to get otherwise. Such as "this reminds me of...[insert competitor you didn't know of]" or "I'm building something similar, want to team up to make a unified product" or "I like [feature x] but I really wish I could do it by [method y]". All of this feedback can be used to help you adjust your launch trajectory "how can I improve [competitor x's] product", "this guy has a great foundation this would make my product better to integrate our solutions", "it will be simple to add that new method for achieving feature x" to provide a product that better meets your users' needs.

That's the true definition of Lean. And even the largest vendors (think of Google with gMail, Wave, Android, and ChromeOS) can benefit from taking this approach.

Posted by Mike Brown | 1 comment(s)
Filed under: ,
More Posts Next page »