Cubyz icon indicating copy to clipboard operation
Cubyz copied to clipboard

Should files like network.zig be moved into the folder of the same name?

Open Vinywar123 opened this issue 3 weeks ago • 2 comments

like how server.zig is in server move Network.zig into the network folder Organization

Vinywar123 avatar Dec 05 '25 04:12 Vinywar123

Note this also applies to items.zig, renderer.zig and utils.zig

Right now to be honest I'm not sure which way of organization is better, which is why I have switched between both options multiple times.

Could you please provide more of your thought process of why you prefer this over the alternative?

IntegratedQuantum avatar Dec 06 '25 11:12 IntegratedQuantum

I prefer the approach where the main file resides in the root directory, while all components and child files are placed in their corresponding subdirectories. This allows, in a sense, replicating the nesting structure of modules as files in the filesystem. For example, network.protocols would be located at network/protocols.zig. I use this in my project.

If we adopt the proposed approach, importing network/network.zig seems unnecessarily redundant and looks odd.

bagggage avatar Dec 08 '25 15:12 bagggage