Hacker News new | ask | show | jobs
by BiteCode_dev 1178 days ago
It's important on any system, not just XDG. The OS will assume you do, and offer features based on it, such as cleaning cache dirs, emptying temp dirs, etc.

It's not just about being tidy, although it's important.

But remembering all that stuff is annoying.

If you use Python, the wonderful "appdirs" package will make using the best dir for the job on Windows, Mac and Linux, easy and transparent: https://pypi.org/project/appdirs/

I wish it was part of the stdlib.

Another thing that grind my gears is people putting files inside their code project folder for development.

It should be something configurable, that by default use the OS dir for prod, and "../var" dir with everything on it in dev.

Less gitignore trouble, let's watcher overhead, less indexing for nothing, less clutter in file explorers, less possibility for errors.

But you need to provide an easy way to locate those files, such as a cmd line entrypoints, otherwise it's painful.

2 comments

appdirs has officially been deprecated.

Its successor is https://pypi.org/project/platformdirs/

Except neither appdirs or platformdirs obey xdg on Mac, without an option to override.

Which makes this less than ideal.