#   Thursday, March 29, 2012

System.Web.Providers DefaultMembershipProvider behavior change

If you have downloaded the Visual Studio 11 you have may noticed that ASP.NET MVC 4 defaults to a new Membership Provider.  Instead of SqlMembershipProvider it uses the new DefaultMembershipProvider.

DefaultMembershipProvider is a cleaned up version of the membership provider that will work again SQL Azure or SQL Server or SQL Express or SQL Compact, etc.  Scott Hanselman talks about it here.  If you dig into DefaultMembership provider you will notice is has vastly simplified the SQL schema.  There were compatibility issues with a number of the SQL Server features the original version used. 

  1. The new version has eliminated the assorted lowered* columns in the tables.
  2. The new version has eliminated all the stored procedures.
  3. The new version has eliminated all the views

When you fire up a site configured with the new provider it automatically creates tables in your ApplicationServices database without you having to run aspnet_regsql.  When it does this it creates all the tables without the aspnet_ prefix that SqlMembershipProvider used.  It is also smart enough to not drop any tables that may be present if there is a naming conflict with a table it uses.  In this case it just silently fails to create the table. This is nice as it preserves the old Membership data and doesn’t put any of your data at risk if you didn’t realize that migrating your MVC 3 application to MVC 4 was going to cause this change in behavior.

When I saw all of these changes I wanted to adopt the new provider so I could use the same Membership schema on premise or in Azure. Unfortunately it appears that Microsoft doesn’t provide a script to migrate your data from the old schema to the new one.  So I walked through creating a script that adds the new objects, moves the data from the old objects to the new ones and drops the old objects. I don’t even begin to claim to be a SQL Wizard but I am posting the script to save anyone else the wasted 30 minutes of their life creating it. 

http://www.vergentsoftware.com/downloads/SystemWebProvidersSchemaUpdateGeneric.zip

Once you run the script you will find that you still can’t login.  Membership.ValidateUser() will fail when trying to authenticate the user.  Spent some time spelunking through this and couldn’t figure out the issue at first.  A great friend at Microsoft put me in touch with the developer who wrote the code and he insisted that DefaultMembershipProvider is not backward compatible with SqlMembershipProvider.  I certainly understood this from the standpoint of the schema changes mentioned above but suspected that I was still missing something.

I had just seen Scott’s x2 announcement here and here about the aspnetwebstack.codeplex.com site so I fired up GIT and did a clone of the source code. Unfortunately System.Web.Providers is not only largely undocumented on MSDN and elsewhere it also is not included in the source code that has been made public as part of aspnetwebstack. Really unfortunate and I posted a request that it be added to the codeplex site.  Still trying to figure out what had changed I decided to decompile DefaultMembershipProvider and compare it to SqlMembershipProvider to see if I could find a work around.  I went and grabbed my copy of Telerik Just Decompile (my Reflector had expired and I wasn’t willing to drop some coin just to decompile .NET code) and started spelunking.

After an hour or so I finally found the culprit.  Both providers have a method called GetHashAlgorithmType() that returns the hashing algorithm used to hash the combined password and salt.  In SqlMembershipProvider there is a check of several flags to determine if it should use SHA1 instead of whatever the configured hash algorithm is:

private HashAlgorithm GetHashAlgorithm()
{
    if (this.s_HashAlgorithm == null)
    {
        string hashAlgorithmType = Membership.HashAlgorithmType;
        if (this._LegacyPasswordCompatibilityMode == MembershipPasswordCompatibilityMode.Framework20 && 
            !Membership.IsHashAlgorithmFromMembershipConfig && hashAlgorithmType != "MD5")
        {
            hashAlgorithmType = "SHA1";
        }
        HashAlgorithm hashAlgorithm = HashAlgorithm.Create(hashAlgorithmType);
        if (hashAlgorithm == null)
        {
            RuntimeConfig.GetAppConfig().Membership.ThrowHashAlgorithmException();
        }
        this.s_HashAlgorithm = hashAlgorithmType;
        return hashAlgorithm;
    }
    else
    {
        return HashAlgorithm.Create(this.s_HashAlgorithm);
    }
}

Notice Line 6?  It reverts to SHA1 if a number of conditions hold true.  Now compare it to the following code snippet from DefaultMembershipProvider:

private HashAlgorithm GetHashAlgorithm()
{
    if (this._HashAlgorithm == null)
    {
        string hashAlgorithmType = Membership.HashAlgorithmType;
        HashAlgorithm hashAlgorithm = HashAlgorithm.Create(hashAlgorithmType);
        if (hashAlgorithm != null)
        {
            this._HashAlgorithm = hashAlgorithmType;
            return hashAlgorithm;
        }
        else
        {
            object[] objArray = new object[1];
            objArray[0] = this._HashAlgorithm;
            throw new ConfigurationErrorsException(string.Format(CultureInfo.CurrentCulture, 
                ProviderResources.Invalid_hash_algorithm, objArray));
        }
    }
    else
    {
        return HashAlgorithm.Create(this._HashAlgorithm);
    }
}

Notice it just uses whatever the default hash algorithm is.  This led me to the final part of the solution.  If you don’t specify a hashing algorithm when configuring the Membership provider it defaults to HMACSHA256.  SqlMembershipProvider in many cases defaults back to SHA1 as it was in my case.  You can change your web.config to force the Membership system to use SHA1 like so:

<membership defaultProvider="DefaultMembershipProvider" hashAlgorithmType="SHA1">

This fixed the issue for me and I am now up and running with the DefaultMembershipProvider!  Your mileage may vary and use at your own risk, etc.

Thursday, March 29, 2012 7:11:29 PM (Pacific Standard Time, UTC-08:00)   #      Comments [1]   .NET Architecture
 

#   Wednesday, March 21, 2012

Windows 8 and Windows Azure SDK

I have been spinning up on writing Metro applications and wanted to try pulling in WNS and Azure.  Unfortunately I couldn’t get all of the bits to play together correctly in Windows 8.

Started searching around and found a list of instructions to get Windows Azure development tools up and running on Windows 8.  Check it out here. If you want to install VS 2010 and Dev 11 check here instead.

In a nutshell Web Platform Installer will not install the Windows Azure SDK on Windows 8.

If installing Visual Studio 10 on Windows 8 you need to manually install Visual Studio Express SP1 prior to installing Visual Studio.

Finally Windows Azure .NET applications can only target .NET Framework 3.5 or 4.0.  .NET Framework 4.5 is unsupported on Windows Azure.

Wednesday, March 21, 2012 10:26:36 PM (Pacific Standard Time, UTC-08:00)   #      Comments [2]  
 
WEI and Boot to VHD

I finally broke down and did a full Windows 8 install on my secondary machine using Boot to VHD. 

Very easy to get up and running and Scott Hanselman has a great post here and here with all the steps.

Now that I have it up and running I decided to go fire off the Windows Experience Index and found that it wouldn’t complete since I was booting off a VHD.

Searching around I found that WEI is just a shell around WinSat.exe.  You can open up an administrative command prompt and fire off Winsat dwm to let the desktop window manager measure your performance and decide which features to enable.

Wednesday, March 21, 2012 10:26:03 AM (Pacific Standard Time, UTC-08:00)   #      Comments [1]  
 

#   Tuesday, March 13, 2012

The Mythical Team-Month

Saw an interesting presentation mentioned about what does it mean to have a small team?  What does it mean to have a faster team?  What are the traits of a great developer?

http://speakerdeck.com/u/searls/p/the-mythical-team-month

Tuesday, March 13, 2012 8:19:01 PM (Pacific Standard Time, UTC-08:00)   #      Comments [0]   ALM
 

#   Saturday, March 10, 2012

Why would you use SkyTap over Amazon EC2?

I have a customer who is a consulting firm that does quite a bit of .NET, Sharepoint, and Mobile work. They have various remote developers throughout the United States and have opened an office in Vietnam to offshore some of the work.

They currently have a server sitting in a co-location running Hyper-V with about a dozen or so VMs. The VMs are typically staging and integration environments where they deploy their work and then allow their customers to connect in and check things out, typically over HTTP. They have found they have just about hit the limit of their existing hardware and we were chatting about whether it made sense to purchase some new hardware or purchase VMs from any number of cloud providers like RackSpace or Amazon EC2.

While looking at this question I remembered about a local company, SkyTap, here in Seattle that I had looked at when in a former job. I was debating moving our development and testing lab into the cloud.  At the time I didn’t pull the trigger as we ended up getting some decommissioned hardware from our production data center that we used to fill the gap. 

Now with all the folks offering cloud based virtual instances I was curious what was so unique about SkyTap.  I gave them a call to get some pricing and they offered to sit down and walk me through their offering.

First off SkyTap isn’t trying to compete with Microsoft Windows Azure, Amazon EC2 or Rackspace to run your production applications.  They see their niche as providing elastic capacity to corporations for non-production needs.  Complete environment for Development, Quality Assurance, Training, and Sales.  Their secret sauce is how quickly they can get a particular environment up and running for you.

The interface to their offering is completely web based and browser/platform agnostic.  The demo I received was done under OS X in Google Chrome. To quickly get started you start by creating a new VM from a template. They offer a large number of preconfigured templates for most of the operating systems out there.  Windows XP, Windows 7, Windows 2008R2, Ubuntu, Red Hat, etc.  They provide pre-configured templates at each patch/service pack level.  The combination of base platform + service pack means out of the box they offer a few 100 templates to get you started.

Select a template, ask it to create a VM and 15-20 seconds later you have a spun up instance of the operating system that is just waiting for you to personalize it with things like the machine name, license key, etc.

When you spin up a new VM it comes up in a “Configuration” or environment that is isolated from all other VMs in the system as well as the internet. You can modify the default configuration and add CPU, Memory, NICs, Disk, etc. This is similar to the "Network Fence” concept in Visual Studio Lab Management.  Each configuration may contain one or more virtual networks to allow you to reproduce your desired application deployment architecture.  Configurations can be connected to one another to simulate distributed architectures.

You can connect directly to the machine in two ways.  They provide a web based Java plugin they call the SRA that is essentially a Virtual KVM that allows you “bare metal” access to all of your VMs.  Alternatively you can expose the VM to the internet for RDP or SSH access via NAT.  The endpoint used to access the VM is shown in the management web site.

If you want to make the applications running on the machine actually accessible to the internet you can map public IP addresses to the configuration and then map them to networks internal to the configuration.

Once you have your application deployed SkyTap has a number of very cool features you can leverage.

How many times have you gotten an email like this: “Testing a breaking change in QA1.  Will have environment back up and running in 30 minutes.”  With SkyTap the individual who needs to run the test can click a button and in a couple of minutes clone the entire environment and have it up and running in a new configuration alongside the old one.  She can do her tests and then delete the configuration.

If you have a complication application setup that you need to spin up on a regular basis you can get if configured and installed and then with the press of a button indicate to SkyTap that you would like this to be created as a new template.  This will allow you to create a new configuration from the template in minutes and have a complete multi-VM configuration spun up.  Great for load testing where you may want to spin up a Test Controller and multiple load agents all at once.

Similar to the other cloud services you are billed based on how many resources you use.  SkyTap introduces the concept of a SVM (SkyTap Virtual Machine).  It isn’t what you would think.  Each VM uses a variable number of SVMs based on how many CPUs or how many gigabytes of memory the machine has allocated.  The VM is billed based on the greater of number of CPUs or allocated memory.

A machine with 4 CPUs and 2GB of memory would be 4 SVMs.  A machine with 2 CPUs and 4GB of memory would also be 4 SVMs.

Customers purchase a number of SVM hours and a quantity of disk space each month on a subscription basis.  This is the one unfortunate aspect of the SkyTap model.  I pay a fixed price per month + overage charges as opposed to paying for exactly what I use.

This means the question ultimately comes down to whether or not the convenience oriented features that allow you quickly create, clone, and reuse complete environments are worth the increased cost.  SkyTap doesn’t publish prices on their website so if you are interesting in the convenience features give them a call.

FYI: I am not a skytap customer nor do I even have a demo account.  Just thought I would share what I learned.

Saturday, March 10, 2012 8:20:21 PM (Pacific Standard Time, UTC-08:00)   #      Comments [2]   ALM | TFS
 

#   Tuesday, March 06, 2012

Windows 8 in a Virtual Machine

My main machine nowadays is a MacBook air running Windows 7 most of the time. Wish I could get 8GB into it but other than that I really love the hardware. With the Windows 8 consumer preview out I had to give it a try. I was a little reticent given the Apple hardware to install Windows 8 with bootcamp. Couldn’t find many examples of folks who had done it yet. Figured I would wait for a few other folks to blaze that trail.

That left virtualization. I have seen a few posts from folks who have been disappointed with the performance when Windows 8 is virtualized. Even Microsoft recommends against it.

I decided to forge ahead anyway using the new VMWare 8 since Hyper-V won’t run on Windows 7 (can’t wait for Hyper-V in Windows 8!). Installed using the Windows 7 operating system choice in VMware with no problems. Since the MacBook Air only has 4GB I limited the VM to 1GB of memory. I was actually shocked at how quickly it installed, around 15 minutes from the USB key to the virtual disk sitting on my SSD.

At first I was a bit disappointed with the performance.  The graphics weren’t that fluid.  Installed the VMWare Integration Services and what a huge difference.  The Windows Experience Index shot up to a 5.3 for graphics and I got the fluidity folks are talking about.

Performance is pretty darn good in only a 1GB VM.  Quite usable.

Performance at first was not that great.

Tuesday, March 06, 2012 6:21:00 AM (Pacific Standard Time, UTC-08:00)   #      Comments [0]  
 

#   Friday, March 02, 2012

VS11 Beta and VS11 TFS are now available for download

Grab your bits on MSDN.

Then head here to download some hands on labs around the cool new features in TFS!

Labs are available on:

Microsoft even provides a Virtual Machine with all the bits pre-installed, a solution to walk through and even process data loaded into the TFS instance so you can look at backlogs, stories, etc.

Good stuff.

Friday, March 02, 2012 8:10:00 PM (Pacific Standard Time, UTC-08:00)   #      Comments [0]  
 
VS11 Beta and VS11 TFS are now available for download

Grab your bits on MSDN.

Then head here to download some hands on labs around the cool new features in TFS!

Labs are available on:

Microsoft even provides a Virtual Machine with all the bits pre-installed, a solution to walk through and even process data loaded into the TFS instance so you can look at backlogs, stories, etc.

Good stuff.

Friday, March 02, 2012 8:10:00 PM (Pacific Standard Time, UTC-08:00)   #      Comments [0]   TFS
 
VS11 and TFS Beta available now

 

Grab your bits on MSDN!

Then head here to download some hands on labs around the cool new features in TFS!

Labs are available on:

Microsoft even provides a Virtual Machine with all the bits pre-installed, a solution to walk through and even process data loaded into the TFS instance so you can look at backlogs, stories, etc.

Good stuff.

Friday, March 02, 2012 12:51:16 PM (Pacific Standard Time, UTC-08:00)   #      Comments [0]  
 

#   Friday, March 13, 2009

How to be a program manager by Joel Spolsky How to be a program manager by Joel Spolsky

Having a good program manager is one of the secret formulas to making really great software. And you probably don't have one on your team, because most teams don't.

Charles Simonyi, the brilliant programmer who co-invented WYSIWYG word processing, dated Martha Stewart, made a billion dollars off of Microsoft stock and went into space, first tried to solve the Mythical Man Month problem of organizing really big software teams by creating one super duper überprogrammer writing the top-level functions, while handing off the implementation of the lower-level functions to a team of grunt junior-programmers as needed. They called this position program manager. Simonyi is brilliant, but this idea, not so much. Nobody wanted to be a grunt junior programmer, I guess.

For more on the history, read William Poundstone's How Would You Move Mount Fuji?

Jabe Blumenthal, a programmer on the Mac Excel team in the late 80s, recycled the title for a different job. He had noticed that software development was getting so complicated that none of the programmers had the time to figure out how to make software that was either usable or useful. The marketing team was ranting and raving about customer needs and nobody had time to talk to them or translate their MBA-speak into actual features. There was a lot of product design stuff that took a lot of work: talking to users, running usability tests, reviewing competitive products, and thinking hard about how to make things easier, and most programmers just didn't have the time (nor were they particularly good at it). Blumenthal took the title "Program Manager," but reinvented the job completely.

What does a program manager do?

Henceforth, a program manager would:

  1. Design UIs
  2. Write functional specs
  3. Coordinate teams
  4. Serve as the customer advocate, and
  5. Wear Banana Republic chinos

On small products, you might just have one program manager, but on larger products, you would probably have more than one. Each can be responsible for some subset of the features. A good rule of thumb is that it takes about one program manager for every four programmers. If you're having trouble dividing up the work, one approach I learned from Mike Conte is to divide up the product according to user activities. For example, Twitter could be divided into four user activities:

  1. Registering and getting started
  2. Posting messages and reading replies
  3. Configuring your account
  4. Searching for news


Tyler Griffin Hicks-Wright
My first program management assignment at Microsoft was on Excel, working on the user activity called "customization," i.e., scripting and macros. The first thing I had to do was figure out what customers needed, which I did by talking to as many customers as I could until I started to get kind of bored because I kept hearing the same thing. I spent a lot of time talking to the development team to figure out what would be possible and reasonable to implement in a single 18 month release, and I spent a lot of time talking to the Visual Basic team to see if they could supply a compiler, code editor, and dialog box editor that could be used in Excel for our macro language. I also had to talk to Apple, which was developing their own universal macro language called AppleScript, and the other application teams at Microsoft, mainly Word, Access, Project, and Mail, who generally did whatever Excel did. Most of this process consisted of talking. Meetings, email, phone calls. I am scarred for life from this, and now cower in my office in fear that the phone will ring.

The second step was writing a vision statement: sort of a broad document that said, this is how Visual Basic would work in Excel, this is what some sample macros would look like, these are the major pieces we would need to build, and this is how it would solve customers' problems. When that didn't generate too many objections, I started working on a much more detailed spec, which explained, down to the smallest detail, how everything looked to the user.

This was a functional spec, not a technical spec, which means, all it talked about was what the user saw, not how it was implemented. (Read all about functional specs here.) A program manager doesn't care how the development team implements things internally. As I sent chapters of the spec to Ben Waldman, the development lead, he and his team sat down and figured out what they had to do internally to make it work. They came up with a rather brilliant and very compact table that mapped the object-oriented interface I was defining onto internal Excel functions, but that really wasn't my business. I didn't know too much about Excel internals and didn't really know how things should be implemented.

Truth be told, I didn't know anything about anything. Fresh out of college, I didn't have enough experience to develop the code, test the code, write the documentation, market the product, or do the usability tests. Luckily, Microsoft had seriously experienced gurus in each of those positions, who taught me everything I know today, and who did the real work of producing an awesome product. For example, I knew that users would want to copy the value of a spreadsheet cell into a variable:

x = [A1] 

had to work. The trouble was that a cell could hold a number or a string, but Basic was early bound… you had to DIM x as an Integer, Float or String before you could use it.

Basic had to get some kind of dynamic types, but I wasn't smart enough to figure out how to do that. Didn't matter. Tom Corbett, a programmer on the Visual Basic team, figured out how. And thus Variants and IDispatch were born, and Basic became a dynamic language with what you kids now call "duck typing". The point being, my job wasn't necessarily to solve problems, it was to figure out what customers needed and make sure that programmers figured out how to solve them.

Once the spec was finished and the development team got down to work, I had two responsibilities: resolving any questions that came up about the design, and talking to all the other teams so that the developers didn't have to. I met with the testers explaining how things were supposed to work and helping them plan how to test everything. I met with the documentation team, making sure they understood how to write a good tutorial and reference for Excel Basic. I met with localization experts to figure out a localization strategy. I sat down with marketing to explain the marketing benefits of VBA. I worked with usability experts to set up usability tests.

A program manager does go to a lot of meetings, but doesn't produce much other than that written spec, which is why as a twerp fresh out of school I was still able to do the job. You don't have to be a 14-year veteran programmer to work as a program manager (in fact, with 14 years of programming experience, you might know too much to be a good user advocate.)

Conflict


Tom Chi and Kevin Cheng
Lacking a program manager, your garden-variety super-smart programmer is going to come up with a completely baffling user interface that makes perfect sense IF YOU'RE A VULCAN (cf. git). The best programmers are notoriously brilliant, and have some trouble imagining what it must be like not to be able to memorize 16 one-letter command line arguments. These programmers then have a tendency to get attached to their first ideas, especially when they've already written the code.

One of the best things a program manager can add to the software design process is a second opinion as to how things should be designed, hopefully one that is more empathetic to those RETARDED USERS with their pesky mental feebleness requiring that an application be usable without reading the man page, writing a custom emacs-lisp function, or translating numbers into octal in your head.

A good program manager will come with her own ideas for how the UI should work, which might be better, or worse, than the developer's idea. And then there's a long debate. Typically, the program manager wants something simple and easy to understand for the users, featuring a telepathic user interface and a 30" screen that nonetheless fits in your pocket, while the developer wants something that is trivial to implement in code, with a command-line interface ("what's so unusable about that?") and Python bindings.

One of the most monumental debates I remember from the Excel 5 project was between a developer who wanted pivot tables to float on the drawing layer above the spreadsheet, and the program manager, who insisted that pivot tables live right in the cells on the spreadsheet. This debate went on for a really, really long time, and eventually, the program manager prevailed, but the final design came out much much better than any one individual's design would have been.

To make sure that the debate happens respectfully and on a rational basis of facts, it's absolutely critical that the program managers and developers be peers. If developers report to the program manager, at some point during the debate the program manager is going to get sick of the whole thing and just say, "OK, enough talking, now we do it my way." When they're peers, this can never happen. It's a little bit like courts of law: we don't allow a lawyer for one side to be the judge, and we work on the theory that the truth is most likely to be uncovered through a process of debate between equals. The debate can only be a fair one if neither side has an unfair advantage.

This is an important point, so if you were daydreaming about Sally in 11th grade, wondering where she is now, snap out of it. She's a biotherapist in Scottsdale, and a Republican. Now pay attention. Programmers can't report to program managers which means, among other things, that the development lead, or the CTO, or the CEO, can't be the person who writes the specs.

The number one mistake most companies make is having the manager of the programmers writing the specs and designing the product. This is a mistake because the design does not get a fair trial, and is not born out of conflict and debate, so it's not as good as it could be.

I learned this the hard way. At Fog Creek Software, I did a lot of the program management myself, and it was a constant battle to remind people that they were supposed to argue with me when I said wrong things. We're not a big company but we are finally big enough to have real program managers now, Dan and Jason, and the programmers love arguing with them.

Of course, when programmers are peers of the program managers, the programmers tend to have the upper hand. Here's something that has happened several times: a programmer asks me to intervene in some debate he is having with a program manager.

"Who is going to write the code?" I asked.

"I am…"

"OK, who checks things into source control?"

"Me, I guess, …"

"So what's the problem, exactly?" I asked. "You have absolute control over the state of each and every bit in the final product. What else do you need? A tiara?"

You see, it turns out that this system puts the burden on the program manager to persuade the programmer, because at some point, the program manager runs the risk that the programmer will give up and just do whatever the heck the programmer feels like. Thus, being effective as a program manager means you have to (a) be right, and (b) earn the respect of the programmers so that they concede that you're right.

How do you earn this respect?

It helps, as a program manager, to be pretty good at coding yourself. This is unfair. Program managers aren't supposed to write code. But programmers tend to respect programmers a lot more than non-programmers, no matter how smart they are. It is possible to be an effective program manager without being a coder, but the burden of earning the respect of the programming team will be higher.

flip the bozo bit v. Decide that someone is a clown, and stop listening to them.

The other way to earn the programming team's respect is to demonstrate intelligence, open-mindedness, and fairness in any debates that come up. If a program manager says dumb things, the programmer might flip the bozo bit on them. If a program manager becomes personally or emotionally attached to a certain way of doing things, to the point at which they're being unreasonable, they're going to lose a lot of credibility… both sides, but especially the program manager, need to be emotionally detached from the debate and willing to consider new evidence and change their opinions when the facts merit it. Finally, if a program manager is seen as playing politics, having private meetings with the boss or trying to divide-and-conquer to win a debate instead of debating on the merits, they're going to lose a lot of trust of the programmers.

And when a program manager loses the programming team's trust, it's over. They're not going to be effective. The programmers are going to tune them out and do whatever they want anyway. This leads to worse code and wasted time, since not only are you paying an ineffective program manager a salary, but that ineffective program manager is calling meetings and soaking up everybody else's time even though they're not really making the code any better.

Specs? Really? That's so unagile

There are so many development organizations where specs are a monument to mindless bureaucratic paperwork that entire movements sprung up organized around the idea of not writing specs. These people are misguided. Writing a functional specification is at the very heart of agile development, because it lets you iterate rapidly over many possible designs before you write code. Compared to code, a written spec is trivial to change. The very act of writing a specification forces you to think through the design you thought you had in your head, and helps you see the flaws in it quickly so that you can iterate and try more designs. Teams that use functional specifications have better designed products, because they had the opportunity to explore more possible solutions quickly. They also write code faster, because they have a clearer picture when they start of what's going to be needed. Functional specifications are so important one of the few hard and fast rules at Fog Creek is "No Code Without Spec."

The exact form the functional specification takes may vary. All a functional specification has to do is explain how the program will behave. It doesn't say anything about how the code will work internally. You start at the highest level: a vision statement, no more than one page explaining the gist of the new feature. Once that's nailed down, you can develop storyboards… mockups of the screens showing the user's progression through the application, with detailed notes showing how they work. For many types of functionality, especially UI-heavy functionality, once you have these storyboards, you're done. That's your spec. Jason Fried, you can go now.

To learn how to write good functional specifications, read my four part series. If you want to see a typical spec I wrote, you can download the full Fog Creek Copilot spec.

For more complex functionality with hidden behavior that's not expressed in the UI storyboards, you're going to want more details written down. In any case, the very act of writing down a spec helps you discover problems, conflicts, and design issues long before the first line of code is written, so when you do write the code, you have far fewer unexpected issues popping up which might force a rewrite or, worse, a suboptimal design.

How do you learn to be a Program Manager?

Mostly, becoming a program manager is about learning: learning about technology, learning about people, and learning how to be effective in a political organization. A good program manager combines an engineer's approach to designing technology with a politician's ability to build consensus and bring people together. While you're working on that, though, there are a few books you should read:

As far as I can tell, Scott Berkun's book Making Things Happen is the only book that's been written that pretty much covers exactly what a program manager has to do, so start with that. Scott was a program manager on the Internet Explorer team for many years.

Another big part of the program manager's job is user interface design. Read Steve Krug's Don't Make Me Think, then my own book User Interface Design for Programmers.

Finally, and I know it sounds cheesy, but Dale Carnegie's 1937 book How to Win Friends & Influence People is actually a fantastic introduction to interpersonal skills. It's the first book I make all the management trainees at Fog Creek read, before anything else, and they always snicker when I tell them to read it, and love it when they're done.

Need to hire a really great programmer? Want a job that doesn't drive you crazy? Visit the Joel on Software Job Board: Great software jobs, great people.

Friday, March 13, 2009 6:48:34 AM (Pacific Standard Time, UTC-08:00)   #      Comments [0]  
 


Administration
Sign In