ALLINSIGHT

Home of the AlmostImplementedException

SerializableDictionary

Some days ago i got the problem, that I have to use a custom dictionary with as parameter for a service – therefore it must be serializable. I found an interessting solution from “Paul Welter” at his blog (XML Serializable Generic Dictionary). But that’s not all! I had to implement the Constructors for Dictionary and […]

, , , , , , ,

Indexed Properties

Welcome in the new year! Hope you all enjoyed your holidays 🙂 Today I will show you how to make use of indexed properties in your own classes. Why we want it? Well, in some situations you want to give your class a partial behavoir of an array, or list, or dictionary. Let’s use a […]

, , , , , , , ,

Lets get dynamic with ExpandoObject

With .Net 4 Microsoft introduced the ExpandoObject (funny name). With this object you can dynamically add and remove properties. Thats very useful to get rid of this ugly CleanCode you produce every time ;-). Seriously, don’t use this class except for very special occasions, like producing a dynamic object where you don’t care what properties […]

cast vs “as”

Another good example for our categories “difference between a duck” AND “CleanCode” is an ordinary ()-cast against “as”-cast. Why is it in both categories? Both do roughly the same thing and its more a question of code-style which one you use. But more important both use different ways to approaching the same problem and thats […]

Modulus vs Bit Operation

Modulus vs Bit Operation A while ago i read a question on stackoverflow what method is faster to determine if a number is odd or even in C#. Modulus (i % 2) or a bit operation (i & 1). And the first answere marked as right was the bit-operation. Everybody knows that this way was […]

Agile development

Since 1999 I worked for alot of companies that use agile development, or at least what they think that means. I worked with SCRUM, PairProgramming, TestDrivenDevelopment (TDD), BehaviorDrivenDevelopment (BDD), Acceptance Tests and CleanCode. But I only met a handful of people who actual know how to use this stuff in real life. Since I’m prefer […]

For vs Foreach

Sometimes, especially with C# you hear alot of “common knowledge” about performance and developers mistakes. As an (bad) example I want to refer to 8 Most common mistakes C# developers make and in particular point 7 “using foreach instead of for”. So whats wrong with this kind of post? First of all, it refers to […]

Difference between a duck

Today we introduce a new category on AllInSight.de: Difference between a duck. We took that line from the movie Postal. And the category is about things that are the same or look alike and also about things other think are the same but actually they are different. For a start I’ll show that for and […]

Previous Posts Next posts