Use of packages in bigger programs

I’m thinking of converting over a thing I’ve been working on in c++ to odin.
In C++ I have a number of sub-namespaces for different parts of the software. I could create packages in odin for the same purpose but I seem to remember reading somewhere that wasn’t the recommended use of packages and they should only really be used to namespace entire separate libraries that have a separate existance.

I can’t find any reference to that though. Did I image it? What is considered the best practice for packages?

Feel free to organize them however you desire.

I do it precisely the same way I organized Go modules, and it works great.

Other people prefer having all their code in a single file, or hundreds of files in a single directory.

Whatever works for you!

I don’t have much experience with Odin yet, but I think that the reason that it’s recommend to put everything in the same package is that Odin doesn’t allow cyclic dependencies between packages. That means that you cannot import something into package B from package A, if package A already imports something from package B.

No you didn’t image it. It’s said a lot when people bring this up in the Discord, and I image Bill’s said in videos & on twitter too.

“Best practice” is just what gets recommended. Keeps things as flat as possible, only pulling out when needed. Don’t use packages as names spaces nor to taxonomize, treat them as separate libraries.