Or how not to clutter up a user’s hard drive with your crap
Just a quick post as I clean out my hard drive, something I usually don’t have time to do. Usually, it’s a straightforward if laborious process but I’m running into an old problem that has annoyed me for years. It seems that many developers like to store their application information somewhat at random. Back in the day, at least on mac, this was ok since there was no designated folder structure other than what the user wanted it to be. Apps were self contained and you could run it from anywhere, you could move stuff around generally without problem.
Enter OSX. Like, more than 10 years ago. Here’s where Apple switched to more of a Unix/Linux folder structure scheme and it has worked out brilliantly. I always know where to find things – provided the developers of apps I install follow the same bloody structure!
Too often I still find folders of application information, shared libraries, caches, save files etc. randomly strewn around my hard drive. If I move them to their proper place, chances are the app in question will no longer function, at least properly, because it cannot find what it needs. What a pain. So I have useless app folders cluttering up my documents folders, or in the worst case essential files tucked in directories that – by definition – are meant to hold temporary, sacrificial files.
While not exhaustive, treat this as an introductory guide in how not to mess up your user-base’s hard drives.
- This is the user space for the user’s documents, it is not for saved preferences and profiles. This is where we store our stuff, not your stuff. Stop cluttering it! Worst offenders: Adobe, Microsoft, many many games
- Many linux programs love to put their stuff in here putting a “.” before the file name making it invisible. Though I realize this is the norm for *nix systems, please don’t do it on OSX. It’s annoying when we can’t see files. Though I much prefer this to the above
- Leave this folder alone, don’t put anything into it ever
- This is the top level user directory. Never put anything in here. Ever!
- Do not put anything in this directory. You will note that there are several specialized sub-folders for this purpose. Use them, don’t clutter the library folder top level
- You can put stuff in here.
- This folder is used for things to support your application (duh), put shared libraries, help files, icons, sounds, plugins etc.
- Save games, custom workspaces and layouts etc. are also acceptable
- In debugging problems with applications, one of the routines is delete your folder in here, so make sure the application can re-generate it’s factory contents on launch if possible
- This is not a good place for user preferences, profiles, caches and logs (see below)
- This is the ideal place to store your application’s cache files.
- If you have multiple ones, put them in a folder so as not to clutter it up
- Name your folder with the proper convention, usually the reverse of your web address: e.g. com.companyname.appname
- remember: this directory is sacrificial. deleting cache files (some or all of them) frequently solves stability and speed bugs which build up over time. Don’t put anything you intend to keep in here
- Put nothing in here, whatever it is, it’s not necessary to start it at login
- Store your log files here so we can find them to read or remove them
- This is where you can store your user preferences files
- If you have multiple files, put them in a folder
- Use the standard naming convention: com.companyname.appname
- It is acceptable to store saved layouts, customizations, workspaces etc. in here
- Use the standard XML plist format for files so we can read them and adjust them if there is a problem
- If you must store personal information, license keys or the like: encrypt them!
/ root directory
- Store nothing here, ever. It is for the operating system and nothing you could ever make is that important that needs to be at the root directory level
- Unless absolutely bleedingly necessary for program functionality (not including the shitty things you force us into), you have no right to install anything outside of the user space apart from your application binary in the applications folder
- This folder is for binaries of your application ONLY. Do not put user preferences, logs, and useless crap like readme files
- shared libraries and auxilliary programs are ok provided you put everything nicely in a folder
- A mirror of the user space Library with a few extra folders, same functionality, see above
Things to NOT do
- Unless your program gives an option to install for all users of the machine, DO NOT install anything outside of the user space apart from the binary in the applications folder
- Your program, unless it’s specific function requires it (not your selfish desire) you have NO NEED to run as admin (or *gasp* root)
- Unless we specifically tell you to, you do not need to run at startup, at login, or run continually. Stay out of /Library/LaunchAgents /Library/LaunchDaemons and /Library/StartupItems, you are not welcome there
Following these simple guidelines is beneficial for both of us. You end up not cluttering up my hard drive or forcing me to spend hours looking for your files when I need them. You leave my documents’ space for my documents and allow for easy troubleshooting should something go awry with your program. The best key to user base loyalty is not to piss them off right? Work, be unobtrusive, don’t break things and you will be fine.