July 2011 Entries

Code worth remembering: Singleton implemented in C# 4.0

*Make sure you read Don't Use Singleton before using a Singleton at all...Go read the whole post at http://geekswithblogs.net/B... 1: public class LazySingleton3 2: { 3: // static holder for instance, need to use lambda to construct since constructor private 4: private static readonly Lazy<LazySingleton3> _instance 5: = new Lazy<LazySingleton3>(() => new LazySingleton3()); 6: 7: // private to prevent ......

Monads

Functional programming and Monads are a bit complex, and took me a while to understand. Surely, they're very different than OOP. So, I'd like to recommend Mike's World-O-Programming's "Yet Another Monad Tutorial" (http://mvanier.livejournal... as one of the best explanations for Monads. The step-by-step approach allows the reader to decide where to skip because "it's clear as water", and where to re-read and digest very slowly the harder parts. And maybe each person finds a different ......