Resources for creating first package

Hi everyone,

I have been reading the message boards for some time now and it seems like the people in the community are quite friendly, so I thought I might get more involved.

I have some Julia code that I want to convert into a package. However, I am an economist and many of us write code that is fit for purpose, normally with teaching or research in mind. My code is written mostly as a composition of different functions. I have not written the code to specifically utilize the type system in Julia. In other words, I have not created my own types and utilized structs, etc.

My understanding of the type system is relatively solid, but I am almost afraid to create my own. This fear probably stems from the fact that there are these professionals who are going to call you out on the fact that you have no idea what you are doing. There are so many talented people on here using this language, it feels like it is going to take me forever to catch up! I know this speaks to the notion of the ‘genius programmer’ and most package ecosystems are a team effort, but it really is a difficult mental hurdle to overcome.

I am currently reading the Hands-On Design Patterns book by Tom Kwong, which I have found to be excellent. Is anyone aware of any more resources that could help me to understand how to go about programming in a more Julian way? Maybe even some advice on what they did to get started? I am also going through the documentation when I have the time, but there is so much information to take in.

I have also found a guide by Chris Rackauckas on developing packages. However, that speaks more toward the actual creation of the package once the code is ready to go (if I understand it correctly).

Please let me know if I am not being clear enough or if this question has been asked before.

Dawie

2 Likes

I hope nobody is going to call anybody out on something like that. Sometimes people will suggest alternatives to what you wrote if they think there are more elegant, efficient, extensible, … approaches or they need something slightly different themselves.

You don’t need to create your own types at all for good Julia code, you would already be creating them if you really needed them. Function composition sounds like a great way to build a package. A desirable thing in Julia is to allow for type flexibility wherever it’s sensible, so that means writing functions so generically that they work with all Numbers, not just Float64, etc. But that is pretty difficult to get right from the start.

3 Likes

Nobody will call you out. In my own expierience – I only learned how the type system actually works (or I hope I have understood that by now) when developing my first own package – and looking from now my first questions (sure they are still available here) are not that clever. But even there, I only got a lot of help and encouragement :slight_smile:

When you have a first version (registered and) ready, you can also announce it here on the board and ask for feedback / improvements. As far as I experienced, many take a look; I even ended up doing more packages based on announcing my first package here.

2 Likes

Good to know that not everyone gets it right from the start!

Didn’t mean to imply that one will definitely get called out. It seems like the best way to learn here might then to just publish the package and get feedback from the community.

Thanks for the reply!

Thanks, it helps to know that other people also struggled a bit at the start. I will try and finish up the package and then announce on the board. I saw people announcing the packages, but for some reason didn’t realize it was a mechanism to receive feedback.

2 Likes