Sergey Shishkin

on agile software development

Samples Go Live!

In my previous posting I mentioned, that even small samples and code snippets eventually end up in production code. Today I want to elaborate further on this.

By its nature sample code has to be simple. A code sample is intended to showcase a specific feature of a framework. When possible, isolated from other features of the framework for the sake of simplicity. This is often done by not taking care of security, performance and maintenance.

On the other hand we have so called "best practices." Best practice comes as a response on problems of customers, blindly copying-and-pasting code samples into their production code. This is, of course, not the only intention behind best practices, they also show how to combine usage of different parts of a framework or frameworks together. And I won’t blame copy-pasting developers just because copy-paste is the most productive development approach to meet functional requirements on time.

So, why does that happen? Because of poorly designed frameworks, of course. Why else? Brad Abrams and Krzysztof Cwalina in their book "Framework Design Guidelines" define the term "pit of success" for a situation when the simplest subset of an API leads developers to best results. Best results here mean not only quick implementation of functional requirements, but non-functional as well. I, as a developer, want to get good performance and solid security when using default configurations and simplest overloads of methods and constructors. As opposite, it should be really non-trivial to screw everything up.

So, if a framework satisfies the "pit of success" criteria, it probably does right things with less code. As a result, code samples become production-ready, and best practices can concentrate on the more complex and interesting job of integrating different pieces together and building a whole solution for a specific problem.

Microsoft has significantly improved quality of its products during the last few years. This allowed Microsoft to ship yet beta versions of their products under the "GoLive" license, which permits customers to use beta versions in production. Until we work with perfectly designed frameworks only, I would like to encourage both framework developers and communities to create more production-ready code samples. Improve quality of your code samples and make them go live!


Written by Sergey Shishkin

27.11.2007 at 11:09

Posted in Uncategorized

%d bloggers like this: