This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: best size of a c module


Jim Marshall <jim.marshall@wbemsolutions.com> wrote:
>
> Many, many years ago whilst working in DOS I recall reading something 
> that indicated the best size for a c file was about 4 or 5K. I have no 
> idea if that was true or not, but I was looking at some code the other 
> day and it was a fairly large .c file. So I was wondering if there is an 
> optimal size for c modules on todays Linux machines.

No.  There may be an optimal size for a particular platform, but
that is all.

As far as the software engineering goes, it depends on the complexity
of the module.  4-5K lines is about right for average code, on the
grounds that most people can get their head around that.  But fairly
simple code can be much longer and very complex code should be shorter.

And, of course, splitting something complex that intrinsically needs
50K lines into 10 chunks, arbitrarily rather than at 'natural'
boundaries, doesn't help at all.


Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1@cam.ac.uk
Tel.:  +44 1223 334761    Fax:  +44 1223 334679


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]