Lines of Coding Per Day

Started by
48 comments, last by Servant of the Lord 11 years, 3 months ago
A) One line of code in one language at a higher level of abstraction might be worth twenty in another language.
B) A poor programmer might write 10 lines of code when 5 might suffice (not properly re-factoring into functions), or a poor programmer might write 5 lines of code when 10 would be better (example: skipping error checking).
C) A poor programmer might write 50 lines of code, and have to re-write it later because the first time it was done wrong. Does that mean he wrote 100 lines of code, despite only 50 ending up in the final project?
D) "Measuring programming progress by lines of code is like measuring aircraft building progress by weight."

I like that analogy.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

Advertisement
Given that sometimes we write few lines in a day, what is the most that you guys have written in a full work day - assuming good code with few or no bugs and little at most debugging/rewriting?

I've never measured it, so I'm just making up numbers with no evidence*, but I would guess:

1000-3000 LOC/day == you're just typing all day without much thought

10-100 LOC/day == you're writing good code

*Your mileage will vary.

On average, even when not debugging, I don't write that many lines of code a day. Sometimes as low as 10, which leaves most of my time for thinking rather than typing.

Instead of banging out 1000 lines all day long to complete a task, you can probably think about it a little more and accomplish the same task with 100 lines (which is more valuable overall, because it makes maintenance easier in the long run).

My lowest LOC-per-day score was when I was assigned a random memory-corruption bug (which was actually caused by a buffer-overrun by the GPU, due to the VRAM allocator being buggy), which took over a month to figure out. After a month of debugging, the fix was 1 line of code, or about 1/20th of a line per day over that period laugh.png There was also more than one of us working on the bug, so maybe the real score is 1/50th LOC/day each!

Also, the amount of typing you'll do also depends on the kind of programming that you're doing. If you're building a new API then you'll spend a lot of time thinking about architecture, and very little actually writing the interface based on those thoughts. On the other hand, if you've got a tight deadline, e.g. "we need to show this level at E3 tomorrow!!", but that level in the game hasn't even been started yet, then you might hammer out 1000 lines of poorly written code to script that level's events, for now.

Anyway, in the real world, good managers will adapt to your skill level and speed. I've always been assigned tasks and asked to estimate the time it will take me to complete them by myself (instead of being given the time-frame that the task will take by the manager). You and your manager will slowly learn how quickly you can complete certain types of features, they'll learn which parts of the game it's most useful for you to be working on, and your estimation skills will improve over time too. You'll improve at your own pace, and as you do, your new skills will be recognized with more responsibilities, bigger tasks, and hopefully, promotions cool.png

Guys, I have a unique opinion to share about this topic.

How many lines of code you write isn't a good way to measure your coding ability!

...did someone already say that?[/quote]

LOL

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

Obligatory link: http://folklore.org/StoryView.py?story=Negative_2000_Lines_Of_Code.txt
Code complete (iirc) has that study, though I remember it being 10 lines of code per day, per dev, on average.

In general, I can implement one straightforward feature with tests and documentation and team communication (meetings) in 4 hours. A mildly complex feature takes about a day.

In the end, only two measurements matter:

Does my code do more useful stuff today than yesterday?

Am I more happy with my code today than I was yesterday?

As long as one of these things happen in the short term, and as long as both are happening on the long term, all is well.

throw table_exception("(? ???)? ? ???");

I'm following a software engineering course atm. Apparently the average lines of code that makes production is 14. This is not for the game industry specific though.

i'll throw in a joke answer, and say the magic number is 42.

:)

devstropo.blogspot.com - Random stuff about my gamedev hobby

I agree LOC is a poor measurement.

Though I read somewhere if one really needs a number it should be written_lines+modified_lines+deleted_lines all counted positively to account for debugging and refactoring. Probably the people being measured should also not know cause they would skew those numbers then conciously or uncounciously.laugh.png

I've got my own internal unit of work. I cannot explain it well, but I understand what it means. It is simply doing one thing completely.

It is similar to an agile or scrum task, and could easily be implemented as such.

To me one unit means doing one thing. When I work on TDD code, I would measure it on the range of implementing 1 to 3 unit tests and the associated code.

My unit of work is often 10-30 lines of code. Sometimes it is 50 or more. Sometimes it is a net of zero lines. Sometimes it is a negative number of lines.

Sometimes a unit of work is a little thing. For example, if I need to change a string key, or modify some other minor variable, that unit is small. Other times a unit is a bigger thing, such as implementing the boilerplate class for a new feature and making changes to the various files in the projects and documenting the creation; that is a bigger unit. Hooking up an entire complex UI screen may be a full day task, and that is the biggest unit.

A unit is measured in hours, anywhere from 0.5 to 6. Six hours means a full day, it still allows time for meetings, buddy-checks, down-time, general office work, and social stuff. There is a minimum time of a half hour; if nothing else, it gives you plenty of time to test around the change before you submit. Anything bigger than 6 is obviously more than one unit of work and must be broken down into smaller work units.

One unit of work is the thing that I submit into version control. I don't submit a partial unit of work (because that would be an incomplete change) and I try not to include more than one unit of work, because a change should be just one atomic thing.

Now that you know what one unit of work is, I can say I strive to get around 3-5 units of work done each day, balancing between big tasks and little tasks. Sometimes I manage to get ten or more of them done. Sometimes I struggle to complete even a single unit.

I started following this pattern when I was introduced to scrum-style development in '99. The ability to break tasks down this way was one of the things that transformed my abilities as a software developer. Honing that skill means I can generate accurate estimates, and I can say with confidence how long an individual task would take me and what I plan to do to complete it.


Given that sometimes we write few lines in a day, what is the most that you guys have written in a full work day - assuming good code with few or no bugs and little at most debugging/rewriting?

I've never measured it, so I'm just making up numbers with no evidence*, but I would guess:
1000-3000 LOC/day == you're just typing all day without much thought
10-100 LOC/day == you're writing good code

*Your mileage will vary.

On average, even when not debugging, I don't write that many lines of code a day. Sometimes as low as 10, which leaves most of my time for thinking rather than typing.
Instead of banging out 1000 lines all day long to complete a task, you can probably think about it a little more and accomplish the same task with 100 lines (which is more valuable overall, because it makes maintenance easier in the long run).

My lowest LOC-per-day score was when I was assigned a random memory-corruption bug (which was actually caused by a buffer-overrun by the GPU, due to the VRAM allocator being buggy), which took over a month to figure out. After a month of debugging, the fix was 1 line of code, or about 1/20th of a line per day over that period laugh.png There was also more than one of us working on the bug, so maybe the real score is 1/50th LOC/day each!


I wrote 5 lines of code yesterday. Of those lines, 3 were a unit test, and 2 made the test pass.
Anyway, in the real world, good managers will adapt to your skill level and speed. I've always been assigned tasks and asked to estimate the time it will take me to complete them by myself (instead of being given the time-frame that the task will take by the manager). You and your manager will slowly learn how quickly you can complete certain types of features, they'll learn which parts of the game it's most useful for you to be working on, and your estimation skills will improve over time too. You'll improve at your own pace, and as you do, your new skills will be recognized with more responsibilities, bigger tasks, and hopefully, promotions cool.png
A good manager, and a good team, will schedule the time each artifact should take, and then record how long it really took.

I have a piece of software that I wrote that helps me with scheduling my people. I keep track, in it, all of the various pieces of software we've written, the feature breakdown of the software, the time each feature took, who did it, my rough estimates of their skill levels... It lets me do lots of things, for instance... I can go into a company (I'm a consultant), sit down with their team of developers, interview them and get an idea of their skill level. Using the years of data I've acquired in my database I can then use it to produce reasonably accurate estimations of how long it will take to perform the work I've been contracted to do.

The more data you gather, the more pieces of information you have, the better and more consistently you can schedule your people, deadline dates, and releases.

Frankly, its more important to learn how to work WITH a developers skill level than the number of lines of code he writes in a day.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

This topic is closed to new replies.

Advertisement