Sign in to follow this  

single files or multiple files linked with each other?

This topic is 4200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The question that i raise in here, is in case that a program that goes really large, like game engines, multiuser and multiprogram aplications; when in coding this type of applications, and using dlls, to store the app programming for hte use in the app, what is better, to just have 1 dll or in case you can to separete in different dlls and use them and link them with each other in the program with a message class sending the entities, and the informations that each one needs: a few questions i get when thinking about this, and i woudl like to know what ppl can tell me, like for example. - what advantages does a single file posses than having a multiple file system doesnt? - and what advatages does a mmultiple file system has than a single file dont? - beside the heaving coding that must be done in each mutiple file, does it help the computer in the loading and storing of the the code and its part, which in case of a multiple file system, this can be jsut said to load the files needed when they are need, and in other case they wont be loaded? - any other thoughs on this concept? thank you for reading this and any information you can give me in this subject

Share this post


Link to post
Share on other sites
well, one advantage of using small files would be that if you needed to patch a part of the engine, or wanted to make a method more efficient, you wouldnt have to re-compile all the code - you'd only need to recompile a small subset of code and switch in that component with your engine.

Share this post


Link to post
Share on other sites
OK, to paraphrase a post I saw someone awhile back make:

Steps to making an efficient & fast program:

If your program is too slow:

A) Profile the program and figure out a better algorithm for the portion that's slowing down the program
B) Before replacing multipliers with shifts to speed up the program, goto A
C) Before rewriting portions in assembly to speed up the program, goto A
D) Before merging multiple pieces of code into 1 file to speed up the program, goto A
etc.

Some reasons for breaking the code up into smaller sections: If you have 5 developers working on something, if in a single file, there becomes dependency issues. Now, granted, the program you use to manage code most likely handles this, but sometimes not too well. Breaking portions up into multiple libraries is generally a safer way to avoid such issues. (IE: If you're working on the sound engine, you know your code isn't going to break because someone working on the AI engine broke their library).

Talking about performance is almost a mute point now. Generally, compilers have gotten better, and are better than most developers. Sometime, try writing down a simple Tic Tac Toe game with no optimizations, and look at the compiled output. Then, try throwing in every optimization you can, and look at the compiled output. Unless you purposely tried to make the program go slow, I doubt there will be much difference.

Share this post


Link to post
Share on other sites
ok ty for telling me that, i continue to see some good parts of the multiple files, even tho performance is not one of the main, any things you can think as bad?

Share this post


Link to post
Share on other sites
Advantages a single has over multiple files is you only have to remember to back up one file. I honestly can't see any other advantage.

There are my main reasons for using multiple files:

It speeds up compile time (see article)

Working in teams means that several people can be working on the same project without the merging problems you would have if it was all one file.

Share this post


Link to post
Share on other sites

This topic is 4200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this