NDepend

Static analysis tools allow us to measure code quality and better understand the design and architecture of software. There are things about source code that are not visible to eye in our day-to-day work: dependencies between components, cyclomatic complexity of methods, hidden and indirect dependencies. There are dangers that a method or a type will…

4

Book review: Essential C# 3.0 by Mark Michaelis

Sometimes I’m being asked what book I’d recommend for learning C#. Until recently, I was hesitant and didn’t know what to answer. It depends, among other things, on the following factors: Whether the learner has existing programming background Whether he or she wants to learn the language, or the .NET framework as well Whether the…

1

Live Geometry project updated to Silverlight 2 final release

Finally I had time again to continue working on my Live Geometry project on CodePlex. While I was busy with other stuff, Silverlight 2 has officially released and the rest of the world has already upgraded from Beta 2 to the release version. Now I’m catching up: I’ve updated the source code for both Silverlight…

3

Kirill’s Visual Studio Tips

I decided to compile a small list of Visual Studio features that I use a lot. Code Editor Code Snippets for ‘prop’, ‘foreach’, ‘if’, ‘class’, ‘interface’, Tab-Tab completion Surround with (snippets) – try, if Ctrl+K,D – FormatDocument Ctrl+Left/Right arrows in code editor – jump between words faster Ctrl+K,C – Ctrl+K,U – comment/uncomment selection Dynamic Snippets…

10

An algorithm to solve a matrix game

There is a nice game called Enlight from FeejoSoft. I have it on my PocketPC phone and for the life of me I just couldn’t get past level 33. So yesterday I finally sat down and implemented an algorithm to solve this game automatically. Of course, I used C# and Visual Studio (as a tester,…

2

Too much type information, or welcome back System.Object and boxing

We all know that generics are good – they promote code reuse, static type checking by the compiler, increase runtime performance, allow more flexible OOP designs, lay the foundation for LINQ, help the IDE to provide more helpful IntelliSense and have tons and tons of other vital advantages. “var” is another good feature, which (unlike…

22

More comments on generics

Here are some more unsorted thoughts on generics to continue this post (which has some interesting comments too). Preserving types with generic type inference To reiterate, instead of having a method like:void Process(object instance) { } one can write:void Process<T>(T instance) { } and thus preserve the static type information about the parameter. One can…

9

Why a comparison of a value type with null is a warning?

A reader (Petar Petrov) asked me a question recently which I didn’t quite know how to answer: Why a comparison of a value type against null is a warning? I definitely think it should be a compiler error. So I asked the C# compiler team and here’s the explanation (please welcome today’s special guest Eric…

4

How I started to really understand generics

First off, a little explanation for the post title: not that I didn’t understand generics before. I’d had a pretty good understanding of how they work, how they are implemented in the CLR, what facilities are provided by the compiler, etc. It’s just that recently I started seeing some patterns and analogies that I hadn’t…

16

Representing dependencies in code

It is more often than you would suspect that people have to deal with some sort of dependencies in an application they’re developing. In this post I’ll talk about some common algorithms and data-structures to work with dependencies that might turn out helpful with some real-life programming tasks. To better understand what kind of dependencies…

8