# Workflow for codes with several .jl

**URL:** <https://discourse.julialang.org/t/workflow-for-codes-with-several-jl/81395>\
**Category:** New to Julia\
**Created:** [May 20, 2022, 8:40pm UTC](https://discourse.julialang.org/t/workflow-for-codes-with-several-jl/81395 "2022-05-20T20:40:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Veenty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/veenty/32/50940_2.png) [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Post date:** [May 20, 2022, 8:40pm UTC](https://discourse.julialang.org/t/workflow-for-codes-with-several-jl/81395/1 "2022-05-20T20:40:33Z")

</div>

So I’m used to the python framework where I create a folder and in there I have several scripts that all do several simple things. So I would expect that I could do something like this in Julia. Like  
simple\_modules.jl  
simple\_functions.jl  
not\_that\_simple\_functions.jl

And then have one main.jl that call all of them.

The way that I was doing it right now was just to do

```julia
push!(LOAD_PATH, ".")
simple_modules
simple_functions
not_that_simple_functions

```

So I’m not creating a Project.toml  
I tried to look into some other files projects in github and it seems that they use include more than using?  
I don’t really see why should I use include or using in this context. Also not sure if when creating a project I should include this little .jl in the Project.toml even though this files are part of the developing project.

I’ve read the guidance of Pkg.jl and the simple case that I’m writing here is not at all cover.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [May 20, 2022, 8:54pm UTC](https://discourse.julialang.org/t/workflow-for-codes-with-several-jl/81395/2 "2022-05-20T20:54:36Z")

</div>

`include` is like copying/pasting the code into the script, so if your files contain the functions directly, you need to do, for instance:

```julia
include("simple_functions.jl")

result = simple_function1(input)

```

The first line makes the function available, the second line executes it.

If the file contains a module, then you need load the module. For instance, if we have `mod.jl` with:

```julia
module Mod
    export f
    f(x) = x + 1
end

```

you can do:

```julia
julia> include("./mod.jl")
Main.Mod

julia> using .Mod

julia> f(2)
3

```

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [May 20, 2022, 9:24pm UTC](https://discourse.julialang.org/t/workflow-for-codes-with-several-jl/81395/3 "2022-05-20T21:24:41Z")

</div>

When you look at Packages in GitHub you will see the pattern

```julia
module Module

include("file1.jl")
include("file2.jl")
include("file3.jl")

end

```

used as a file organisation technique

e.g.

> <https://github.com/JuliaDatabases/ODBC.jl/blob/main/src/ODBC.jl>
