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

Karl Seguin

.NET From Ottawa, Ontario - http://twitter.com/karlseguin/

October 2007 - Posts

  • The Productive Developer

    A common topic for tech bloggers is to talk about some of the books that had the greatest impact on their professional development. I've been a little surprise that, in the last handful I've read, Peopleware didn't make the list. Personally, it's been a highly influential book – and if you believe what Joel Spolsky testimonial says, there's a case to be made for it being the most influential book in our industry.

    I often talk about maintainability as an umbrella term for everything I try to do. I refactor to increase readability to increase maintainability. I write unit test to increase robustness to increase maintainability. But when I think about it, maintainability is just a sub-category for an even bigger umbrella: productivity. Lately, I think we (I use the term broadly and possibly ignorantly) have focused a lot of attention on tools that make us productive and less on the intangibles.  Discussions around Ruby, Agility, ALT.NET, Design Patterns, Resharper, Dual Monitors and so on all deal with actual products or practices that can be implemented to increase productivity. For any of these to have an impact, there's a fundamental layer which first needs to be in place.

    In any normal situation (i.e. not a soldier on the front lines), the core to being productive is happiness. I'm far from an expert on the field, but I think it's safe to say that there are some pretty basic things that we all want: good health, balanced personal and professional life, reasonable stress levels, good night sleeps, friends, family and so on.  Let's call these the fundamental aspects of productivity – without them, no amount of open source tools or duct typing can make us productive. In our field, it's common that an employer is more respectful of these things than the individual. Where I work they are very conscious about having people take their vacation time because they want people to get out and see the world (in reality, there's a strong financial incentive, since accrued vacation time is a liability to a company, but in my case the concern from the company is sincere).

    Beyond these fundamentals, I think there's a very rich and complex layer of human psychology that can be leveraged to make us more productive, which we can call beneficial aspects of productivity. In my experience, little attention is given to these subtle things.  Sadly, most are outside your control – they are things provided by your manager/employer. Some that quickly come to mind are:

    • Mentorship, job-related training and adoption of new technologies,
    • Teamwork, shared ownership and member equality,
    • Challenges, new projects, well defined goals,
    • Quality, enthusiasm and sense of pride

    In Peopleware, DeMarco and Lister talk in detail about the most important of these things: the drive towards quality. I've lived it myself, the further away from quality a project goes, the less enthusiastic the team becomes, the worse the quality gets. It's a vicious circle which, once too far gone, is impossible to break out of.  Project managers just don't seem to grok this reality – they don't understand the personal investment developers put into software projects (it's like a piece of art to us), and the toll is takes on us when poor decisions are made despite our strong objections.

    There are tools and practices that address many of these issues. Things like sustainable pace, customer collaboration and life vectors are pretty hot. More specifically, I think user stories provide a double whammy – they give your developers a substantial voice of how they think the product can be made better, and provide a means of measuring productivity (velocity).

    When all is said and done, I think this is an area where most shops can reap huge benefit. Sure, buy everyone a license of Resharper and SQLCompare because you'll get instant return on the investment, but think beyond hard goods and come up with ways to motivate developers and keep them enthusiastic about the work they are doing. There's a reason innovative companies like Google and 3M give its employees time to work on their own project.
     

     

    Posted Oct 15 2007, 01:28 PM by karl with 5 comment(s)
    Filed under:
  • Avoiding Extension Methods

    Over the past couple months, we've been playing more and more with C# 3.0, .NET 3.5 and Visual Studio 2008 (man, it'd be nice to get these version numbers synced up). At first I was naively optimistic about the usefulness of extension methods, but in practice, they seem to add no real value and, on occasion, decrease readability.

    The C# specifications themselves point out this flaw:

    “Extension methods are less discoverable and more limited in functionality than instance methods. For those reasons, it is recommended that extension methods be used sparingly and only in situations where instance methods are not feasible or possible.”

    (Interestingly, I couldn't find the same such warning for VB.NET – maybe I was just looking at the wrong document).

    I understand that extension methods were required for LINQ, but I haven't come across, nor am I able to think of, a situation in which it'll ever be necessary for me to use. Open classes have been a small stumbling block for Java/.NET programmers doing the switch to Ruby, and I see extension methods as a poor-man's implementation of those.

    In the end, like with anything else, it comes down to responsible and proper use. With or without extension methods, a bad programmer will write un-maintainable code. However, I do wish that the countless blogs and articles covering the new Orcas features, like extension methods, would do more than show-off the syntax and pump out a few examples. Explaining shortcomings, pitfalls and proper usage is more important than shallow examples.

    For me though, I'll stick with my explicit procedural StringUtility class.

More Posts

Our Sponsors

Proudly Partnered With