by vaughan · 3y ago · 0 comments
We really shouldn't ever have to think about where to put things.
Each function should be stored in its own text file.
Then these files are indexed in a database.
Then they can be tagged: manually or by parsing its AST / types.
Then using the tags you can organize the code any way you want.
Better yet, maintain a dependency graph to see all callers and callees, and view code like that.
Even better yet, instrument your code, and at runtime let the stack trace determine the organization of your code in your editor.
Some problems I can see though is that humans seem to like things to belong in one place. That's why folders win over tags usually. But...your existing folder/file structure of code is simply one "view" from the database. Some people use module names, some people use file types (components, helpers, etc.)
Existing IDE's and text editors (and runtimes) are holding us back!
Prior art: SmallTalk Browser, Intentional Programming, Literal Programming.
It's so much easier to just see a directory structure which reflects the module structure of your project and be able to quickly open any file in any tool and not just in the IDE of your chosen programming language.
You describe solutions for specific problems a programmer has from time to time (and some implementations that aren't relevant to anything), but we don't think like that. Not about programming, nor about writing prose or conducting experiments. We don't need arbitrary flexibility, but support that matches our cognitive make-up. Many memorization techniques rely on location, probably because we're hard-wired for that. So folder structures probably work better than tags.
We forget tags. I've seen it happen. Our system supports tags in certain contexts, and now the same tag is there in multiple variations, just because people couldn't remember it was there or what is was called, and there is only a handful of them. Now imagine a system that has tens of thousands of tags...
IDE's aren't allowing us to use our full potential, but the path towards that is not logical and straightforward.
Works for me with email, too.
Mutually-exclusive folders for-the-lose. Wellll…for my usage, anyway.