Details, starting with documents:
I usually know what the thing I'm looking for is called, so hierarchy gets in the way more than it helps.
My documents live in[1] ~/nextcloud/, organized in a flat structure by project, with 3 exceptions, where I add one more level of hierarchy:
1. There is also a folder called `Archive` (the only capitalized folder, to avoid accidental autocompletion), where I move old, inactive projects — this keeps the flat list from getting too large to navigate (the Archive folder becomes harder to navigate, but I seldom open it so that doesn't matter).
2. When a large number of projects (significant % of total folders) fall under the same umbrella. So far this has only applied to school. Inside my `school` folder, the classes themselves were still organized in a flat structure by course dept-number (eg, comp115, ec6), rather than by semester. Another separate folder with the same structure for high school; both are currently archived.
3. When it makes sense to use a different organizational method. Again, just one case where this applies: job applications, which are organized flatly by year-quarter-company (all in the file name).
[1] synced between my computers using nextcloud, as you may have guessed. Nextcloud doesn't mandate this and previously I used ~/Documents, but I prefer lowercase folder names — caps are more work to type in the terminal.
---
My code uses a very similar system but with fewer exceptions:
Repos that I contribute code to (mine or I forked them) live in ~/dev/
Repos that I am using as-is (I wanted to build and use a tool, wanted to be able to `git grep` instead of using github/gitlab search, etc) or that I touch very infrequently (eg, fdroiddata) live in ~/repos/. This is kind of equivalent to my archive folder.