How many lines of code is ideal for your program?

While looking at the refactoring project over on SednaX, I found myself writing up some quick little code analyzer classes designed to see whether or not a function should be refactored or not.

Looking at that chart, it shows FoxPro has some numbers like 35 single lines of code per function. Wow – that seems low but maybe not.

So tell me – what do you consider to be the ideal number of lines per code / function for readability, maintainability in your programs?

Take the Poll and let me know…

2 thoughts on “How many lines of code is ideal for your program?”

  1. I must be insane and hard to work with. That’s all I can think of.

    I’ve picked up a contract working on a VFP project where there is one main VCX with a bunch of classes inside of it. There is another VFP programmer that checks this VCX and VCT in and out of VSS. We are both doing development on our own copies of this VCx at the same time. THis class has methods/functions are huge with hundreds of lines of code, that were already ther and need refactoring.

    When we “merge” our changes, it ends up being me that has to redo my edits into his master copy of the VCX. (Beyond Compare takes care of merging the PRG based changes.)

    I had refactored some of his mega functions so I could use a subsection of the code and it caused a minor problem when they had to rush all of our changes into production because of another emergency.

    I recently suggested that we break the big VCX into a VCX per class to ease checkin/checkouts, version control, and development. The response was “Not ready to break up the vc*, we have enough trouble getting bugs out of what we do breaking into separate functions.”

    I must be insane and difficult to work with.

Comments are closed.