CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Greg Young [MVP]

November 2007 - Posts

  • DevTeach Vancouver

    What an awesome conference!

     Smart people, good discussions, and lots of information!

     

     There were some really good sessions .... in particular David Laribee did a great DDD introduction. Although I missed the agile track I have heard also heard nothing but great things on it.

     

     

    I usually try to stay on topic but here are some fun quotes:

    "Software should be grown not developed, its like gardening all you can hope to do is give it the right environment to thrive" 

    "I hate checked exceptions" ...

    "Where is Oren when we need him", Jeremy Miller (and the follow up,
    "excuse our laughter")
    "I thought it was a loud cell phone", David Laribee (after the fire
    alarm went off in DDD presentation)

    "One drop of unverifiable code means completely unverifiable" (in
    reference to my statement), Jeremy Miller

    "Have you used eclipse?", all

    "I know from your smirk that I should just stop now", Scott Bellware
    "We need to rename spec# something better", "We need to rename you
    something better too", Scott Bellware

    "I spend 45 minutes a day waiting on visual studio" (not memorable for
    content but for the sickness of measuring) Ayende
    "He writes bad things about Microsoft on his anonymous blog", "No
    that's my regular blog" (unnamed)

    "Phase 1 collect underpants, Phase 3 profit", me
    "Is granville still open?", everyone

     

  • Spec# coming soon to a framework near you?

    Snooping through 3.5 now that its in production I found something I was REALLY hoping to see ... Anyone up for guesses on why Microsoft.Contracts made it into System.Core? :)

     

     

     

     

     Not ONLY this but parts of the framework (oddly the new parts) ACTUALLY USE the contracts!!!

     

     [Serializable, StructLayout(LayoutKind.Sequential), Immutable, ComVisible(false)]
    internal struct BigInteger : IFormattable, IEquatable<BigInteger>, IComparable<BigInteger>, IComparable

    Yes YES YES !!! IMMUTABLE .... mmm so yummy!

     

     [Pure]
    public static bool operator >(BigInteger x, BigInteger y)
    {
        return (Compare(x, y) > 0);
    }

    And finally ...

    private static ushort Exponent(byte[] doubleBits)
    {
        Contract.Requires(doubleBits.Length == 8);
        return (ushort) ((((ushort) (doubleBits[7] & 0x7f)) << 4) | (((ushort) (doubleBitsDevil & 240)) >> 4));
    }

     

    Somebody at Microsoft has really made my DAY!!!

     


     

     

     

    Very soon me thinks ... spec# will be coming to a framework near you!! 

  • Extension Method Best Practices?

    Interesting discussion that came up on the ALT.NET list. Many people simply say don't do that but they have a time and place and should be weighed like any other architectural or API decision. While I find that many people will misuse this feature to extremes and code will quickly become unmaintainable I can understand the possible benefits of them (especially in the context of LINQ).

     

    So my #1 best practice for extension methods?


    ALL extension methods should be [SIDE EFFECT FREE FUNCTIONS]

    I wish that the C# compiler would enforce this rule to not let you create an extension method that was not side effect free but unfortunately this is not the case. Extension methods that change state are quite evil.

     

    What do you see as best practices? 

     

More Posts