A place to keep my thoughts on programming

Tag Archives: c#

Using log4net without requiring it as a dependency

Logging, to me, is a basic requirement of any code I write. There's nothing more useful to track down an odd bug than being able to turn on debug logging in production, potentially filter it down to the area of … Continue reading

August 15, 2011 .net , ,

Implementing “exports” in C#

The other day i was musing about improving readability by liberating verbs from the containing objects that own them. Similar things are accomplished with mix-ins or traits in other languages, but I wanted to go another step further and allow … Continue reading

May 25, 2011 geek, Promise ,

Func/Action vs. Delegate

A while back I wrote that you really never have to write another delegate again, since any delegate can easily be expressed as an Action or Func. After all what's preferable? This: var work = worker.ProcessTaskWithUser(delegate(Task t, User u) { … Continue reading

January 5, 2011 .net, geek , , ,

I need a pattern for extending a class by an unknown other

I'm currently splitting up some MindTouch Dream functionality into client and server assemblies and running into a consistent pattern where certain classes have augmented behavior when running in the server context instead of the client context. Since the client assembly … Continue reading

September 21, 2010 .net, mindtouch ,

libBeanstalk.NET, a Beanstalkd client for .NET/mono

A couple of years back I wrote a store-and-forward message queue called simpleMQ for vmix. A year later, Vmix was kind enough to let me open source it and I put it up on sourceforge (cause that was the place … Continue reading

August 30, 2010 .net, geek, mono , , ,

Loading per solution settings with Visual Studio 2008

If you ever work on a number of projects (company, oss, contracting), you're likely familiar with coding style issues. At MindTouch we use a number of naming and formatting styles that are different from the Visual Studio defaults, so when … Continue reading

August 16, 2010 .net, geek , , , ,

Reproducing Promise IoC in C#

Another diversion before getting back to actual Promise language syntax description, this time trying to reproduce the Promise IoC syntax in C#. Using generics gets us a good ways there, but we do have to use a static method on … Continue reading

August 4, 2010 .net, geek , , ,

Freezing DTOs by proxy

In my previous post about sharing data without sharing data state, I proposed an interface for governing the transformation of mutable to immutable and back for data transfer objects (DTOs) that are shared via a cache or message pipeline. The … Continue reading

August 3, 2010 .net, geek , ,

Promise: Inversion of Control is the new garbage collection

Before continuing with additional forms of method defintions, I want to take a detour through the Inversion of Control facilities, since certain method resolution behavior relies on those facilities. IoC is one feature of Promise that is meant to not … Continue reading

July 17, 2010 .net, geek, Promise , , , , ,

Promise: Lambdas

Lambdas in Promise, like other languages, are anonymous functions and first-class values. They act as closures over the scope they are defined in and can capture the free variables in their current lexical scope. Promise uses lambdas for all function … Continue reading

July 11, 2010 .net, geek, Promise , , , , ,