# Designing APIs. defining new methods versus passing in functions

**URL:** <https://discourse.julialang.org/t/designing-apis-defining-new-methods-versus-passing-in-functions/18699>\
**Category:** General Usage\
**Tags:** design\
**Created:** [December 15, 2018, 9:00pm UTC](https://discourse.julialang.org/t/designing-apis-defining-new-methods-versus-passing-in-functions/18699 "2018-12-15T21:00:33Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![ssfrr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ssfrr/32/3736_2.png) [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Post date:** [December 17, 2018, 1:55pm UTC](https://discourse.julialang.org/t/designing-apis-defining-new-methods-versus-passing-in-functions/18699/11 "2018-12-17T13:55:16Z")

</div>

> [@bennedich](#):
>
> Or did you mean to do something similar to @Elrod’s example of reusing the same memory?

Re-using the memory. I’m not trying to get too into the weeds on this, just making the point that simple wrapper types used just for dispatch behavior are often zero-overhead, but I even so they’re often not the right API choice if there’s something simpler available. Julia’s type system is very expressive, I often get [nerd-sniped](https://www.xkcd.com/356/) into using it even when there’s a more direct way.

---

_[View the full topic](https://discourse.julialang.org/t/designing-apis-defining-new-methods-versus-passing-in-functions/18699)._
