Chris Falter

.NET Design and Best Practices
posts - 42, comments - 82, trackbacks - 24

My Links

News

All source code published on this blog is placed in the public domain.

Archives

Post Categories

Image Galleries

About Me

Coding Practices and Design Patterns

To write good code, you need to have a good approach.
How to Reuse Code Without Creating an Implicit API

posted @ Sunday, March 29, 2009 2:44 PM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

How To Create a Windows Form Singleton

The .NET Framework provides built-in capabilities for creating components and services as singletons. If you want to create a singleton process, though, you're on your own. But not really; if you read on, you will find out how to use a Mutex to do the job.

posted @ Friday, June 06, 2008 9:31 AM | Feedback (1) | Filed Under [ Coding Practices and Design Patterns ]

BOOK REVIEW: Don't Make Me Think, 2d Ed. by Steve Krug

Steve Krug's "Common Sense Approach to Web Usability" provides surprising and sometimes counterintuitive principles that every good website must follow. Krug preaches the importance of removing clutter in order to make the purpose and functionality of a site (or page) clear--and happily, he practices what he preaches in this remarkably lucid book. Here are some of Krug's key insights...

posted @ Tuesday, May 13, 2008 3:31 PM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

Want to Write Great Business Software? Create a Great Domain Model!

When you are coding in a hurry, it is very tempting to write business logic in the first place that comes to mind, such as a button click handler. However, for all but the simplest systems, such a practice leads very quickly to a chaotic system whose business logic is scattered like the ash from an erupting volcano. Create a great domain model, though, and you will be able to nimbly align your software with your emerging business needs.

posted @ Tuesday, March 25, 2008 9:01 AM | Feedback (6) | Filed Under [ Coding Practices and Design Patterns ]

Refactoring to Comply with the DRY principle (Don't Repeat Yourself)

Every time I see an example of copy-and-paste programming, I'm like a bull who just spotted a waving red flag. "Don't Repeat Yourself" (DRY) is a principle every programmer should live by, for Turing's sake! Read on for a discussion of why copy-and-paste is egregious, and how to refactor an expansive set of conditional logic branches into a concise and elegant piece of code.

posted @ Friday, March 07, 2008 7:45 AM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

A Good Solution for "Magic String" Data

posted @ Thursday, March 06, 2008 10:08 AM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

Make Magic Strings Easy to Understand and Type Safe

posted @ Wednesday, February 27, 2008 1:40 AM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

"New" Statement Considered Harmful

Just by calling a class' constructor, you are tying your code to some implementation details of the class. Since good software uses loose coupling, though, you should develop the habit of providing a static construction method and hiding a class constructor. There are exceptions that prove the rule, however, as noted both in this article and in the comments. Read on to learn how to develop the good habit, and when you should consider breaking it....

posted @ Friday, February 15, 2008 2:59 PM | Feedback (12) | Filed Under [ Coding Practices and Design Patterns ]

Of Sobriety Tests and Loop Iteration

A skill that is useful during traffic stops can also help you write correct loop iterations.

posted @ Thursday, November 08, 2007 5:44 AM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

Test-Driven Design: Make Sure You Fail!

The moral of this tale is simple: in test-driven design, you have to fail before you can succeed. The idea behind test-driven design (TDD) is to incorporate testing into the process of constructing your system, rather than waiting for developers to check in their code and to build a system that someone else tests. TDD has some advantages worth considering...

posted @ Saturday, October 20, 2007 1:39 PM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

Saved By Good Design

I have been saved from many a peril during my adventure of a life. When I was instrumenting a large system recently, I realized just how wonderful good design can make your software development life...

posted @ Tuesday, July 24, 2007 11:24 AM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

How To: Write a Unit Test for Multi-Dimensioned Output

posted @ Friday, May 04, 2007 8:42 AM | Feedback (1) | Filed Under [ Coding Practices and Design Patterns ]

Opportunistic SOA (or How to Make Your Cool New Code Survive the Hype Cycle)

posted @ Tuesday, April 10, 2007 8:55 PM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

More on How To Re-throw an Exception

posted @ Wednesday, March 28, 2007 4:37 PM | Feedback (1) | Filed Under [ Coding Practices and Design Patterns ]

How To: Re-throw an Exception

posted @ Thursday, December 07, 2006 6:31 PM | Feedback (2) | Filed Under [ Coding Practices and Design Patterns ]

Why You Might Prefer a DataView to an Array of DataRecord

posted @ Monday, August 07, 2006 7:47 PM | Feedback (0) | Filed Under [ Coding Practices and Design Patterns ]

Powered by: