[Lowerbounds, Upperbounds]

Algorithms are everywhere.

Many small annoyances of Windows are due to unreasonable default settings. For example, the dir command in the command prompt (cmd.exe) does not sort its output by default. Can you believe that this is year 2005?

I know, I know. It’s more convenient for the programmer to just dump the content from the master file allocation table, but we should focus on the user’s experience. And indeed sometimes a directory may be so huge that sorting the files would take seconds, but how many of the normal users would encounter such a directory?

In the end, I believe we all want to the output of dir to be sorted. The solution is to set the DIRCMD environment variable to /o, meaning that you want it to be sorted. (I myself also use /a, meaning show all files.) On the one occasion that you hit a huge directory and don’t want the output to be sorted, you can use dir /o- to disable it just for once.

No Comments :(