A hard limit of 15 lines might be acceptable for a very high level language such as Prolog, but it seems too short for most other languages. That said, there&#x27;s a limit to how much anyone can hold in your head (short term memory) at once, though.   I&#x27;ve had to work on code where several C functions were around 500-1000 lines each.   Is that acceptable?<p>They seemed to work (i.e. had no obvious deficiencies), but there&#x27;s more to code quality than error rates.   Functions should be readable, easily modifiable, testable, and in many cases reusable.<p>Apart from possibly initialization code and functions containing large switch statements, I limit function length in my own code to a screenful: more precisely, one sheet of A4 paper if printed.   (60 lines, 80 columns.)<p>See also 10 Rules for Writing Safety Critical Code (<a href="http:&#x2F;&#x2F;spinroot.com&#x2F;p10&#x2F;" rel="nofollow">http:&#x2F;&#x2F;spinroot.com&#x2F;p10&#x2F;</a>) Rule 4.