(no title)
tomekowal | 10 years ago
I always thought about it like about dimensions.
1. "Logic/test dimension" I can have functions doing actual logic and for tests. Do I put it in one module (to make it easy to change both if I need to) or in separate module (to make business logic more easy to follow).
2. "Data structure dimension" I can have functions operating on different data structures like lists and sets.
3. "Operating dimension" I can have functions operating on "Enumerables". Do I put map in the Lists module or Enumberable? I need to know, where someone else put it when debugging. Database operating on meta data would solve that problem.
4. There can be metadata for time/space complexity, so I can easily make tradeoffs between functions that do the same thing in different ways.
5. "prod/stg/dev dimension" is another one. Maybe I want to use completely different logging mechanism for stg and prod, because I pay per logline...
6. "Quality dimension" could show, what is the code coverage for the function or if it follows naming conventions/practices.
7. "Popularity dimension" could show, how often is given function referenced, which would show most important functions and where to focus on optimizing.
Some of this problems are solved in different ways. IDEs can jump from function usage to its implementation. If you follow conventions, you can jump to a test code for given function. In Elixir, you can jump to protocol implementation. I can use inversion of control for switching implementations between environments. Those problems would have single solution, if there was a central database for functions.
There are many, many more dimensions and even relations between them.
No comments yet.