• Advertisement
Sign in to follow this  

Lines of Coding Per Day

This topic is 1833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

 

 

How many lines of code should an average professional game programmer be able to create with all other tasks such as maintaining or porting of existing code included in each day? 

 

I have about 4 hours each day and six days per week for coding, so what is about the average amount of work that would be expected in this timeframe for a pro? ( I am at a snails pace, so don't ask about me! tongue.png ) 

 

It would be good to know for the sake of a goal to reach.   Does anyone have a website link which gives these numbers?  

Share this post


Link to post
Share on other sites
Advertisement

there is no magic number, it really depends with how well versed you are in a particular subject that your writing code on, for example if i'm researching a new idea/concept, i might write at an upper most a hundred lines in a day(most likely far less), however if i'm starting a new project, and am just building the baseline code, i might crank out a few hundred lines in a single day, more so if i have a clear design of how to accomplish something.  of course then their's debugging that code to make sure their arn't problems(which can sometimes take hours depending on the complexity of your project).

 

but again, and i can't stress this enough, their isn't a specific number, there's just what you are able to do with what your given, everyone has their own pace.

Share this post


Link to post
Share on other sites
Lines of code is a very poor measurement tool for several reasons:

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?

Even, I know those things, but I am looking for the average. Sorry that I don't know how to ask the question more clearly.

For the sake of the readers, thanks for posting.

Share this post


Link to post
Share on other sites
This is a bad metric to use as a goal.  The focus should be on code quality: maintainability, legibility, efficiency and complexity of algorithms, and reduced bug counts.  The random elements of programming like debugging, thinking about code design, and forming solutions, mean that the target is way too mobile day-to-day.
 
I would argue that you hit milestones and release products faster if you have higher quality, slower-written code than if you have incredibly verbose programmers who can hammer out LOC like crazy.

Yes, I understand totally, but I am looking for an average kind of estimate.

I know that it is risky for a person here to stick the neck out and write an estimate of the average because of counter considerations.

Share this post


Link to post
Share on other sites

My mistake, I didn't see what user posted; ofcourse you already know that. laugh.png

 

Maybe a good way to actually measure would be using someone's source control, graph the dates and lines of code (relative to the final project's size) for each code submission. Even that would be a fairly inaccurate though.

 

I don't know how much I write on a daily basis - it varies too much on what I'm working on, as well as whether the parts I'm working on require longer build times by altering headers that effect more of the overall project, or whether the entire week is spent debugging various parts of the code without only a few lines of code getting written.

 

If I'm working on a bunch of helper functions or the shell of a new class I can easily reach >200 lines of code an hour, but if I'm working on finer implementation details that I need to keep debugging or really think through, it might be 20-30 lines of code an hour in between hours of no code being written. I don't have exact measurements to give, however. I've never recorded it or thought to do so.

Edited by Servant of the Lord

Share this post


Link to post
Share on other sites

[quote name='3Ddreamer' timestamp='1357851227' post='5020009']
I know that it is risky for a person here to stick the neck out and write an estimate of the average because of counter considerations.
[/quote]

That has nothing to do with it.  It's not a useful metric, and doesn't actually represent skill or, well, anything if an average were calculated.  You'll know you're writing good code when you're writing good code: solving more complex problems, spending less time redesigning, and reusing code with less hack-work to get it to play nice in a new role.

 

Entire commits can be done, representing very useful work, solving dozens of game-halting crash bugs, and the LOC of a project might change by +/- 10.  People are trying to tell you that this isn't a way you should be measuring your progress, because it's a meaningless statistic.

Share this post


Link to post
Share on other sites
Okay, guys, I accept the experience of several coders here. It is a bad metric for gauging my progress. Given that sometimes we write few lines in a day, what is the [I]most[/I] that you guys have written in a full work day - assuming good code with few or no bugs and little at most debugging/rewriting?

Share this post


Link to post
Share on other sites

[quote name='3Ddreamer' timestamp='1357852359' post='5020017']
what is the most that you guys have written in a full work day
[/quote]

I've written over a thousand lines in one day while hammering out a large portion of a new project, but it was all useless code that I threw away later thanks to being an over-engineered, brittle, overly-interconnected web of amateurish-

[quote name='3Ddreamer' timestamp='1357852359' post='5020017']
assuming good code with few or no bugs and little at most debugging/rewriting?
[/quote]

Oh.  400ish.

But I still think you're looking at "progress" all wrong.  Curiosity is fine, but don't try to gauge your skills based on these numbers.

Share this post


Link to post
Share on other sites

It really doesn't matter how much you write compared to what you are achieving. A programmers work should not be quantified as labor but rather as a creative process.

Share this post


Link to post
Share on other sites
1527.5 per day exactly. +142 on rainy days.

(Edit: As I got 2 downvotes I think I`ll rather explain those numbers. I wrote those cause I think the question makes no sense at all. Sometimes you write a lot, sometimes less, and sometimes you throw out some of your code. Plus the result doesnt depend on lines/hour, characters/hour, coffee/hour, etc) Edited by Aliii

Share this post


Link to post
Share on other sites

The amount of code written in a day is meaningless regardless of if you ask for the least or most amount written - frankly any good engineer will spend more of their time thinking than writing code.

 

I've had tasks where I've spent 2 days just looking at where I'm going to add code and thinking about what I'm going to do without writing a single line.

 

On the flip side I've had tasks where I've chewed through loads of C# code in a day for throw away tools to process data needed for other tasks.

 

Heck lines of code varies per language too.

Share this post


Link to post
Share on other sites

Where I worked previously, my boss was saying that, according to some study, the average number of lines of production code per day from a good developer was about 20[citation needed].

 

Seems really low, doesn't it? The reason is because when you develop software, you don't just write new code every day. You change code, you remove code, you simplify code, you debug code (this is a big one!), you test code, you design code and program architecture, sit in meetings, etc. You don't just add new code every day. If you were to take the number of lines of code in the final product, and divide it by the number of developers and days, you'll probably get what you think is a disappointingly low number (I've found that 20 to be decently realistic).

 

Yes, people may write/change hundreds of lines per day, but the gross vs net lines of code can vary a lot. Plus, you really shouldn't be writing code every day (take phantom's little story, for example).

Edited by Cornstalks

Share this post


Link to post
Share on other sites

I type 80 WPM / 400 CPM, so that means I can write about 2,400 lines (of 80 characters/each) in a work day if I don't take any breaks! biggrin.png

But seriously, I like the comment that was made earlier about negative lines of code. That says it all, IMO. I do as much writing as I do deleting and refactoring.


I love to delete code, especially other people's ugly-ass spaghetti grossness, and unfortunately, sometimes my own ("what was I thinking?!")

Share this post


Link to post
Share on other sites

I can give my personal opinion on this matter, keep in mind this is just an opinion.

 

Low level languages > 2000

OO languages > 1000

Functional languages > 100

 

edit: Since personal opinions are not wanted here, I will simply state. Yes, a metric for any measurable thing does not mean anything concrete.

Edited by kd7tck

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Edited by Hodgman

Share this post


Link to post
Share on other sites
[quote]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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement