www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/10/09:46:40

Date: Sun, 10 Jan 1999 16:45:15 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: pjotr <pjotr AT wlink DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: question
In-Reply-To: <36989ad9.12371104@news.w-link.net>
Message-ID: <Pine.SUN.3.91.990110164028.4975A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019