Can LEAN be applied to software?

The company I work for has recently started a major LEAN manufacturing initiative. When I first heard about it, I started having flashbacks to the Six Sigma training in me GE days. While the concept of Six Sigma makes sense, the approach that GE took was completely useless.

Fortunately, LEAN thinking actually makes sense to me. The basic philosophy is optimizing what you have by eliminating all forms of waste.


So can LEAN be applied to software? I believe it can be applied in at least two broad categories.

LEAN can be used before you even write your first line of code. You need to ask yourself if it even makes sense to write the code. Software engineers such as myself often see the answer to all problems in code. It's like the saying "if all you have is a hammer, everything looks like a nail".

Instead of writing the software yourself, evaluate if there is an existing product that will accomplish the same goal. If not, try to break the problem down into smaller pieces, and see if there are existing solutions that may eliminate or minimize the number of pieces that need to be built.

Obviously you'll have to weigh the costs of custom code against the costs of integrating a third party product. When doing so, be careful to not simply compare the amount of time coding. Every line of code will need to be debugged, supported, quality checked, version controlled, and successfully be part of your overall solution.

Once you have made the decision about what code you are actually going to write, you have now entered the second category of LEAN software thinking. You now need to optimize the actual development process. There are several methodologies that attempt to use this philosophy, such as Agile programming.

I've ordered a few books from Amazon so that I can more familiarize myself with Agile and LEAN programming thinking. Stay tuned for some more in depth posts.

Like this post? Please share it!

See a mistake? Edit this post!

Using the Luhn algorithm to validate credit cards

Today's post is inspired by this blog post. The author posted a number of regular expressions for the different types of credit cards. I'm sure there are cases when they are useful, but there is typically a better way!

The Luhn algorithm was designed exactly for the purpose of validating credit cards. It's basically a checksum check for the exact purpose of verifying that a credit card number was entered correctly. It does not pick up all errors, but it's perfectly fine for real world use.

The best part is that we can easily use the Luhn algorithm in an ASP.NET validator. To do so, you'll first need to add the Luhn JavaScript to your page. You can use a scriptblock on your page, or put it in a separate js file and include it. The script that I have tested and use is available on this site.

Here is an outline of the JavaScript you could use:

function ccValidator(sender, args)
    var ccString = args.Value.replace("-", "");
    args.IsValid = luhn_check(ccString);
function luhn_check(s)
    //Insert Luhn algorithm here.
    //Example at:

The next step is to add an ASP.NET validator:

You'll need to change the "ControlToValidate" property to match the TextBox control that you're validating.

Now you'll have a validator that can check the credit card number in real time, before a postback! You'll still need to determine how you're going to do validation on the server if the client doesn't support client-side validation.

There is only one other thing worth mentioning. If you're running an e-commerce site, you typically want to avoid any issues that could cause you to lose an order. Over-validating is one of them. In many cases, even if the credit card does not get charged successfully, you should let the order go through. You can then contact the user and try to correct the situation. It might just be worth the sale!

Like this post? Please share it!

See a mistake? Edit this post!

What it would take for me to switch to a Macintosh

Apple could come out with a killer technology that would increase their sales like nobody's business.


I know what you're thinking. Everyone has virtualization products for the Mac. VMware, VirtualBox, and Parallels to name a few.

Here is the problem, virtualization is a pain in the ass. The average person would have no idea how to do it. You have to:

  1. Create a virtual machine and know what hardware specifications to assign it.2. Have access to an OS CD to install Windows, Linux, or another OS. If it's Windows, you'll need a retail or volume license copy.3. Install the OS in the virtual machine.4. Configure the OS, and install the software you want to use.

If you get to that point, you still have to start up the virtual machine every time you want to run a Windows program. Parallels has really made progress due to the fact that they create coherence mode, which allows you to use your Windows applications seamlessly in OSX.

Electronic CPU

Now we're do the biggest problem. You have to decide how to allocate your resources. Let's say you have a Macbook Pro with 1GB of RAM. If you give the virtual machine 512MB of RAM, that may be too little, or it may be more than you have to sacrifice. You shouldn't have to make that decision.

Step 1 to solving this problem is somehow sharing the memory. The OS should be smart enough to evaluate what is running, and fit it all in.

Step 2. Now, lets take it a step further. Why should I even have to configure a virtual machine? I don't want two file systems, just show me one. I don't want to have to start, suspend, or stop the virtual machine.

So now imagine with me for a moment. This means that you could use your Mac to run Windows programs. I'm not claiming that it's easy, but imagine if Apple could say that they can run all of their software AND 99% of the Windows software that is available. The productivity and beauty of a Mac, and the support of the Windows software industry.

Would you switch if it were possible?

Like this post? Please share it!

See a mistake? Edit this post!

Jason Young I'm Jason Young, software engineer. This blog contains my opinions, of which my employer - Microsoft - may not share.

@ytechieGitHubLinkedInStack OverflowPersonal VLOG