@flabdablet said:
The SHGetFolderPath API (now deprecated in favor of SHGetKnownFolderPath, available only post-Vista) is actually a pretty good example of a Windows design antipattern I personally find quite irritating: the special-purpose API that exists only to work around the lack of a general-purpose feature that would actually have been less work to implement.
Regardless of whether or not that API is the pinnacle of design elegance, it's the designated official way to get these paths. If you go like "I don't like this API, so screw it, I'm doing things my own way", your program won't play well with the operating system and will end up looking bad and broken. When Microsoft issues an official specification consisting of fixed paths and symlinks or whatever to manage the actual location, then you can use fixed paths in your programs.
@flabdablet said:
If a Unix sysadmin wants the kind of flexibility offered by the Known Folders in Windows, all that's required is the creation of a bunch of symlinks in users' home folders.
Except that there's no single place for programs to store their configuration. The dot-files and dot-directories are all over the user's home directory. You can't symlink all of them since you don't necessarily have an exhaustive list of the programs your users will have on their machines. It's perfectly acceptable to store files directly in $HOME, so symlinking the Desktop and Documents directories won't work either. You could have local home directories for config and a separate network share for files, but many programs default to $HOME in file chooser dialogs, so someone is bound to save an important file locally and then wonder why it isn't available on another machine.
And what about per-machine configuration in an environment where the same user might be using a laptop and a desktop for example? Most programs don't separate per-machine and global settings to different files, so symlinks aren't going to work. If you store the config files locally, users will have to manually sync them to different machines. If you store them in a network share, video and audio settings will be wrong.
We can dream about a perfect world with pretty APIs and detailed specifications all we want, but reality is crap and we have to deal with it.