# Is it proper practice to have a main method

**URL:** https://discourse.julialang.org/t/is-it-proper-practice-to-have-a-main-method/46787
**Category:** New to Julia
**Created:** [September 17, 2020, 3:51pm UTC](https://discourse.julialang.org/t/is-it-proper-practice-to-have-a-main-method/46787 "2020-09-17T15:51:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![anon60034542](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@anon60034542](https://discourse.julialang.org/u/anon60034542)
#### Post date: [September 17, 2020, 3:51pm UTC](https://discourse.julialang.org/t/is-it-proper-practice-to-have-a-main-method/46787/1 "2020-09-17T15:51:40Z")

</div>

I’m learning Julia, and right now I’m only working with one file, let’s call it `main.jl`. Is it proper practice to include a main method, as outlined [here](https://stackoverflow.com/questions/35386265/init-or-main-function-in-julia)?

I found [this](https://discourse.julialang.org/t/where-do-you-put-your-main-function-in-your-projects/28026) thread from last year, but for simple introduction level projects, would a simple main method be sufficient?

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [September 17, 2020, 4:07pm UTC](https://discourse.julialang.org/t/is-it-proper-practice-to-have-a-main-method/46787/2 "2020-09-17T16:07:21Z")

</div>

Generally the function `main` is intended for programs which will be run as an executable or script, so if that’s what you’re building, I’d say it makes sense (that’s usually how I create scripts in Julia too). Otherwise, if you’re writing a package to be a library, `main` doesn’t make sense.
