CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter
Like CodeBetter.Com? Get more Stuff you need to Code Better at Devlicio.Us Devlicio.us

Øredev is different

Following in Oren's suit, I wanted to let everyone know that Øredev is one awesome conference, and I am having a real blast! If you know me, then you know I am usually really bad about blogging about conferences I attend. I already have a backlog that includes PDC, Kaizen and the p&p summit. Why this one? Well I am really feeling inspired, and thus it's became a moral imperative. :-)

A few things about this conference stand out for me.

  • The graciousness of the hosts. On the night before the conference I attended a private party at Magnus (my track owner's) house. Magnus welcomed a bunch of us into his home, which was wonderful. Magnus thank you and your wife for your amazing hospitality!  After that we headed over to a beautiful dinner at one of the local government buildings. There we were hosted by the deputy mayor of the city of Malmö! The architecture of the building was amazing, and it it was filled with some very old works of art. The mayor gave us a nice talk about the history of the building, and thanked us for coming from all-over to attend the conference. Last but not least, I'd like thank Michael Tilberg. He and his crew have really gone out of their way to make sure all our needs are provided. All I can say is Wow!
  • The level of seriousness of the attendees. I have attended a host of different conferences. In this one, the audience tends to be more reserved (I hear it's a Scandanavian thing), but the attention to the content and the speakers is amazing. All I can say is there guys are really serious, and their pride for what they do really shines through! At the few talks I gave, everyone listened very intently and no interruptions. That is, aside from my non-swedish Israeli friend, Oren Eini, who continually interrupted me with Resharper key-stroke suggestions! We're still buddies though :-)
  • Diversity of topics. In the same conference you find several different tracks from .NET and JAVA to ALT.NET, DDD, Program Management, and Agile techniques. For me I was really excited to get to see Jimmy Nilson speaking on Domain Driven Design.
  • Diversity of attendees. This for me is the real hidden gem. Attendees at this conference come from several different backgrounds, some come are .NET developers, some are Java Developers and others are using languages like Ruby and Groovy, and Scala. I have spent more time chatting with folks outside the Microsoft world than inside.  I've had some great chats with Bruce Snyder from Spring Source, Oracle (thanks Bengt, Mikael and Tom) and Sun. The environment is really welcoming. At no time did I get comments like "so you are a Microsoft guy". Instead we chatted about a lot of the common challenges we all face, our shared learnings, and also our thoughts on where languages are evolving to.  In general I heard a lot of very positive feedback and even amazement with all the progress Microsoft is making toward openness. Bruce literally did a double take when I told him we shipped JQuery, an open source library as part of the framework.

A few takeaways I took from all these conversations:

  • The gaps between the Java and .NET are really narrowing. Java is no longer a single language that runs on many machines, instead it's truly evolving (and has been for some time) to be a multi-language platform as is the case with .NET. I learned of at least two new languages that run on the JVM that join JRuby, JYthon and Scala.
  • We have so much in common, and should work together. Once I get back to Redmond, I want to follow up on seeing how we can start building some sort of platform agnostic community. When it comes down to it, we're just facing a lot of the same problems, and there's a pool of tremendous mind-share across all the communities.

Here are a summary of highlights of the conference for me so far (some of which I've already repeated).

  1. The party at Magnus'
  2. Oren Eini's 3-hour workshop on Rhino Mocks
  3. Jimmy Nilson's talk.
  4. Meeting Eric Evans.
  5. Excessive hang-out time with Carl Franklin, Richard Campbell, Oren Eini, Scott Bellware and Ted Neward. I have never laughed my ass-off so many times in a single week!
  6. the ALT.NET panel discussion with Oren Scott
  7. Recording the DNR talk on MEF
  8. Great chats with a range of folks including my colleagues Tim Heuer, Beatriz Costa, Eilon Lipton, Scott Hunter and Johan Lindfors, and a bunch of attendees. BTW, Johan thanks for all the advice!

These are just the things that stand-out off the top of my head, I am sure there are many more that I have missed.  I am really looking forward to the MEF talk today, and the open-discussion panel debate on software development that I'll be participating in this evening along with a host of folks including Robert Martin and Diana Larsen.

My only complaint would be that I REALLY over-committed this time, and now I am exhausted. Just yesterday I did a DNR-TV, a DNR, a session on Microsoft and ALT.NET  and an open-panel discussion on the state of ALT.NET. Anyway, I can't blame anyone but myself. I am just too excited about this stuff to say no. Even worse, I deliberately go and seek all this stuff out! It's like am a glutton for punishment or something.

  • Thank you Malmö and Øredev for a wonderful conference so far. I'll definitely be coming back if you'll have me :)
  • ASP.NET MVC: ActionNameAttribute and ActionMethodSelector Class

    This past Monday was the ASP.NET MVC Firestarter Event in Tampa Florida. This was a great event with over 140 people registered and the Tampa MPR filled to capacity.

    I presented  a couple of sessions. One session walked-thru a sample MVC LINQ To SQL Application that performed your basic CRUD operations to SQL Server 2008. Although conceptually simple, the application showed numerous features in ASP.NET MVC.

     

    ActionNameAttribute in the MVC Framework

    Although not rocket science, I showed use of the ActionNameAttribute that allows one to override the name of the action which defaults to the name of the method. In the case below, the action is Delete and not Remove due to the ActionNameAttribute.

     

    // Example of Using ActionName

    [ActionName("Delete"), AcceptVerbs(HttpVerbs.Post)]

    public ActionResult Remove(int id)

     

    One of the questions that popped up is if the MVC Framework would also respond to a Remove Post Request. I knew the answer was no as I have tried it, but it bothered me that I couldn't expand anymore on the subject. Here is the answer :)

     

    ActionMethodSelector Class

    After check the MVC Source Code, it turns out there is a ActionMethodSelector Class that looks for appropriate methods to respond to an action request. It first looks for Aliased and Non-Aliased Methods on the controller. Aliased Methods are those methods that have the ActionNameAttribute ( actually the ActionNameSelectorAttribute from which the ActionNameAttribute derives ). It separates these from Non-Aliased Methods.

     

    AliasedMethods = Array.FindAll(actionMethods,

        IsMethodDecoratedWithAliasingAttribute);

     

    NonAliasedMethods = actionMethods.Except(AliasedMethods).

        ToLookup(method => method.Name, StringComparer.OrdinalIgnoreCase);

     

    When the ActionMethodSelector Class looks for a proper action, it uses the name supplied in the ActionNameAttribute for Aliased Actions and totally disregards the name of the method, so the method name never comes into play. Therefore, Remove, is never known as a valid action name. I left out the code as it isn't that interesting, but the method that looks for matches in aliased methods is as follows:

     

    internal List<MethodInfo> GetMatchingAliasedMethods

        (ControllerContext controllerContext, string actionName) {

     

        // find all aliased methods which are opting in to this request

        // to opt in, all attributes defined on the method must return true

        ...

    }

     

    Conclusion

    Not necessarily the most interesting information, but I wanted to follow-up on the question a bit more to at least satisfy my own curiosity.

     

    Hope this helps,

    David Hayden

     

    Recent Posts:

     

    An easy and efficient way to improve .NET code performances

     
    Currently, I am getting serious about measuring and improving performances of .NET code. I’ll post more about this topic within the next weeks. For today I would like to present an efficient optimization I found on something we all use massively: loops on collections. I talk here about the cost of the loop itself, i.e for and foreach instructions, not the cost of the code executed in the loop. I basically found that:

     

    • for loops on List<T> are a bit more than 2 times cheaper than foreach loops on List<T>.
    • Looping on array is around 2 times cheaper than looping on List<T>.
    • As a consequence, looping on array using for is 5 times cheaper than looping on List<T> using foreach (which I believe, is what we all do).

     

    The foreach syntax sugar is a blessing and for many complex loops it is not worth transforming foreach into for. But for certain kind of loops, like short loops made of one or two instructions nested in some other loops, these 5 times factor can become a huge bonus. And the good news is that the code of NDepend has plenty of these nested short loops because of algorithm such as Ranking, Level and dependencies transitive closure computation.

     

    Here is the code used to benchmark all this:

     

     

     
    Here are the results obtained with the System.Diagnostics.Stopwatch class:

     


     

    The fact that for is more efficient than foreach results from the fact that foreach is using an enumerator object behind the scene.

     

    The fact that iterating on array is cheaper than iterating on List<T> comes from the fact that the IL has instructions dedicated for array iteration. Here is the Reflector view of the methods:

     

     

     

    In the console output, we can see that foreach on array is a tiny bit more costly than for on array. Interestingly enough, I just checked that the C# compiler doesn’t use an enumerator object behind the scene for foreach on array.

     

    Some more interesting finding. The profiler dotTrace v3.1 gives some unrealistic results for this benchmark. IterateForeachOnList is deemed more than 40 times more costly than IterateForOnArray (instead of 5 times). I tested both RecordThreadTime and RecordWallTime mode of the profiler:

     

     

     

    Thus I also ran the benchmark with ANTS Profiler v4.1 and got some more realistic results, still not perfect however (IterateForeachOnList is now deemed 8 times more costly than IterateForOnArray,instead of 5 times).

     

     

     

    You can download the code of the benchmark here. All tests have been done with release compilation mode.

    DC ALT.NET 11/25 - Web Testing Frameworks

    The November meeting for DC ALT.NET will be on November 25th, 2008 from 7PM-9PM.  Check out our site and our mailing list for more information as it becomes available.  This month, John Morales will be facilitating a discussion on web testing frameworks which includes Selenium, Watir and WatiN among others.  Once again, I'd like to thank Cynergy Systems, Inc for sponsoring this month's event.

    The information is as follows:

    DateTime:
    11/25/2008 - 7PM-9PM

    Location:
    Cynergy Systems Inc.
    1600 K St NW
    Suite 300
    Washington, DC 20006
    Show Map

    Short Foundations Presentation - This Thursday in Ottawa

    If you happen to be a developer in the Ottawa area, you're inviting to come check out my quick 1 hour presentation on unit testing, mocking and coupling. It's taking place from 12:00-1:00 this Thursday (20th) at Microsoft's Glacier room in the World Exchange Plaza downtown. There'll be free pop! (heh).

    You can let the organizers know you plan on coming by sending an email to events@OttawaCommunity.net - which'll help with logistics. These luncheons are generally for a small groups of people (~30-40). If people are interested in these types of talks we'll look at creating more formal presentations, standups and general opportunities for Ottawa-area developers.

    Spicing Up Your Standup

    Tags: luke-melia-is-awesome, funny

    Thoughts on the Decline and Fall of Agile

    If you haven't already, go give this post from Jim Shore a read.

    I've seen a lot of commenters on this post so far, and their thoughts generally mirror my own.  You can't take the "desserts" of Agile practices like working incrementally or the all important adaptive planning and scheduling without quite a bit of engineering practice vegetables.  You wanna work adaptively instead of the ol' fashioned plan driven method?  Fine, but you've got to make that adaptability safe.  You need rapid feedback cycles to know when you're getting off the rails (customer demos, TDD, Continuous Integration, automated acceptance tests, static code analysis or some sort of equivalent).  You need to take steps that make continuous design methods safe and effective (simple design, a constant attention to design fundamentals like the SOLID principles, and an intolerance for technical debt).  And your team needs to be retrospective about its work to make adaptions as they become necessary.

    In the early days, XP was roundly criticized because every practice only seemed to be safe due to the existence of the other practices.  Take one out, and the others weren't that great by themselves.  I think that's more or less a fair criticism, but my response is simply to adopt, and effectively apply, everything you need to make Agile development successful.  You can't just pick and choose the easy things.  If you take something off the old XP practice recipe, you probably need to find an analogue solution to add something else back into your practices.  Regardless of which practices and how you do those practices, there are project needs that have to be filled (planning, quality assurance of some sort, feedback cycles, etc.).

    Of course, it's always going to be easier to get it wrong than right, but that's why we're paid the big bucks.

    More Posts Next page »


    Our Sponsors


    What's New

    CodeBetter.Com Blogs

    Glenn Block
    68 Posts | 247 Comments | 142 Trackbacks
    David Hayden [MVP C#]
    295 Posts | 814 Comments | 591 Trackbacks
    Patrick Smacchia [MVP C#]
    80 Posts | 328 Comments | 424 Trackbacks
    Matthew Podwysocki
    74 Posts | 187 Comments | 296 Trackbacks
    Karl Seguin
    143 Posts | 1,298 Comments | 402 Trackbacks
    Dave Laribee
    79 Posts | 534 Comments | 243 Trackbacks
    Jeremy D. Miller -- The Shade Tree Developer
    608 Posts | 4,700 Comments | 2,119 Trackbacks
    Peter's Gekko
    541 Posts | 2,415 Comments | 610 Trackbacks
    Kyle Baley - The Coding Hillbilly
    110 Posts | 606 Comments | 198 Trackbacks
    Greg Young [MVP]
    100 Posts | 651 Comments | 304 Trackbacks
    Ian Cooper [MVP]
    42 Posts | 277 Comments | 195 Trackbacks
    Aaron Jensen
    18 Posts | 80 Comments | 40 Trackbacks
    James Kovacs
    46 Posts | 154 Comments | 54 Trackbacks
    Steve Hebert's Development Blog
    313 Posts | 543 Comments | 109 Trackbacks
    Raymond Lewallen
    302 Posts | 2,024 Comments | 369 Trackbacks
    Jeff Lynch [MVP]
    228 Posts | 494 Comments | 111 Trackbacks
    Rod Paddock
    37 Posts | 146 Comments | 40 Trackbacks
    Jacob Lewallen
    5 Posts | 40 Comments | 7 Trackbacks

    Other Blogs

    CodeBetter.Com Events
    3 Posts | 0 Comments | 13 Trackbacks
    CodeBetter.Com Link Blog
    178 Posts | 10 Comments | 2 Trackbacks
    All About Products
    2 Posts | 5 Comments | 2 Trackbacks
    Featured Articles
    1 Posts | 4 Comments | 1 Trackbacks

    CodeBetter.Com Alumni

    Jean-Paul S. Boodhoo
    136 Posts | 410 Comments | 136 Trackbacks
    Don Demsak
    5 Posts | 14 Comments | 1 Trackbacks
    Jay Kimble -- The Dev Theologian
    423 Posts | 1,431 Comments | 167 Trackbacks
    Eric Wise
    290 Posts | 1,513 Comments | 222 Trackbacks
    Brian Peek [MVP C#]
    15 Posts | 15 Comments | 3 Trackbacks
    Mark DiGiovanni
    88 Posts | 322 Comments | 45 Trackbacks
    Paul Laudeman
    113 Posts | 236 Comments | 25 Trackbacks
    Ben Reichelt's Weblog
    172 Posts | 514 Comments | 75 Trackbacks
    Ranjan Sakalley
    41 Posts | 272 Comments | 6 Trackbacks
    Public Class GeoffAppleby
    300 Posts | 1,943 Comments | 108 Trackbacks
    DonXML - Live From PDC
    3 Posts | 4 Comments | 3 Trackbacks
    Grant Killian's Blog
    171 Posts | 477 Comments | 9 Trackbacks

    CodeBetter.Com Emeritus

    Brendan Tompkins [MVP]
    406 Posts | 2,804 Comments | 353 Trackbacks
    Darrell Norton's Blog [MVP]
    731 Posts | 2,383 Comments | 331 Trackbacks
    Jeffrey Palermo (.com)
    654 Posts | 2,478 Comments | 620 Trackbacks