# Any guides on designing an interface?

**URL:** <https://discourse.julialang.org/t/any-guides-on-designing-an-interface/77173>\
**Category:** Offtopic\
**Tags:** question, design, interface\
**Created:** [February 28, 2022, 8:30am UTC](https://discourse.julialang.org/t/any-guides-on-designing-an-interface/77173 "2022-02-28T08:30:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [February 28, 2022, 8:30am UTC](https://discourse.julialang.org/t/any-guides-on-designing-an-interface/77173/1 "2022-02-28T08:30:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Roger-luo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/roger-luo/32/3399_2.png) [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Post date:** [March 5, 2022, 4:16pm UTC](https://discourse.julialang.org/t/any-guides-on-designing-an-interface/77173/2 "2022-03-05T16:16:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [March 5, 2022, 5:49pm UTC](https://discourse.julialang.org/t/any-guides-on-designing-an-interface/77173/3 "2022-03-05T17:49:52Z")

</div>

Thanks! Some great points

---

<div class="post-metadata">

**Author:** ![jar1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jar1](https://discourse.julialang.org/u/jar1)\
**Post date:** [March 5, 2022, 7:37pm UTC](https://discourse.julialang.org/t/any-guides-on-designing-an-interface/77173/4 "2022-03-05T19:37:36Z")

</div>

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.

- [“Functional core, imperative shell”](https://www.destroyallsoftware.com/screencasts/catalog/functional-core-imperative-shell)

- [“Denotational design”](https://www.youtube.com/watch?v=bmKYiUOEo2A)

- a counterpoint “[Denotational design does not work](https://ro-che.info/articles/2014-12-31-denotational-design-does-not-work)”

- [How to Design Programs](https://htdp.org/2022-2-9/Book/part_preface.html)
