First Law of Holes: When in a deep hole, stop digging.

Category Archives: C#

Introducing IAsyncDisposable

September 17th, 2019 Posted in C# | Comments »

Being sometimes required to call a particular method before an object is disposed emits a pungent code smell. In particular recently reviewed code, invoking an asynchronous Flush() method was sometimes necessary before a MyStream object was disposed, because asynchronous methods would be otherwise called from Dispose(), which does not wait for completion of those asynchronous […]

Write Less Code: C# Properties

February 15th, 2018 Posted in C#, Refactoring | Comments »

I inherited the responsibility of maintaining an internal development tool implemented in C#. I recently added new classes to extend the tool’s functionality. Several of the new classes uses several properties, and I found myself writing code similar to the following: class Shape { private int _width; private int _height; private bool _isVisible; public int […]

Creating COM Components using Visual C#.NET

October 8th, 2005 Posted in C#, Web Development | 47 Comments »

Developers are sometimes asked to support older software systems that utilize obsolete technologies. This may be difficult when the development tools used to implement the older software system are not available and have been replaced by newer tools that do not seem to support the former tools’ technologies. Faced with the need to replace a […]