one file mods or multi file mods?

BlitzMax Forums/BlitzMax Programming/one file mods or multi file mods?

Nate the Great(Posted 2009) [#1]
ok so if I am writing a module, should I compile the final module into one bmx file before releasing or leave it nice and organized in 10-20 little files?


plash(Posted 2009) [#2]
That depends. How are you organizing the code?


Brucey(Posted 2009) [#3]
It doesn't matter.

No-one need know (or care) how your files are laid out.

You will have an API for your module, which you want to keep fairly static over releases. But that's about all you need to worry about really. How many files you use is not important.

Well, assuming you are intending on documenting your API of course - if you use bbdoc comments, your documentation will be generated into an HTML help file available in the Help -> Third Party Modules section.
If you aren't intending documenting your API... on your own head be it :-p


Brucey(Posted 2009) [#4]
For examples of thoroughly documented modules, I would suggest taking a look at : BaH.Cairo, BaH.Datetime, BaH.Libcurl or BaH.Libxml. (Well, okay... any of mine really)

Some folks don't care for documentation, but given the amount of grief BRL get for not documenting the official mods very well, one might think it's a reasonably important part of what makes a module okay or great.

But, I digress....


Nate the Great(Posted 2009) [#5]
ok thanks brucey. I will certainly document my files..

so I just wanted my engine to be very customizable and easy to hack little features you want. so do blitzers in general prefer one big file or many little files, or a balance?


TaskMaster(Posted 2009) [#6]
Users want to code that is easy to get a grasp on, well documented and commented, so they can get the most out of it as easily and quickly as possible. If you feel that it is easier to understand and use as multiple files, then that is the way it should be.

I personally like multiple small files, if the division into many files makes sense.


Gabriel(Posted 2009) [#7]
Unless there's a very good reason, I like one file per Type. A very good reason might be a very small type which is used only by a larger type in a file, in which case putting the small one in the same file makes a lot of sense.


Nate the Great(Posted 2009) [#8]
@gabriel ok thanks thats exactly what I thought, the code was even confusing to me when it was one big file but now things flow so much smoother with many small files... ~1 per type


plash(Posted 2009) [#9]
I prefer groupings of similar/helper types in single files (the duct module group is a good example of how I prefer to order things).


Nate the Great(Posted 2009) [#10]
ok thanks its good to be confident people will like the way an engine is organized because I have seen so many I just can't understand because they have 500 10-20 line bmx files! its just a headache, and equally annoying when trying to sift through one 100 page file.