Windows is as bad as Linux, leftovers everywhere without any sense whatsoever. Some company use a directory, other use another, makes no sense.
On Linux, at least there is some kind of uniformity but since all apps install with sudo permissions, they get put everywhere and you never really know where.
On macos, you got 2 folders to look for, all in the user directory (app, application support) and that's it.
I think I know what you're talking about. There are likely files inside the ~/Library/Application Support/ or ~/Library/Caches/ folders for example.
What is the proper, Apple way to make sure these get deleted when we delete apps? Because I fear there is no universal solution here. There are some files that an app creates that some of the time I would probably want to persist uninstalls. But then these files should be in a user home directory, not in application support according to XDG, right? I feel like the OS should detect dragging of an app to the trash can and clean up its app support folders? I don't think it does this today but I think it should.
KDE's Discover after you uninstall a flatpak application shows small infobar (still really easy to miss) saying "appname is not installed but it still has data present." with "Delete settings and user data" button.
But then, all sort of software even on Windows leaves some kind of traces of own presence.
In a perfect world we'd have a standardized application uninstall procedure - either by dropping icon on trash (which is something still many people do - especially on Windows) or by bringing similar to mobile solution with "x" on longer click. All of this controllable by options for advanced users including optional configuration and cache files removal.
But if you know to do this you know that these things are stored where they are under Libraries.
Just because some Windows uninstaller are bad doesn't mean that all of them are bad, or that uninstaller concept is bad.
Now I'd welcome for operating system to be built in a way to let user to delete everything related to the application. Maybe android or ios are built this way, but not macos.
My AppData disagrees with you.
https://github.com/Klocman/Bulk-Crap-Uninstaller
The nice thing about Windows is that people have been writing software for it for decades. A very underestimated advantage.
AppZapper has been doing the same thing on Macs for decades.
However people around here hate sandboxing on their OSes.
This is one of the many issues my side project is designed to address. Imagine if installing every application meant just dropping it on the computer. The software 'package' was just a list of data objects the comprised all the files, config settings, etc. Needed to run the app. All these objects would be copied to the storage drive(s).
Imagine further, that the operating system did not have a central registry. Instead, all configuration was managed via a set of configuration objects, spread all over (preferably in the app folders). The configuration manager was just a program that could find every configuration object and make them appear to the user (and the OS) like they were in a unified file.
If a configuration object was copied anywhere in the system, it looked like its contents were just appended to the configuration store. If you deleted an object, all its settings just disappeared.
Uninstalling an application would mean just deleting all the objects in its package. The files would be gone and any configuration settings with them.
This is just one of the features my 'file system replacement' project is designed to handle.
Applications developers of the world. Please always make "keep configuration" an option with your uninstallers! I don't like the mobilification of PCs. For example, because of some issues, I wanted to try a different version of Thunderbird. I had the Snap version. Uninstalling it meant losing all its mails. I wasn't expecting that. Like at all!
Raycast has a built-in uninstaller as well.
AppCleaner still works fine for me in Sequoia.
There is Mac Cleaner https://freemacsoft.net/appcleaner/ which does a good job of removing preferences as well as the application.