This is the first in what I expect will be a series of posts on my opinions about good software design. There will be absolutely no regularity in these posts, as I’ll probably just write one whenever I encounter something annoying that software developers think they can get away with. So, without further ado…
Part 1 – User Directories
User directories are called user directories because they belong to the user, NOT to the program. These are the directories where users typically keep their documents, music, videos, porn, and whatnot. At NO point should any program create, alter, or remove files in these directories without the explicit say-so of the user.
Unfortunately, lots of programs out there today like to use user directories as their dumping ground for all kinds of cache and settings files. One notorious example is Windows (or more specifically, Windows Media Player, but WMP is basically built into Windows which is a whole different issue). Most people who know me know that I use Linux almost exclusively. Unfortunately, there are still a few games out there that don’t work perfectly under Wine, and for that reason I usually dual-boot my computers with Windows 7 so I can play those games. But every time I boot Windows, it feels ever-so-inclined to completely litter my music folders with AlbumArt_{random hexadecimal}.jpg files. It always does this, even if I’m not even playing music or running WMP. Windows likes to hide these files by default, so it’s usually not until I boot back into Linux that I notice that my music directories now look worse than Normandy after D Day.
Now correct me if I’m wrong, but isn’t that why we give programs their own directories? I don’t give a crap what WMP decides to do with it’s own directory. It can create all the sub directories and hidden cache files it wants and I won’t give a crap (unless it starts eating all my disk space, of course). Just don’t put that shit in MY data directories. An example of a program that does it right is Clementine (an open-source audio player). It puts all of the cache files it creates (such as pre-computed moodbars for recently played files) in the .cache/Clementine directory in your home folder, rather than dumping them in your music directories.
tl;dr – Keep your shit to yourself.
Special bonus for Linux users!
If you want to quickly remove all of those stupid AlbumArt files in one fell swoop, open a terminal, navigate to your music directory, and run the following:
find ./ -name AlbumArt* -type f -print0 | xargs -0 /bin/rm -f