In C#, the questions of what types to create, what members they should have, and what namespaces should hold them, are questions of OO design. They are not the questions I'm interested in here.
Instead, I want to ask how you store these in disk artifacts. Here are some example rules:
Put all of an assembly's types in a single source file. One friend who did this said "files are an archiac code organization tool; today I use classview and Collapse to Definitions to browse my code".
Put all your code in one assembly. Makes deployment & versioning simpler.
Directory structure reflects namespace structure.
Each namespace gets its own assembly.
Each type goes in its own assembly. (Listed as an extreme example.)
Each type gets its own source file.
Each member gets its own file; each type gets its own directory. (Listed as an extreme example.)
Writing to a file (fprintf or fputs)
A FILE is a type of structure typedef as FILE. It is considered as opaque data type as its implementation is hidden. We don't know what constitutes the type, we only use pointer to the type and library knows the internal of the type and can use the data. Definition of FILE is in stdio although it is system specific.
Whatever you do, just PLEASE do it consistently. I don't believe there is any one single answer (though there are a few wrong ones). But just make sure you stay true to your form as this will be the key for your successor(s) to find things easily.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With