I know the answer (it's 42)

A blog on coding, .NET, .NET Compact Framework and life in general....

January, 2005

  • I know the answer (it's 42)

    command line tool syntax

    Command line interface (CUI) designs for many of the tools found with VS or in Windows were to include a bunch of individual commands or exe with options or flags.

    To get a directory listing: dir <options> as in dir c:\temp /w
    To create a directory: md c:\temp\foo
    To delete a directory: rd /s c:\temp\foo

    So even though all the tasks pertain to directory or path handling , you need to know three command to do the task. This design is slowly changing to the format of command <action> [</options:attributes>]

    For example if we change the above commands to this format with the common command called dir, we will be getting
    To get a directory listing: DIR list c:\temp /w
    To create a directory: DIR  make c:\temp\foo
    To delete a directory: DIR rem c:\temp\foo /s

    So effectively user learning is reduced. One can argue that he still needs to remember the names of the actions. But in the previous case he needs to remember rd, md, dir. Now he knows everything to do with path handling is to be done with DIR. So he can run DIR /? to get the list of actions and then do a DIR list /? to know the options for listing. The other advantage is namespace pollution in terms of the names of the executables also reduces.

    This new format has also been adopted in the VS as in the source control tool. So to get the listing of all workspaces on MyServer you  run the command
    h.exe workspaces /s:MyServer
    To create a new workspace you run the command
    h.exe workspace /new MySpace /s:abhinab-test
    I guess going forward we will see more and more of the standard OS commands also taking up this format. A very common example is the NET command

  • I know the answer (it's 42)

    Error messages


    Frequently we are presented with error message pop-ups with messages like "Unable to open file". Error messages are popped up when something has gone wrong. If SW cannot convey to the user what went wrong and what he can try to fix the problem, it might as well not show the error message at all.

    So all errors messages must have three components

    • Notification
    • Explanation
    • Solution

    A good example for a Team Build scenario would be

    Unable to connect to the build machine "BuildServer01"
    Make sure that the machine is connected to the network and the TeamBuild Service is running on it.

    So all error messages that have one sentence in them are most probably not as helpful as it states what happened and not what can be done to rectify it.

    Another important thing to note is that the user is never to be blamed for any error. If the action he did was dumb then we are at fault that we did not restrict him from committing a dumb action.

Page 1 of 1 (2 items)