3 ms·
That's awesome! I'm guessing it fits within what I defined - you look at the starting line number and the ending line number for code points in a function and
by codeslush 15y ago
That's awesome! I'm guessing it fits within what I defined - you look at the starting line number and the ending line number for code points in a function and the number should be <50 to 75 LOC. That includes inline comments (noticeably not function definition comments). Code clarity should also be prevalent - meaning, nothing fancy! ;-) Don't cheat the system with single line if statements (for example). It's a really, really simple rule that works! People have argued with me, saying they needed more LOC for a routine, but not once has that proven to be true - at least not in the code I reviewed. And I'm, by far, not the sharpest tool in the shed. If I can do it, anyone can!
- mrb 15y agoOur coding standard was very strict. It was not possible to cheat and save lines by writing, eg: if (func()) a = 1; You had to write: if (func()) a = 1; Writing very complex C programs with functions <= 25 lines is definitely possible. All Epita students were routinely doing it!
- codeslush 15y agoI was thinking more along the lines of: if (func()) { a=1; } /* curly braces didn't count in your allocation of LOC, but they would in mine. */
- deleted 15y ago[deleted]