Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't have that book at hand right now. I wonder if language plays a role here. Judging from my own experience, a 200 line stored procedure is quite manageable, but 200 lines written in a c-like language are a tough nut to crack.


I believe that code bases in C were studied. As long as the number of ifs, loops, etc was small, the length of the function did not hurt maintainability.

However in this does result in language differences. In practice the density of ifs, loops, etc tends to be higher in a C-like language than in a stored procedure. So the complexity of functions tends to go up.

The research cited is, however, quite old and did not include any OO code. Method dispatch can hide an implicit "if", and I don't know whether that tends to affect the maintainability of code in practice.


As long as the number of ifs, loops, etc was small, the length of the function did not hurt maintainability.

http://en.wikipedia.org/wiki/Cyclomatic_complexity




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: