PDA

View Full Version : Lines of code per day.



abachler
10-19-2007, 10:15 AM
Ive heard people talk abotu jobs where they measure your performance in lines of code per day, adn while I personally think its a retarded way to measure performance, I am curious as to exactly how many lines the average company that does this expects from a programmer per day.

Prelude
10-19-2007, 10:35 AM
I imagine it would vary wildly depending on what exactly you're writing.

Wraithan
10-19-2007, 10:35 AM
As far as I know this is a practice that is no longer in use.

brewbuck
10-19-2007, 10:35 AM
Ive heard people talk abotu jobs where they measure your performance in lines of code per day, adn while I personally think its a retarded way to measure performance, I am curious as to exactly how many lines the average company that does this expects from a programmer per day.

Incredibly complicated question. Is it new development, bug fixing, or long-term maintainance? What languages are in use? How much programmer time is consumed in design phase, if any? What happens when you write a negative number of lines of code (i.e., you remove code), how does that affect the metric?

As far as anecdotal evidence, on a peak day when I am doing NEW development I produce maybe 2000 lines of code. But there are days I only write maybe 10-15 lines of new code, days where all I'm doing is fixing bugs, which is typically a net change of 0 lines of code, and days where I'm not programming at all.

abachler
10-19-2007, 10:39 AM
All of that is why I hold the opinion that I do, as well as why I think most intelligent managers have stopped this hethen practice. I was just wondering what sort of figures had been thrown out there back when this was seen as a best principle and practice. I am certainly not trying to defend it or to figure out how to implement it, I just want to laugh at some of the actual numbers people have expected.

indigo0086
10-19-2007, 10:59 AM
Lines of code that actually works? If not I qualify.

Salem
10-19-2007, 11:09 AM
Through the life of the project (from requirements to delivery/maintenance), that is to design, code, debug and test, and if you factor in all the people on the project which don't write code at all (managers, support staff), then you might be looking at something as low as 1 line of code, per person, per day.

As brewbuck says, when you finally get to sit down and write something, you can really crank the code out. But there are a hell of a lot of days when not a lot seems to happen.

> I am curious as to exactly how many lines the average company that does this
> expects from a programmer per day.
Or measure how many bugs they add per day ;)

Experienced programmers tend to have a lower apparent productivity for a couple of reasons.
1. They get given the hard problems to solve, which involve a lot of thought as well as good coding skills. So whilst the noob can crank out a few 1000 lines of UI code, the experienced programmer is left to work on say a FFT implementation (with some serious maths), and also to wonder how to make it run within the memory and time constraints of the embedded system. It might be only a few hundred lines, and it might take a couple of weeks to get right.
2. In the midst of all that, the experienced programmer knows enough to test their work effectively to ensure that the number of bugs raised later is minimal.

twomers
10-19-2007, 11:41 AM
In one of my classes the lecturer was saying that when he first started working his first project took about 7 months, or so, to complete but for the first six he was concentrated nearly completely on research, giving 0 lines (or close on it), for 5.5, 7 months. Obviously towards the end he wrote more and more.

>> FFT implementation (with some serious maths)
Just butterfly it into submission! Muahaha!

abachler
10-19-2007, 12:08 PM
This is one of the reasons why i get irritated when my boss insinuates that he is considering this crap. Im working on a project right now that has taken 6 months to get to where we are, one guy (me) doing all the research and programming. The general feeling in the industry is that it couldnt be done for another 30 years, if ever. So I spent 5 months writing this app that was 99.9% finished, we only had one minor issue left to resolve and I have a solution for it already figured out. So my boss comes in at the last minute and decides that we are going to go an entirely different direction because we arent making a big enough use of his NN class in the application. So I basically wasted the last month hacking up a simulation that was good enough to test his theory and he cant accept that it doesnt work. We are 3 weeks from a major demonstration and the application needs another 6 weeks of work (as it was). The publisher pulled out and the other partner lost his spot in the show. Looks like this ship is going down, but of course its because Im not generating enough friggen lines of code a day. He even accused me the other day of 'coasting'.

brewbuck
10-19-2007, 12:08 PM
>> FFT implementation (with some serious maths)
Just butterfly it into submission! Muahaha!

I prefer using FFTW myself, although I'm not sure how good a choice that is on an embedded system.

brewbuck
10-19-2007, 12:09 PM
So my boss comes in at the last minute and decides that we are going to go an entirely different direction because we arent making a big enough use of his NN class in the application.

Wow, that's dumb. Take a working system and break it just because he wants his own "pet code" in there somewhere? What sort of background does this guy have?

abachler
10-19-2007, 12:14 PM
He has a PhD in physics.

twomers
10-19-2007, 12:19 PM
>> He has a PhD in physics.
So? That doesn't mean he has a good business or mang head!

brewbuck
10-19-2007, 12:24 PM
He has a PhD in physics.

Ahh, the typical physicists' ego, I know it well.

DISGUISED
10-19-2007, 06:12 PM
This is the beauty of working with an iterative and evolutionary development process. You know what you have to achieve in an iteration up front, and anything you don't get done you just de-scope to later iterations :D

CornedBee
10-20-2007, 02:13 AM
Interesting story. Our lecturer in sofware design told us just two days ago that the most common cause for failed software projects is that the sponsor (of whatever kind - monetary, company politics, ...) pulled out.

Anyway, I think the LoC company is pretty much an urban legend. I imagine that early translation secretaries (before computer time was cheap enough that compilers were worth it) were measured by lines of code they could translate - just as today's compilers' speed is measured in LoC/min. Then there was IBM, which was rumoured to have this system. But I'm not sure about that. After that, any company that would be stupid enough to introduce such a system would remove it within a month - or go bankrupt. It just doesn't work.

novacain
10-26-2007, 01:20 AM
I have never worked at a company that measured performance in lines of code.
Do lines in a design/implementation/scope document count?
If I did work for such a company (which would not be for long) I can easily make 10s of lines of code into 100s of lines of code (doing the same thing).

If your boss is planning to introduce it, ask them what _exactly_ is a line of code? That is, make them understand exactly what they are actually asking for AND to put that into a formal code development guidelines document.
Do they take away lines that don't work or never get called?
I think they will then give up.....

ie how many lines is this?


int SomeClass::SomeMethod(int input)
{
if(input<minInput)
{
return 0;
}
else
{
input++;
}
return input;
}
//is it the same number as this?
int SomeClass::SomeMethod(int input)
{
if(input>=minInput)
return input++;
return 0;
}

Salem
10-26-2007, 01:25 AM
Following some DIY this week, here's an analogy.

LoC per day is like measuring your performance at applying paint in terms of area covered per unit time. Painting a wall is easy and productive (apparently), but the intricate detailed work around the edges of the windows seems to do very little, but is far more important to get right.

abachler
10-26-2007, 08:31 AM
I like that analogy so much I think Ill not only use it but take credit for it :)

indigo0086
10-26-2007, 09:20 AM
I like that analogy so much I think Ill not only use it but take credit for it :)

Salem supports Open Source, and he is evil if he restricts you from taking credit for that quote.

Of Course I'll be taking credit for that quote now.