# Wrapper functions guidlines

**URL:** <https://discourse.julialang.org/t/wrapper-functions-guidlines/27387>\
**Category:** General Usage\
**Tags:** question, type\
**Created:** [August 10, 2019, 11:01am UTC](https://discourse.julialang.org/t/wrapper-functions-guidlines/27387 "2019-08-10T11:01:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [August 10, 2019, 11:30am UTC](https://discourse.julialang.org/t/wrapper-functions-guidlines/27387/2 "2019-08-10T11:30:31Z")

</div>

1. Same as for writing efficient code in general. Start with [Performance Tips · The Julia Language](https://docs.julialang.org/en/v1/manual/performance-tips/#man-performance-tips-1)

2. No, an `if ... elseif ... else ... end` branch inside the function has nothing to do with methods, it is just a branch. May be fine, but can also be less flexible if you need to extend it. Various other design patterns are possible, see [Methods · The Julia Language](https://docs.julialang.org/en/v1/manual/methods/#Design-Patterns-with-Parametric-Methods-1)

3. `outer(args...) = inner(args...)`

4. `const zerosM = zeros`

5. just throw an error, eg

Hope this helps. However, from your questions it looks like you are just learning Julia. Consider just using it _as is_, instead of tailoring it to resemble Matlab.

---

_[View the full topic](https://discourse.julialang.org/t/wrapper-functions-guidlines/27387)._
