Category Archives: C#

Decoupling Code

One thing you realise the more you write code is that the less “moving parts” you have the better or to put it another way the more you put your moving parts into one contained place the better. Pushing items which change or where there will be change in the future to places you can manage is really useful.

Interfaces help a lot here and if you can talk interfaces and just pass the implementation of what you want to do to specific areas, you code is more maintainable.

Continue reading Decoupling Code

LINQ Trinkets

LINQ is probably one of the main reasons why I’ve stuck with C#. It’s such a powerful in memory data manipulation namespace in dotNet and the main reason why you can abbreviate tens of lines of code into one.

I’ve accumulated a few queries which I use regularly which I hope you may find useful and which I know I’ll be referring to again. Continue reading LINQ Trinkets

Circular Dependencies and Interfaces

I was told by someone that if you put a picture of a cat in your blog, you’ll get instant site views to the sound of “oos” and “aahs”. Unfortunately since the majority of my demographic is probably non-cat loving males, I’m not hedging my bets.

I thought I’d put this post up more for my benefit as a tutorial on interfaces, but I hope others will find it useful. The other reason is that although I’ve seen answers on the internet around this topic, I’ve not really been satisfied with the content which can lack code example code (possibly for the right reasons).

Continue reading Circular Dependencies and Interfaces