Skip to content

The Rule of Silence

November 19, 2008

The book The Art of Unix Programming outlines some of the conventions that good Unix programs often follow. One of these is the Rule of Silence:

Rule of Silence: When a program has nothing surprising to say, it should say nothing.

When most Unix command lines run, you know they worked because they don’t spit out a error. If you want more detail you can typically apply a verbose command line switch to get more detail but generally speaking you run the command and you trust that it worked because there is no error written to the screen.

Contrast this with Ant. While Ant is a great tool and has made my life much easier however the typical Ant script will spit out so much detail, detail I just don’t care about in 95% of cases. Not just a screenful of stuff but multiple screenfuls of stuff. To find the needle in the haystack is a bit challenge. Even the -q quiet switch still outputs a ton of details. There seems to be no ‘really really be quiet switch’ that I can see.

Next time I write a command line program I’ll be thinking carefully about whether what I write to the screen.

Advertisements

From → Build

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: