Mail Archives: djgpp/1999/01/10/11:47:31
be careful though, if a function is too small, then it will take longer to
call the function than to process it :-)
Eli Zaretskii wrote:
> On Sun, 10 Jan 1999, pjotr wrote:
>
> > When writing code, is there like a maximum size of lines per function
> > you should take into account? I just wrote a 200+ lines function and I
> > was just wondering if maybe it's too large for just one function.
>
> If the function has a single well-defined purpose, then IMHO it's okay to
> go beyond 200 lines, even if comments are not counted. Usually, though,
> only highly complicated problems require such long functions. In most
> cases, you should be able to solve any single problem in less than that,
> and if not, to break the problem into several smaller sub-problems.
>
> DJGPP makes it difficult to debug a function if it has more than 64K
> lines. Anything less than that should work. It is up to you to decide
> where do you draw the line.
- Raw text -