Good Software Design Part 1: User Directories

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

Anything Your OS Can Do, Linux Can Do Better

…Left 4 Dead 2 is running at 315 FPS on Linux. That the Linux version runs faster than the Windows version (270.6) seems a little counter-intuitive, given the greater amount of time we have spent on the Windows version. However, it does speak to the underlying efficiency of the kernel and OpenGL.

 

Faster Zombies! | Valve

 

Well, I guess that’s that. Valve has shown that Left 4 Dead runs better in Linux than in Windows. That basically strips away the last possible reason why anybody would want to use Windows. Not to mention that, even without official ports, Valve software has always run flawlessly under Linux with Wine. Wine can even run older Win95 games that you can’t run on modern versions of Windows anymore. So I guess Linux is better at running Windows programs than Windows is. Ouch.

 

Windows fanboys, come at me!

Card Games on Motorbikes

Those of you that know me know that I like motorcycles. Whenever I’m riding my bike (a 2003 Suzuki Savage LS650 2013 Suzuki Boulevard M50), I’m always thinking dangerous thoughts like “Wouldn’t it be cool if…” Usually these thoughts involve making small or large modifications to the bike (such as adding a bunch of LEDs and turning it into a Light Cycle).

 

Most recently, I thought it would be cool if I could modify an RV (or other sufficiently large vehicle) with a ramp in the back so that I could launch myself at any given time. At first I thought “That would be so bad-ass!” Then, of course, the scientist in me kicked in and said “Well wait…how would that even work? Would I skid out of control as soon as I hit the pavement, or, presuming I had the clutch activated, would I be able to smoothly launch from the back of the moving vehicle? If the latter, how would the wheels be able to ‘magically’ speed up from 1-2 mph to ~60 mph?”

 

Fortunately, I discovered that Mythbusters covered a similar stunt, except in reverse. In it, they re-create a famous stunt from Knight Rider where they attempt to load a Camaro RS onto the back of a truck while both are hurtling down the freeway. Their results brought new life into my octane-fueled dreams. Not only were they able to show that it was possible, they showed that it could be done very smoothly thanks to good ‘ol inertia.

 

Now I just need to fit it with a brand new <echo>Duel Disk System!</echo> and I’ll be set! Oh…and some money for all these modifications would be nice too 🙂

Let’s Try Again…

Welcome to Boonean Logic v3.0. Remember that post I made on my old blog saying that I didn’t forget about this? Probably not. Well, in case the long (over a year) posting hiatus that followed didn’t make it obvious, that was a total lie…I completely forgot about it. My website had also gone neglected as well.

 

That brings us to the current state of things. I’ve begun working on re-vamping the entire site, and in the process I realized that I should probably do something about that blog that I hadn’t touched in ages. As a result, I decided to move from Blogger to a self-hosted WordPress solution. I didn’t even bother with trying to move all the old posts to this one, opting instead for a clean slate. Hopefully this time I’ll remember to post meaningful stuff more often for the three of you that will probably ever read this.