Understanding the structure of projects

Hi! This is my second super-newbie question, I hope you’re so kind to help me since this will be quite a broad one.
A little background:
I’m at my first year (of probably 5) of a CS degree and I have been programming for a few months in Java; never seen code before. Then I discovered this language like few weeks ago since I would like to do anything related to Mathematics and Scientific Computing in the future. I learned a good part of the syntax and stuff through ThinkJulia and similar resources. Therefore I’ve no particular background in this field.
The problem:
I’d like to create some projects, like the ones from “Julia programming projects”, or simple apps, or in general pieces of organized code that I can publish on github etc. In other words, I’m learning how to program (really, not just exercises on syntax) for the first time with this language.
However, I have no idea how projects are structured, with which criteria I should create src, test, utils, assets and those kind of folders and what they should do specifically and how they should relate to each other. I know almost nothing about this. Therefore, when I read the docs of Pkg, which are involved in creating these “projects”, I don’t have the background which is assumed to know when you read such stuff.
My question:
Where I can find some resources about this? There is a guide or book on how to structure a project? How should an average Julia project look like? What is the smoothest path in order to be able to understand such docs?

I know they are broad questions, but I hope you could give me some insights for this huge amount of information I should learn in my journey to become a computer scientist (I hope).
Thanks again!

1 Like

Welcome.

Have a look at the following thread for instance Generating a package with PkgTemplate for existing code - #15 by ffevotte
This package might be the answer to your question: GitHub - tpapp/PkgSkeleton.jl: Generate Julia package skeletons using a simple template system

2 Likes

The real answer is that they can be structured pretty much however you want. But there is somewhat of a “standard” structure which can be seen by looking at almost any Julia package.

For this structure, the src folder should contain the code that implements whatever functionality you want. The inside of the src folder can look pretty much however you like but you do need to have a top-level file that defines the module. That file would look something like

module YourModule
# here you "using" the packages that your code needs, such as
using Statistics, Dates

# you can also "include" the other files inside your src folder, such as
include("utilityfunctions.jl")
end

My suggestion would be to actually ignore this for now. Just work on writing code that does what you want. Ignore the stuff about environments, registries, etc. Start with a script that does what you want.

2 Likes

There is nice intro with lots of details: Developing Julia Packages - Stochastic Lifestyle

2 Likes

In case you are not only interested in creating a julia package, but really also just in principle in how to organize a (scientific/programming/…) project, then you might want to check out the DrWatson.jl package (and its documentation):

For an example how such projects could be structured, see for example here

4 Likes

Here I am! I’m sorry If I’m replying a bit late to you all.
First, thanks to everyone who has answered my question.
In particular @Skoffer, I’ve just finished watching this video and it was exactly what I needed in order to get started.
@zierenberg I would also look after what you suggested me! At the moment though I need to digest all the information I received already.
Thanks again to everyone!

1 Like