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

Don Demsak

Tales from the field
  • Jason Bock - Write Your Tests First...Because Adding Them Later Sucks

    Jason has it right, write your tests first.  Yes, a lot of us already know this, but it is great to add another person to the choir.

  • ThoughtWorks Podcast #1 - Domain Specific Languages Part 1

    While going thru my morning ritual of reading my subscribed blogs, I ran across Martin Fowler's announcement of the first ThoughtWorks podcast, IT Matters.  There doesn't seem to be an HTML page up for the podcast, just a feed.  I started to listen to it on the train ride into NYC this morning, and so far so good (well what do you expect).  The only thing I would suggest to ThoughtWorks is if they will to continue with the podcast:

    1. Put up a website (I'd be surprise if this wasn't already in the works).
    2. Add a forum to the site, so people can discuss the podcasts (helping to develop a listener community).
    3. Hire (or contract) a sound engineer.  I know this is just their first podcast, but the sound quality is pretty bad.  From working with Carl Franklin and the .Net Rocks team, I know how hard it is to produce decent sound quality podcasts.  ThoughtWorks should be able to come up with great content for the podcasts, but if the sound quality isn't there, it will limit their audience.

    But, don't let these small issues stop you from subscribing to the podcast, the content is worth your time.  I'm looking forward to DSLs Part 2, and beyond. 

  • PatternExpert - Not a .Net Patterns Expert

    I happen to be reading the current issue of Redmond Developers News and ran across the article, .NET Toolbox Picks: Part II by Leonard Lobel and Brian Schmitt.  In it they mention some of the usual must have 3rd party development tools (ReSharper, Reflector, RegexDesigner.NET, etc.), and one that I've never heard of, PatternExpert.  It sounded like it had some good potential, trying to add a little guidance on using software patterns, so I figured I'd download it and give it a whirl. 

    There is no installer, just an executable, which would be fine if the product was open source or free, but at $79, I expect an installer.  First thing I noticed, no support for Visual Basic, which is unfortunate, since this is a major .Net language, and an area that needs some patterns guidance.  The product itself has a tree view listing 22 major patterns, and a wizard or Powerpoint-like frame, where the pattern is explained.  I like the style of the pattern documentation, and it seemed easy to understand.  But, when I got to the sample code, that is where things totally fell apart.

    The first (and only) code I checked was for the Singleton Pattern.  The fact that there were 2 implementations of a Singleton, simple, and limited number (isn't Limited Number of instances a Multiton not a Singleton?) let me know that something was amiss here.  Then I looked at the Singleton Code.  Since the Code Samples where done in .Net 2.0, I expected the commonly accepted implementation (Jon Skeet has a great tutorial on this topic):

    public sealed class Singleton
    {
        static readonly Singleton instance=new Singleton();

        // Explicit static constructor to tell C# compiler
        // not to mark type as beforefieldinit
        static Singleton()
        {
        }

        Singleton()
        {
        }

        public static Singleton Instance
        {
            get
            {
                return instance;
            }
        }
    }

    But instead the PatternExpert code looks like this:

    namespace SingletonApp
    {
                    /// <summary>
                    /// Singleton, with added reference count and release call
                    /// </summary>
                    public class zZ00singletonZz
                    {
                                    private static zZ00singletonZz     oInstance = null; // Single instance
                                    private static      int iReferenceCount = 0; // Reference count

                                    protected zZ00singletonZz()
                                    {
                                    }

                                    // Create or get the singleton object
                                    public static zZ00singletonZz getInstance()
                                    {
                                                    if (iReferenceCount == 0) // See if the object is around yet
                                                    {
                                                                    oInstance = new zZ00singletonZz();// Create the object
                                                    }
                                                    iReferenceCount++; // Increase the reference count
                                                    return oInstance; // Pass the object back
                                    }

                                    // Release or delete the singleton object
                                    public static void releaseInstance(zZ00singletonZz inst)
                                    {
                                                    // Exit if already deleted or if it is not our instance
                                                    if (iReferenceCount == 0)
                                                                    return;

                                                    iReferenceCount--;// Decrement the reference count

                                                    if (iReferenceCount == 0) // See if this is the last user
                                                    {
                                                                    // No one needs this object, garbage collection will delete it
                                                    }
                                    }

                    }

    That code is so bad, it is scary that it is in a tool designed to teach developers about how to write good code.  IMHO, it looks like something a C++ programmer that hasn't bothered to learn how to write managed code would come up with.  Reference Counters?  In Managed Code?

    But, the tool did get me thinking that something like this (but done right), installed in the IDE would be cool.  Yeah, code snippets and the Guidance Automation Toolkit cover some of this area, but they don't quite make it.

  • Fairfield / Westchester CT Code Camp

    The Fairfield / Westchester CT Code Camp will be held this Saturday, Nov. 10, 2007 at The University of Connecticut School of Business, at the Stamford Campus.  I'll be giving my VB + XML is Cooler than C# talk (yeah, language snobs love this talk ;) ).  There is still room for more attendees, so, if you live in CT area and want to spend a Saturday improving your skills, stop on by.

  • Heartland Developers Conference and ALT.Net

    I'm just back from Omaha, NE where I spoke at the Heartland Developers Conference.  This was my 2nd time speaking at this conference, and I got to say, I really like the conference that Joe Olsen and Phil Wolfe have put together.  It isn't your prototypical large conference (even though they had 500 people there this year), and they manage to keep that mid-western (OK, heartland) feel.  This year I was asked to speak on ALT.NET, which is a pretty broad topic, and thus a little hard to get that talk just right.  They also had a number of Agile or ALT.Net oriented talks: Javier Lozano did a talk on Software Factories, Tim Rayburn did a great TDD talk, Beth Schmidt, Director of Application Development for Farm Credit Services of America, spoke about  her experiences with Agile, Adam Esterline spoke about MonoRails, and Ron Jacobs had the first day's keynote - The Perfect Pattern Storm, where TDD meets UX and MVP.  Definitely a nice coverage of ALT.Net topics.

    In my talk, I did my best to try to cover all the bases and expose folks to all sorts of alternative development styles/practices.  The night before, I heard that F# is going to make it into VS 2008 as a first class language, so I added it to my list of alternative languages.  In the talk I mentioned that F# would help turn your brain inside out, and that it is something that I've been playing with.  Unfortunately, I didn't think of it ahead of time and have F# installed on my presentation machine and have some example code to show them, and of course someone asked me to show them some F#.  Man, I blew that opportunity.

    But, I was able to get some of the attendees to engage in a bit of conversation during the session.  Midwest folks tend not to ask as many questions as my NJ and NYC brethren, and it took some doing, but I did have a couple folks come up to me later in the conference and ask for suggestions on getting their teams to look outside the box.  This definitely seems to be a reoccurring theme with the ALT.Net folks, and I think we need to spend some time in this space.  There seem to be a lot of people willing to give this stuff a try and just need a little help.  One of the things I suggest is to find a mentor, either online or if you can, someone local.  Even better would be to hire a consultant as a mentor for a couple months.  There are enough independent consultants in the ALT.Net movement, and I'm a firm believer that although training is a good thing, it might be more cost effective to bring in a consultant for 2-3 months and get the pump primed.  I've seen too many folks come out of training classes all gung-ho, just to fall back into their old habits after a couple weeks.

    Oh, yeah, I forgot to mention, yes, I'm back to blogging on CodeBetter.  I'm still keeping my personal blog up and running, but I'm going to post different material on both sites.  This one, I'm going to try to keep more "ALT.Net in the field", and leave my other site just the way it is.  Actually, I've been suffering from writers block over the last 6 months, so I'm hoping the change of scenery will help get me past that.

More Posts

Our Sponsors