# \#code-organization

**URL:** https://discourse.julialang.org/tag/code-organization/918.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [How to organize modules in a composable way?](https://discourse.julialang.org/t/how-to-organize-modules-in-a-composable-way/134536)

<div class="topic-metadata">

**Author:** [@mj2984](https://discourse.julialang.org/u/mj2984)\
**Replies:** 6\
**Last updated:** [December 16, 2025, 7:46am UTC](https://discourse.julialang.org/t/how-to-organize-modules-in-a-composable-way/134536 "2025-12-16T07:46:04Z")

</div>

Suppose I have a module module\_init that defines a type init\_struct, and I am now trying to make multiple modules in different projects that build on top of this init\_struct. For example ./project\_init/src/module\_init.j…

---

## [How to divide a project into files and submodules?](https://discourse.julialang.org/t/how-to-divide-a-project-into-files-and-submodules/131593)

<div class="topic-metadata">

**Author:** [@Snowy](https://discourse.julialang.org/u/Snowy)\
**Replies:** 5\
**Last updated:** [August 14, 2025, 5:42pm UTC](https://discourse.julialang.org/t/how-to-divide-a-project-into-files-and-submodules/131593 "2025-08-14T17:42:26Z")

</div>

Thanks, this seems like probably a little more of an elegant solution. If working on a large project, is the best solution here to create a module with defined structs then include them in other appropriate modules?

---

## [Load subfolder in src like in python](https://discourse.julialang.org/t/load-subfolder-in-src-like-in-python/131609)

<div class="topic-metadata">

**Author:** [@Cyan](https://discourse.julialang.org/u/Cyan)\
**Replies:** 4\
**Last updated:** [August 14, 2025, 5:33pm UTC](https://discourse.julialang.org/t/load-subfolder-in-src-like-in-python/131609 "2025-08-14T17:33:42Z")

</div>

Hi, all. I am wondering how I can load a folder as a submodule in Julia, similar to how it is done in Python. For example, I want to load the modules in SubModuleA in the form of MyPackage.SubModuleA.file\_a\_1 and MyPack…

---

## [Intermediate Development Workflow](https://discourse.julialang.org/t/intermediate-development-workflow/128903)

<div class="topic-metadata">

**Author:** [@stevenhughes](https://discourse.julialang.org/u/stevenhughes)\
**Replies:** 8\
**Last updated:** [May 17, 2025, 1:53pm UTC](https://discourse.julialang.org/t/intermediate-development-workflow/128903 "2025-05-17T13:53:30Z")

</div>

Hi Everyone, I am relatively new to Julia, I’ve been using it for a few months. In the first month, I was able to write several thousand lines of code and solve some problems that took far longer in other languages. I…

---

## [About module importation](https://discourse.julialang.org/t/about-module-importation/127164)

<div class="topic-metadata">

**Author:** [@Gesee](https://discourse.julialang.org/u/Gesee)\
**Replies:** 5\
**Last updated:** [March 20, 2025, 10:40pm UTC](https://discourse.julialang.org/t/about-module-importation/127164 "2025-03-20T22:40:17Z")

</div>

If I have a module A importing a package B and a module C importing the package B, How can do to import the module B only one time so that module A and module C can use it

---

## [Where to put export statements (Sub-Module Pattern) in distributed code?](https://discourse.julialang.org/t/where-to-put-export-statements-sub-module-pattern-in-distributed-code/125871)

<div class="topic-metadata">

**Author:** [@gwr](https://discourse.julialang.org/u/gwr)\
**Replies:** 2\
**Last updated:** [February 13, 2025, 7:26pm UTC](https://discourse.julialang.org/t/where-to-put-export-statements-sub-module-pattern-in-distributed-code/125871 "2025-02-13T19:26:42Z")

</div>

I am working through Tom Kwong’s book "Hands-On Design Patterns and Best Practices with Julia." In Chapter 7 on Maintainability Patterns, Tom talks about organizing code (sub-module pattern) and gives an example where a …

---

## [Understanding Julia Environments - Project Environment and Package Directory](https://discourse.julialang.org/t/understanding-julia-environments-project-environment-and-package-directory/122082)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 9\
**Last updated:** [November 1, 2024, 2:59pm UTC](https://discourse.julialang.org/t/understanding-julia-environments-project-environment-and-package-directory/122082 "2024-11-01T14:59:13Z")

</div>

I am trying to understand this documentation page which is related to code loading in Julia. Under the Environment section, there are two types of environment listed. Project Environment Package Directory I don’t u…

---

## [Multiple Julia processes while using Modules](https://discourse.julialang.org/t/multiple-julia-processes-while-using-modules/75071)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 6\
**Last updated:** [October 26, 2024, 9:32am UTC](https://discourse.julialang.org/t/multiple-julia-processes-while-using-modules/75071 "2024-10-26T09:32:10Z")

</div>

Hi Following my discussion from the below thread, I have been trying out 2 approaches to evaluate Julia project organisation approaches. Creating files as modules and “using” them in other files Creating them as ind…

---

## [Best practise: organising code in Julia](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 11\
**Last updated:** [October 26, 2024, 9:13am UTC](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362 "2024-10-26T09:13:55Z")

</div>

Hi A newbie here, from OOP background. I am looking to put together a project which will: Download data from Internet Do some manipulations on the downloaded data Do some analysis on the downloaded data Please note t…

---

## [What is the preferred way to use multiple files?](https://discourse.julialang.org/t/what-is-the-preferred-way-to-use-multiple-files/30687)

<div class="topic-metadata">

**Author:** [@EvgeniyMist](https://discourse.julialang.org/u/EvgeniyMist)\
**Replies:** 15\
**Last updated:** [October 25, 2024, 3:06pm UTC](https://discourse.julialang.org/t/what-is-the-preferred-way-to-use-multiple-files/30687 "2024-10-25T15:06:59Z")

</div>

I wanted to structure my code by dividing it into several files. But I ran into some problem. So, in its simplest form, I have 3 files: main.jl module main include("structs.jl") include("functions.jl") first\_point =…

---

## [How to use local, relative modules (best practice, simple)?](https://discourse.julialang.org/t/how-to-use-local-relative-modules-best-practice-simple/81634)

<div class="topic-metadata">

**Author:** [@jakob1](https://discourse.julialang.org/u/jakob1)\
**Replies:** 15\
**Last updated:** [October 22, 2024, 9:56am UTC](https://discourse.julialang.org/t/how-to-use-local-relative-modules-best-practice-simple/81634 "2024-10-22T09:56:41Z")

</div>

Hi, Julia states to feel like a scripting language. Hence I would like to find out the most simple way to modularize (smaller) projects in julia. Here is a minimal example that worked for me after some research and tri…

---

## [I don't understand Julia. From running in the command line to workflow](https://discourse.julialang.org/t/i-dont-understand-julia-from-running-in-the-command-line-to-workflow/114235)

<div class="topic-metadata">

**Author:** [@Amnesian](https://discourse.julialang.org/u/Amnesian)\
**Replies:** 4\
**Last updated:** [May 14, 2024, 2:09pm UTC](https://discourse.julialang.org/t/i-dont-understand-julia-from-running-in-the-command-line-to-workflow/114235 "2024-05-14T14:09:10Z")

</div>

My code I’m coming from languages like C, python and mathematica (I only really use mathematica for some data handling and scripting) I have quite a few things I’m struggling with to be honest. The only way I know how…

---

## [Code Organization](https://discourse.julialang.org/t/code-organization/112314)

<div class="topic-metadata">

**Author:** [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Replies:** 20\
**Last updated:** [April 5, 2024, 1:24am UTC](https://discourse.julialang.org/t/code-organization/112314 "2024-04-05T01:24:39Z")

</div>

I’m having a really hard time finding a code structure that works for me. I’m building a pretty big library of interatomic potentials. I’ve broken the code up into several files: One for each of the following sets of t…

---

## [How to assist the LSP when it comes to function outputs, and Julia Language "Good Code"](https://discourse.julialang.org/t/how-to-assist-the-lsp-when-it-comes-to-function-outputs-and-julia-language-good-code/111770)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 1\
**Last updated:** [March 18, 2024, 2:57pm UTC](https://discourse.julialang.org/t/how-to-assist-the-lsp-when-it-comes-to-function-outputs-and-julia-language-good-code/111770 "2024-03-18T14:57:43Z")

</div>

One of the key features of an LSP is auto-completion based on the type. Suppose this code: struct Foo x y end Foo\_constructor(i) = Foo(i,i) a = Foo\_constructor(3) Now, the LSP does not recognize a as an object…

---

## [What is the right way to store/record the results of this nested simulation?](https://discourse.julialang.org/t/what-is-the-right-way-to-store-record-the-results-of-this-nested-simulation/107639)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 8\
**Last updated:** [December 15, 2023, 4:25pm UTC](https://discourse.julialang.org/t/what-is-the-right-way-to-store-record-the-results-of-this-nested-simulation/107639 "2023-12-15T16:25:49Z")

</div>

I wrote this after seeing the responses to my last question. From the responses I can tell my problem was not understood. What this simulation does is play a rudimentary “game” between pairs of two teams once per “week…

---

## [Best way to root a pipeline directory structure inside of a package](https://discourse.julialang.org/t/best-way-to-root-a-pipeline-directory-structure-inside-of-a-package/107275)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 9\
**Last updated:** [December 9, 2023, 7:44pm UTC](https://discourse.julialang.org/t/best-way-to-root-a-pipeline-directory-structure-inside-of-a-package/107275 "2023-12-09T19:44:15Z")

</div>

I’ve written some bioinformatics analysis scripts in julia. They are fast and impressed everyone! :heart\_eyes: Now I would like to share them with my collaborators. They act inside a pipeline that took many years to deve…

---

## [Turn a module into a package locally](https://discourse.julialang.org/t/turn-a-module-into-a-package-locally/37370)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 43\
**Last updated:** [December 7, 2023, 10:35pm UTC](https://discourse.julialang.org/t/turn-a-module-into-a-package-locally/37370 "2023-12-07T22:35:42Z")

</div>

This topic has been asked many times. I have read many posts. Much of the information is incomplete or contradictory. I have read the package manual. It uses the word “project” in 2 very different senses. So, let’s …

---

## [Code organization of a project with multiple simultaneously developed packages](https://discourse.julialang.org/t/code-organization-of-a-project-with-multiple-simultaneously-developed-packages/102447)

<div class="topic-metadata">

**Author:** [@Neodym](https://discourse.julialang.org/u/Neodym)\
**Replies:** 1\
**Last updated:** [August 3, 2023, 2:59pm UTC](https://discourse.julialang.org/t/code-organization-of-a-project-with-multiple-simultaneously-developed-packages/102447 "2023-08-03T14:59:48Z")

</div>

Hi, I’m developing a project that consists of multiple packages and some code that uses those packages. The packages will not be published in the Julia registry as it is a purely personal / learning project. Is there …

---

## [How can I structure a project in multiple modules and have code run in them?](https://discourse.julialang.org/t/how-can-i-structure-a-project-in-multiple-modules-and-have-code-run-in-them/100286)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 10\
**Last updated:** [June 15, 2023, 10:05am UTC](https://discourse.julialang.org/t/how-can-i-structure-a-project-in-multiple-modules-and-have-code-run-in-them/100286 "2023-06-15T10:05:51Z")

</div>

Hi all! Sorry this is probably noobish but I couldn’t figure it out easily from the docs/Google. I’m developing a small project for my thesis. I generated a project structure (src/, Project.toml and Manifest.toml), and …

---

## [How to add several subdirectories to LOAD\_PATH in startup.jl file?](https://discourse.julialang.org/t/how-to-add-several-subdirectories-to-load-path-in-startup-jl-file/34195)

<div class="topic-metadata">

**Author:** [@josimar](https://discourse.julialang.org/u/josimar)\
**Replies:** 13\
**Last updated:** [February 8, 2022, 10:28pm UTC](https://discourse.julialang.org/t/how-to-add-several-subdirectories-to-load-path-in-startup-jl-file/34195 "2022-02-08T22:28:40Z")

</div>

If I have several subdirectories within a main directory, how would I add it to LOAD\_PATH without having to type each of them individually ? Example: push!(LOAD\_PATH,"/mainDir/") ## This is what I want to do ## I do…

---

## [It Is fine to split your package into multiple sub-packages? And when should i do that?](https://discourse.julialang.org/t/it-is-fine-to-split-your-package-into-multiple-sub-packages-and-when-should-i-do-that/88776)

<div class="topic-metadata">

**Author:** [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)\
**Replies:** 3\
**Last updated:** [March 24, 2023, 12:08am UTC](https://discourse.julialang.org/t/it-is-fine-to-split-your-package-into-multiple-sub-packages-and-when-should-i-do-that/88776 "2023-03-24T00:08:10Z")

</div>

When i was writing Kotlin or Typescript, my way of organizing a project was to divide it into sub folders where each sub folder defines its own module, and the job of the main module was just to re-exports the sub-module…

---

## [Modular local projects and \`include(...)\`](https://discourse.julialang.org/t/modular-local-projects-and-include/95781)

<div class="topic-metadata">

**Author:** [@tgross35](https://discourse.julialang.org/u/tgross35)\
**Replies:** 8\
**Last updated:** [March 10, 2023, 2:59am UTC](https://discourse.julialang.org/t/modular-local-projects-and-include/95781 "2023-03-10T02:59:00Z")

</div>

Are local files/modules ever immediately importable with using , or is include always required? For example, with a structure like this: Project.toml src/ # Source for a local library \`MyLib\` MyLib.j…

---

## [Include files not showing function docstrings in VScode](https://discourse.julialang.org/t/include-files-not-showing-function-docstrings-in-vscode/94885)

<div class="topic-metadata">

**Author:** [@Droolia](https://discourse.julialang.org/u/Droolia)\
**Replies:** 5\
**Last updated:** [February 20, 2023, 5:53pm UTC](https://discourse.julialang.org/t/include-files-not-showing-function-docstrings-in-vscode/94885 "2023-02-20T17:53:55Z")

</div>

My goal is include the structs, functions, etc. of another .jl file into the new.jl. I have been using the include(“foo.jl”), it works but it doesn’t feel right. For example, my function docstrings do not appear in new.…

---

## [Function conflict with different signatures](https://discourse.julialang.org/t/function-conflict-with-different-signatures/88921)

<div class="topic-metadata">

**Author:** [@RockerM4NHUN](https://discourse.julialang.org/u/RockerM4NHUN)\
**Replies:** 5\
**Last updated:** [October 21, 2022, 8:10am UTC](https://discourse.julialang.org/t/function-conflict-with-different-signatures/88921 "2022-10-21T08:10:34Z")

</div>

Hi! I’m trying to organize a bigger project into multiple modules and I want to create function overloads specific to types found in those modules. Before all my code was in a single module and worked fine, but now my f…

---

## [Yet another code organization question](https://discourse.julialang.org/t/yet-another-code-organization-question/86707)

<div class="topic-metadata">

**Author:** [@welahi](https://discourse.julialang.org/u/welahi)\
**Replies:** 8\
**Last updated:** [September 2, 2022, 11:23pm UTC](https://discourse.julialang.org/t/yet-another-code-organization-question/86707 "2022-09-02T23:23:04Z")

</div>

Dear all, I’m new to Julia, so first of alle hello :slight\_smile: I’ve already searched for similar question, but couldn’t find any answer that would solve my specific question. Sorry if I’ve just overlooked it. So, l…

---

## [How to export modules / packages locally?](https://discourse.julialang.org/t/how-to-export-modules-packages-locally/86606)

<div class="topic-metadata">

**Author:** [@hamburger](https://discourse.julialang.org/u/hamburger)\
**Replies:** 10\
**Last updated:** [September 1, 2022, 8:01am UTC](https://discourse.julialang.org/t/how-to-export-modules-packages-locally/86606 "2022-09-01T08:01:50Z")

</div>

How to export modules / packages locally? Hello! I’ve been looking unsuccessfully at how to develop multiple distinct modules locally. My project has three parts: Two modules: TextManipulation, AstroPhysics One Julia…

---

## [Proper way of organizing code into subpackages](https://discourse.julialang.org/t/proper-way-of-organizing-code-into-subpackages/52835)

<div class="topic-metadata">

**Author:** [@fengkehh](https://discourse.julialang.org/u/fengkehh)\
**Replies:** 48\
**Last updated:** [August 24, 2022, 2:04pm UTC](https://discourse.julialang.org/t/proper-way-of-organizing-code-into-subpackages/52835 "2022-08-24T14:04:07Z")

</div>

Hi all, I am in the process of converting a fairly complicated proprietary simulation model that I wrote in Python to Julia 1.5.3. The code is broken into around 20 different sub packages on the file system by their pur…

---

## [Good guide to setting up a reproducible julia project?](https://discourse.julialang.org/t/good-guide-to-setting-up-a-reproducible-julia-project/85848)

<div class="topic-metadata">

**Author:** [@NHDaly](https://discourse.julialang.org/u/NHDaly)\
**Replies:** 12\
**Last updated:** [August 17, 2022, 12:35am UTC](https://discourse.julialang.org/t/good-guide-to-setting-up-a-reproducible-julia-project/85848 "2022-08-17T00:35:54Z")

</div>

Hello, I was looking for a good guide on how to set up a new julia project/application, so that it is reproducible, and stays up to date with its dependencies. My coworkers were setting up a new julia project, and I co…

---

## [Subject: Initializing file I/O so that code is agnostic to running locally/on cloud](https://discourse.julialang.org/t/subject-initializing-file-i-o-so-that-code-is-agnostic-to-running-locally-on-cloud/85769)

<div class="topic-metadata">

**Author:** [@Pablo](https://discourse.julialang.org/u/Pablo)\
**Replies:** 1\
**Last updated:** [August 15, 2022, 2:05pm UTC](https://discourse.julialang.org/t/subject-initializing-file-i-o-so-that-code-is-agnostic-to-running-locally-on-cloud/85769 "2022-08-15T14:05:15Z")

</div>

Hello, We are developing a Julia app, and we want to close the gap between running our code in development and production by making the bulk of our code agnostic to whether it’s running in either stage. We have already…

---

## [Storing functions for usage across files](https://discourse.julialang.org/t/storing-functions-for-usage-across-files/85723)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 8\
**Last updated:** [August 14, 2022, 2:00pm UTC](https://discourse.julialang.org/t/storing-functions-for-usage-across-files/85723 "2022-08-14T14:00:51Z")

</div>

I came from MATLAB and have enjoyed the migration to Julia. However, one thing that I liked about MATLAB was the ability to create a function and save that function in a directory, so that I could use it later in a poten…

[Next page](https://discourse.julialang.org/tag/code-organization/918.md?match_all_tags=true&page=1&tags%5B%5D=code-organization)
