# Organizing code into functions—am I doing it right?

**URL:** <https://discourse.julialang.org/t/organizing-code-into-functions-am-i-doing-it-right/35228>\
**Category:** General Usage\
**Tags:** functions, code-organization\
**Created:** [February 27, 2020, 12:44pm UTC](https://discourse.julialang.org/t/organizing-code-into-functions-am-i-doing-it-right/35228 "2020-02-27T12:44:37Z")\
**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:** [February 27, 2020, 1:04pm UTC](https://discourse.julialang.org/t/organizing-code-into-functions-am-i-doing-it-right/35228/2 "2020-02-27T13:04:54Z")

</div>

> [@ElectronicTeaCup](#):
>
> does it make sense to make subfunctions that will only be used in this one function?

That’s a matter of personal preference, but writing small kernel functions is a technique very well suited to Julia (because of parametric multiple dispatch, the way the compiler works, and unit testing when applicable).

> [@ElectronicTeaCup](#):
>
> nd if I do make a subfunction, do I add it to this function the same way as stated?:

I am not sure what you mean here, stated where?

In any case, please

1. use quoted blocks, not screenshots,
2. provide an MWE,
3. include Julia code instead of Python code.

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

_[View the full topic](https://discourse.julialang.org/t/organizing-code-into-functions-am-i-doing-it-right/35228)._
