January 30, 2012

The Best Design Patterns

The first time I read the Gang of Four Design Patterns book, I was impressed, no blown away, by the brilliance of what I was reading. The Visitor pattern utilizing double-dispatch. Brilliant. Chain of Responsibility. Why didn’t I think of that? Adapter. Simple and powerful. Of course I was itching to start implementing these patterns. In practice though they seemed to be applicable only in rare situations. Adapter, Builder, Factory, Strategy, were the most useful. Read more

October 6, 2011

Creating a Crawl Control in WPF

A few weeks ago I was watching CNN when an interesting blurb scrolled by on the crawl at the bottom of the screen.  Normally, the crawl is not something I notice, but I thought to myself, "I wonder if I can implement one in WPF."  I had never done any animations before in WPF, and this seemed like a good way to start. So I gave it a shot. My initial instinct was to bring up Google and see if anyone else had done it. Read more

August 15, 2011

The Dangers of Mutable Data

I recently came across a bug in some C# code that would never have been a problem if the data structures being used were immutable. The data consisted of a .NET dictionary with an integer key and a list as a value. The details below have been changed to protect the guilty. The offending method takes customer and product objects as parameters and retrieves a list of available pricing for the customer from a dictionary using the product ID as the key. Read more

July 28, 2011

Best Practices for Creating and Consuming Modal Dialogs in WinForms

This is an article I wrote a few years ago after seeing some bad coding practices around modal dialogs in WinForms. Bad habits like explicitly closing the dialog form and using custom OK/Cancel flags irked me, so I came up with some best practices. I hope you find them useful. Tip 1: Set the AcceptButton and CancelButton properties Windows Forms have two properties, AcceptButton and CancelButton, for determining what should be done when the user presses the Enter or Escape keys. Read more

July 16, 2011

My First Blog Post

I’ve always told myself that I needed to start blogging and get my thoughts out there. Well, after years of putting it off, I finally got started. I decided to write about what I love (besides my family of course): writing software using .NET. I’ll start out focusing on C# and F# language features. I’m proficient in C# but just starting out with F#. Functional programming is very different from what I’m used to; however, I’m liking it more and more. Read more

© Joe Buschmann 2020