Page 1 of 1

What do you prefer: single or multiple files for the SDK?

Posted: 24 Jun 2011, 15:53
by gouxim
Hey fellow coders,

I was thinking about the futur of the SDK. For now it's one big file, for simplicity's sake. But I was wondering whether you guys prefered multiple files.

On the one hand, a single file is easy to integrate in your project, and to update. But it's a bit cumbersome to browse the code.

On the other hand, multiple files are nice because you can have one class per file, so you'll quickly browser the code. But it's a bit more complicated to update (well, not really, it's just a matter of updating a directory of files...).

Answer the poll !

Re: What do you prefer: single or multiple files for the SDK

Posted: 24 Jun 2011, 16:24
by w1lla
I dont mind to use one file or seperate files.

Its just a way for developers to code based on one file or seperate files.

However in the single file its better to understand the functions and you can just use one method to call the function. As for the multiple files it will be that you need to call the file call the function and export the output.

Re: What do you prefer: single or multiple files for the SDK

Posted: 24 Jun 2011, 17:18
by tcq
I'm not actively coding with it,but out of my experience it's usually easier if you have multiple files for the understanding of the code.

Re: What do you prefer: single or multiple files for the SDK

Posted: 25 Jun 2011, 04:11
by fastforza
Bad practice. I'd never store more than one class in a single file. The only exception to this would be inner classes. :ugeek:

Re: What do you prefer: single or multiple files for the SDK

Posted: 30 Jun 2011, 14:53
by gouxim
fastforza wrote:Bad practice. I'd never store more than one class in a single file. The only exception to this would be inner classes. :ugeek:
I generally agree. This is what we did in ManiaLib and ManiaLive, and all our internal codebase is like that too.

For the SDK, it's a bit different IMO. I see the SDK more as a DLL than as a project like ManiaLib ; therefore having one single file with the API is like having one DLL that you include in some project.

Re: What do you prefer: single or multiple files for the SDK

Posted: 01 Jul 2011, 06:03
by fastforza
gouxim wrote:This is what we did in ManiaLib and ManiaLive, and all our internal codebase is like that too.
The structure of ManiaLib was good, at least I think it was. I don't use it any more (I have my own framework in .NET) though, so I can only guess from previous versions I used. :ugeek:
gouxim wrote:For the SDK, it's a bit different IMO. I see the SDK more as a DLL than as a project like ManiaLib ; therefore having one single file with the API is like having one DLL that you include in some project.
Poor PHP, doesn't have the luxury of library referencing. :lol: I understand how you want it done, I guess it wouldn't really bother people in the long run. Beggars can't be choosers! :P

Yes I'm the beggar in this case, begging for multiple files. But I'll concede for a single file. :) Not that I'll use the PHP one anyway, I just like weighing in on these things. :mrgreen: