I sometimes read things like how the Pkg.jl developers have thought long about how the API/Interface should look. The problem seems clear: “Make a useful interface”, but I don’t have any clue on how it can be approached. Anyone here who has some insights into interface design and how to approach it? How to choose the right balance between allowing many different things but not being overly unusable due to being overly generic.
Just my two cents
-
hierarchical interface is the solution to have both being generic/powerful/flexibile and easy to use. Split your interface to different modules, and let user decide which level they want
-
be concrete on things, collect use cases and try to write them with your design proposal, make sure at least every use cases collected are very easy to implement with the interface. Those not covered by the use cases you collect can be ignore at this stage to simplify the development
-
keep open to and don’t be afraid of refactoring. When more use cases appears from user side, this always has to happen. And every time a refactor happens it will improve the entire design.
Refactoring is actually much easier in Julia than in Python btw this is one of my favorite part of Julia.
Thanks! Some great points
How to design programs is an area full of debate and uncertainty, so I think such guides are useful for offering ideas to consider rather than follow dogmatically. Here are a few interesting ones.