# Best practice for script with ARGS that can also be run with \`include\`

**URL:** <https://discourse.julialang.org/t/best-practice-for-script-with-args-that-can-also-be-run-with-include/74435>\
**Category:** General Usage\
**Tags:** question, workflow, code-organization\
**Created:** [January 11, 2022, 9:31pm UTC](https://discourse.julialang.org/t/best-practice-for-script-with-args-that-can-also-be-run-with-include/74435 "2022-01-11T21:31:22Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 12, 2022, 12:58pm UTC](https://discourse.julialang.org/t/best-practice-for-script-with-args-that-can-also-be-run-with-include/74435/3 "2022-01-12T12:58:01Z")

</div>

> [@goerz](#):
>
> Does this look like a good pattern?

In the long run, it’s far better to write functions with arguments as parameters than scripts.with global arguments for any code you want to re-use. (You can still use scripts — just put the script in a short file that uses/includes your other code and passes `ARGS` as function parameters.)

See also [Best practise: organising code in Julia - #2 by stevengj](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362/2) and [Best practise: organising code in Julia - #4 by stevengj](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362/4)

---

_[View the full topic](https://discourse.julialang.org/t/best-practice-for-script-with-args-that-can-also-be-run-with-include/74435)._
