Mathias Vestergaard

Mathias Vestergaard mattv

Niner since 2008

I'm a software developer located in Copenhagen, Denmark. I work for a large European logistics company where my main area of expertise is EDI (Electronic Data Interchange) solutions and partner integration.


  • 10-4 Episode 12: Simplifying Your Code With C# 4.0

    I get your point, and I agree with the usage you describe. I guess we'll just have to see how the community and the different API developers grasp this new feature.

    I'm just wondering who actually uses it. I currently work at a company that develops in VB.NET, and none of my fellow developers ever use the optional parameter ability. Where does this general dislike come from, if it's not such a bad idea?

    Perhaps if we see APIs in the future (from Microsoft in particular) where optional parameters are used in a good way. It might become a more accepted practice.

    I choose to remain skeptical however.
  • 10-4 Episode 12: Simplifying Your Code With C# 4.0

    I must say I've never been a fan of optional parameters. For the COM scenario i find it quite great, but for general class development i find it a bad practice.

    I don't hope people will start abusing this feature and kill the whole overloading design (which is more expressive if you ask me).
  • Countdown@​PDC: Day 2 Recap

    Can we expect to be able to see Guthries keynote online at some point? I missed his part of the keynote Sad
  • Back To Basics - Race Conditions, Part 1

    Nice little introduction to what race conditions are. However, I thought you could dig a little deeper into what Interlocked.Increment does, and also give examples of other methods of locking chunks of code. It's called "Back To Basics" after all.
  • Free eBook: Foundations of Better Programming

    I guess it's just a matter of diving into it and sticking with it until it's second nature.

    Regarding the test tool, is there anything wrong in using the unit test tool built into VS2008 instead of NUnit?
  • Free eBook: Foundations of Better Programming

    Aha, I see... that's actually pretty neat.

    Perhaps I should be a bit more optimistic, and read through the documentation to get a proper picture of what can be done.

    One last question. I have multiple times tried to get used to writing unit tests, but usually sorta give up, because I feel lost when it comes to what should be tested, and how deep my tests should go.
    Can you from the top of your head mention a book or other writing that you felt was useful when you were learning?

    Thanks for the pointers so far.
  • Free eBook: Foundations of Better Programming

    Hi Karl,

    I see what you're getting at. And I realize how that could be utilized.

    Some of the functionality that I'm quite sure I would need at some point, and not really sure whether is supported by NHibernate, is something like this:

    For the sake of argument, let's take a User object that needs to be persisted with NHibernate, this User has a property called Name which is of the type Name that is a combination of Firstname and Lastname. Here's some code for clarification:

    public class Name
            public string Firstname { get; set; }
            public string Lastname { get; set; }

        public class User
            public Name Name { get; set; }

    How would i go about mapping Name.Firstname and Name.Lastname into my Users table Firstname and Lastname column? Is it even possible?

    And how about reading it back from the database? What if my Name type can only be initialized with a constructor that has both firstname and lastname as parameters?
  • Free eBook: Foundations of Better Programming

    Really, really great book.

    I am however a bit sceptical about whether O/R mappers, or NHibernate in particular is suited for most projects.
    They can lead to much less development time, yes, but as far as I've understood from different blog and forum posts, they can cause all kinds of other headaches, when you try to do something a bit complex.
    The last thing i would want to be forced into, is designing my system around an O/R.

    I do feel that writing my DAL manually, is a time consuming process. It does however give me an extra sense of control, and a few abilities that wouldn't be possible using an O/R.
    Karl mentions in his book that what you really need to do, is take a leap of faith, but with the O/Rs available today, it seems impossible to me that you can avoid designing your system around the shortcomings of the O/R.

    I haven't tried building a system on an O/R mapper yet, since I just don't trust it. But if you have different experiences, please tell me that I have the wrong idea. I'm particularly interested in whether it holds up in an enterprise service environment.