How to properly use Structs in Julia?

Hi,

I’m using Julia about 6 months by now and I never understood Structs well.

Before Julia I used to code in Processing, and OOP in Julia seems so different that I don’t even know how methods and objects work and how to write them.

I tried to read the documentation but couldn’t make sense of anything! (those types and functions declarations seems too messy for me)

Can anyone make a concise and short explanation of how Structs work?

Thanks!

Take a look at this thread. If you are used to OOP, it may help: Is Julia's way of OOP superior to C++/Python? Why Julia doesn't use class-based OOP? - #10 by lmiq

(I linked directly my answer there because, while very basic relatively to the depth of the discussion, may be a more direct answer to your question)

5 Likes

Your explanation is very good!

Thanks!