A snippet from a project I’ve been reading:

// -- FILE ------------------------------------------------------------------
// name       : UserConfig.cs
// created    :
// language   : c#
// environment: .NET 2.0
// --------------------------------------------------------------------------
using System;

namespace TheNamespace.Configuration
{

    // ------------------------------------------------------------------------
    public class UserConfig
    {

        // ----------------------------------------------------------------------
        public UserConfig( System.Configuration.Configuration configuration )
        {
            if ( configuration == null )
            {
                throw new ArgumentNullException( "configuration" );
            }

            this.configuration = configuration;
        } // UserConfig

        // ----------------------------------------------------------------------
        public System.Configuration.Configuration Configuration
        {
            get { return this.configuration; }
        } // Configuration

        // ----------------------------------------------------------------------
        public string FilePath
        {
            get { return this.configuration.FilePath; }
        } // FilePath

        // ----------------------------------------------------------------------
        // members
        private readonly System.Configuration.Configuration configuration;

    } // class UserConfig

} // namespace TheNamespace.Configuration
// -- EOF -------------------------------------------------------------------

 

It’s a matter of taste, of course, but I’m wondering, what is the reason to decorate the code with a such ceremony?

Much of the time we, developers, are spending reading the code. That’s why the code that is clean, easy to read and understand is so much appreciated.

Heard today, from devs working on an old & big project:

Hey, please open that file at line 11108 and try…

That’s… breathtaking…

To be clear, they are talking about source code file from a project that is in continuous maintenance mode, with new functionality and bug fixes added with regularity.

 

Definition

Technical debit – obligation that a software organization incurs when it chooses a design or construction approach that’s expedient in the short term but that increases complexity and is more costly in the long term.

Technical debit by Steve McConnell:

If the debt grows large enough, eventually the company will spend more on servicing its debt than it invests in increasing the value of its other assets. A common example is a legacy code base in which so much work goes into keeping a production system running (i.e., “servicing the debt”) that there is little time left over to add new capabilities to the system.

The success of user interface is not only in visual design, but also in user interactions. Usability, along with generic application usefulness, will define final user satisfaction & overall experience when working with your application.

Any developer occasionally or permanently is playing to role of user interface and interactions designer. Every time you are spiking an UI prototype or creating a data entry form we should keep in mind the user, usability and characteristics of successful user interface. What they are?

User interface should be:

  • Clear
  • Concise
  • Familiar
  • Responsive
  • Consistent
  • Attractive
  • Efficient
  • Forgiving

Read more, with details in 8 Characteristics Of Successful User Interfaces.

Take care of the users. At the end, they are paying your wages…

Jimmy Bogard has a very nice summary of steps you can do to speed up building of your project or solution. By “build” I mean not just rebuilding solution from scratch, but doing also a complete run down: cleanup, rebuild and run your tests. This can be a local build performed on a developer’s machine, or a continuous integration build performed by dedicated build/integration server.

Some time ago, when build times grew to intolerable limits, we cut down number of projects in our solution. Along with a common output folders, this improved dramatically performance especially on integration server, where a single committed change threw running of few cascading builds and code analyses.

Now, slowest part of our build process are integration tests. A big part of them are “testing integrations” with database. Since we’re using real MS SQL Express 2008 instances to run them, tests are very slow. A natural solution is using of an in-memory database like SQLLite. We spent some time on this, but since our database interactions are not trivial (kind of multi-tenant & multi-database application) we gave up until better times. But I think we will be back to finish that, because with more tests written we’re pushing up build times. To give an idea how this can be done, Ayende Rahien has a very basic example how to use in-memory database to run NHibernate integration tests.

If it will be only one conference that I’d be allowed to attend during one… no, two… tree… years it will be the Norwegian Developers Conference 2009.

Absolutely fantastic speakers line-up:

  • Jeremy Miller
  • Ayende Rahien
  • Glenn Block
  • Robert C. Martin
  • Jimmi Nilsson
  • Udi Dahan
  • … and more…

Each of these speakers are well known in software development community by their contributions to open-source projects or by efforts they do to promote best values and practices in software engineering, sharing experience and teaching mere mortals.

Extraordinary agenda, tracks and talks. If I’d be able to go there, sure I’ll find a way to divide myself to see as much possible parallel tracks.

If you’re searching for best investments for your money in a tough economic climate, you’ve found it: your skills and Norwegian Developers Conference.

Ayende is running a series of posts detailing and explaining how NHibernate maps entity classes to database. Posts include XML mappings, code and SQL queries generated when saving or querying the database so that you have everything to understand what NHibernate do to persist your data. The series is a nice addition to NHibernate Reference Documentation.

NHibernate Mapping:

 

It was a nice reading. I’ve refreshed few things in my memory and learned few new tricks.

This post will be updated as new chunks will be published (I hope it will) by Ayende.

More a note to myself, because I’m sure, will bump again in this issue later.

I’ve edited some strings in our XAML files to correct some french words. Someone pointed that I’m not playing well with french-specific characters (you now, the é, è, à, …). After committing my changes our build server went down with a strange error:

error MC3000: ‘Invalid character in the given encoding. Line 58, position 47.’ XML is not valid.

Hmm. On my machine VS has built and run it without any problems. Compiling from command line – same error.

Problem: Compiler launched from command line cannot process the source file because of international characters that I’ve just added.

Solution: Save source file explicitly in UTF-8 encoding to preserve international characters.

How To:

  • open the problematic file in Visual Studio.
  • on the File menu click “Advanced Save Options
  • from “Encoding” combo select “Unicode (UTF-8 …
  • click OK.

You’re set. Commit to please the build server and rest of the team waiting for green.

From 37signals’s blog, There’s always time to launch your dream:

“I’d love to start a company / become a great programmer / write an awesome blog, but there’s just not enough time in the day!” Bullshit. There’s always enough time, you’re just not spending it right.

Now that’s some tough love, but I’m sick and tired of hearing “no time” as an excuse for why you can’t be great. It really doesn’t take that much time to get started, but it does take wanting it really bad. Most people just doesn’t want it bad enough and protect their ego with the excuse of time.

If you want it bad enough, you’ll make the time, regardless of your other obligations. Don’t let yourself off the hook with excuses. It’s too easy and, to be honest, nobody cares on the other side.

It’s entirely your responsibility to make your dreams come through.

Q: Are you glad like I am when things flying in your head are written down nicely by someone else?

Learning

There is only one way that can make you better specialist -  learning. Continuous learning will continuously improve your skills, change work perception and increase satisfaction you have doing your daily job. If you want to jump over mediocrity you have no other way than improve yourself. Daily.

DDD

Being interested in Domain Driven Design (DDD) lately and writing more and more code this way I  found today a nice series of blog posts about DDD done by Casey Charlton.

Bringing together other related resources:

Have fun. Learn your domain. Express it in code.

Until last week I was indifferent to podcasts. Not really indifferent – I knew they exists, a lot of people likes them, they’re about things that sometimes are interesting for me. But I had absolutely no time to listen to them… Blogs & mailing lists are my choice to feed my knowledge and laziness demons…

Being car-less lately, offered me an opportunity to dig into podcast’s world. In my 30-40 minutes commuting I’ve start listening to audio feeds. So far, my preferred are:

Despite relatively slow informational flow and manageability (it’s way easier to re-read a phrase than rewind an audio stream for an interesting passage, or diagonal read versus jump back & forth to skip something) podcasts made my commuting a bit more enjoyable.

An Update: Scott Hanselman (the author of Hanselminutes cited earlier) is asking his readers about their favorite developer-oriented podcasts, and publishing his own favorites: Hanselman List of Podcasts for .NET Programmers. Very impressive list to compliment my own. Happy listening…