Multi Content Projection aka Multiple Transclusion

How named/multi-slot transclusion works in Angular 2 If you’re an Angular developer, I’m sure you heard about transclusion. Sounds really weird and mysterious, at least that’s what I thought when I first heard it. If you google for it, you’ll probably land on one of Thoughtram’s articles (as you’ll do 90% of the time if you search for Angular articles ...

Read More »

Getting started with DivineInject

DivineInject is a .net dependency injection framework, designed to be simple to use and easy to understand. You can find the source for DivineInject on github. Why another DI framework? Because dependency injection is important – but done wrong it can do more harm than good. DivineInject is opinionated about the right way to use dependency injection:      Constructor injection ...

Read More »

LINQ: from IEnumerable to concrete collections

I my recent posts introducing LINQ from a game developers point of view, I mentioned several times how the many LINQ methods returning sequences of the IEnumerable<T> type do not actually return an actual collection. Instead they return a query that can be executed any number of time on the given input collection. Of course, there comes a point at ...

Read More »

Why are Constraints Helpful

When people first try scrum, or TDD (or any new process), they feel uncomfortable. We “know how to do” stuff, but then we’re asked to try on something new. Then our comfort zone alarm goes off. We feel constrained. Scrum puts limit on sprints, so we’ll need to actually help the testers finish testing our story. We can’t just continue developing. ...

Read More »

Legacy Code to Testable Code # 12 : Instance Constructors

So we talked about static constructors and how to go around them. How about instance constructors? Are they innocent or guilty of the same crimes as their static brothers? I think Java got the terminology right (although not the implementation). What we call a “Constructor” is different than an Initializer. A “constructor” instantiates the object, and an “Initializer” initializes it. ...

Read More »

Git stash driven development

I’ve found myself using a pattern quite often recently, which I’ve been calling “git stash driven development” – that is, relying heavily on the magic of git stash as part of my development workflow. Normally I follow what I think of as a fairly typical TDD workflow: Write next test, watch it fail Write code to make it pass Commit Refactor ...

Read More »

Find the bug – The case of the degrading system – Answer

In my previous post I showed the following code, and asked what the bug was, and what the implications of that would be. class Program { private Timer nextcheck; public event EventHandler ServerSigFailed; static void Main(string[] args) { var program = new Program(); if(program.ValidateServerSig() == false) return; program.DoOtherStuff(); } public bool ValidateServerSig() { nextcheck = new Timer(state => ValidateServerSig()); var ...

Read More »

Find the bug – The case of the degrading system

The following code contains a bug, can you spot it? class Program { private Timer nextcheck; public event EventHandler ServerSigFailed; static void Main(string[] args) { var program = new Program(); if(program.ValidateServerSig() == false) return; program.DoOtherStuff(); } public bool ValidateServerSig() { nextcheck = new Timer(state => ValidateServerSig()); var response = DoRequest("http://remote-srv/signature"); if(response.Failed) { var copy = ServerSigFailed; if(copy!=null) copy(this, EventArgs.Empty); return ...

Read More »

WCF Is Dead and Web API Is Dying – Long Live MVC 6!

The time has come to say goodbye to Windows Communication Foundation (WCF).  Yes, there are plenty of WCF apps in the wild — and I’ve built a number of them.  But when it comes to selecting a web services stack for greenfield applications, you should no longer use WCF. WCF is dead There are many reasons why WCF has lost its ...

Read More »