LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how much do you code on average? (https://www.linuxquestions.org/questions/programming-9/how-much-do-you-code-on-average-818271/)

entz 07-06-2010 09:43 AM

how much do you code on average?
 
Hello programmers , nerds and whatnot :)

i have been lately pondering how huge software has become i.e millions of lines of code like the linux kernel in contrast to how much any given programmer could/does write in average...

so the question goes out to all programmers regardless of your language(s) ,

how many lines of code do you write in a given time period (in a year , month , week ..etc)


cheers

TB0ne 07-06-2010 10:09 AM

Quote:

Originally Posted by entz (Post 4025192)
Hello programmers , nerds and whatnot :)
i have been lately pondering how huge software has become i.e millions of lines of code like the linux kernel in contrast to how much any given programmer could/does write in average...

so the question goes out to all programmers regardless of your language(s) , how many lines of code do you write in a given time period (in a year , month , week ..etc)

Kind of like asking "how high is up"?? No one is going to be able to even give a ballpark answer, as EVERYTHING about it can be summed up with "it depends". Got a new project? If so, is it a total rewrite, or an upgrade to what's there? Different platform, same, or supporting new platform(s)? Changing languages during this upgrade? How much can you reuse? Etc., etc.....

I've done totally new pages for my system, with just the addition of a few lines of code. Then I've also had to rewrite entire modules, since upgrades rendered the old ones a bad choice to use...so those 'few lines' turned into thousands.

entz 07-06-2010 06:08 PM

Quote:

Originally Posted by TB0ne (Post 4025213)
Kind of like asking "how high is up"?? No one is going to be able to even give a ballpark answer, as EVERYTHING about it can be summed up with "it depends". Got a new project? If so, is it a total rewrite, or an upgrade to what's there? Different platform, same, or supporting new platform(s)? Changing languages during this upgrade? How much can you reuse? Etc., etc.....

I've done totally new pages for my system, with just the addition of a few lines of code. Then I've also had to rewrite entire modules, since upgrades rendered the old ones a bad choice to use...so those 'few lines' turned into thousands.

well to express myself more correctly , i meant

how many lines of code all in all ?

for instance , i've been personally working on a different variety of projects from AI , web design/programming to lots of other stuff.

all that put together in let's say the year of 2009 i've written about 3k-5k lines of code , this also includes lines that have been rewritten

so how about you?

cheers

H_TeXMeX_H 07-07-2010 06:35 AM

It is hard to estimate, but maybe 1000-2000 per year, but it depends, this includes not only adding new lines, but also changing lines. Mostly bash, and maybe some hacking in C.

entz 07-07-2010 08:06 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 4026137)
It is hard to estimate, but maybe 1000-2000 per year, but it depends, this includes not only adding new lines, but also changing lines. Mostly bash, and maybe some hacking in C.

aha , interesting ;)

konsolebox 07-07-2010 08:32 AM

It really depends on the project you're after, convenience of the environment and editor, and speed in typing and maneuvering of shortcut keys. Mind speed also.

Add: Motivation + Enthusiasm

Fritz_Monroe 07-07-2010 11:57 AM

I think you guys are over analyzing it. Based on the OP's response, it looks to me like he is asking:

In 2009, how many lines of code did you write? Or even, on average, approximately how many lines of code to you typically write in a week, month or year.

No need to bring in details about why it may be more one time than another. It isn't a scientific survey, he's just looking for a guess.

For me, I don't work as a programmer. I do a lot of BASH scripting, though. I probably only coded about 500 lines of code in 2009.

gnashley 07-07-2010 12:58 PM

Five lines of 'stable, working code' a day -averaged yearly.

konsolebox 07-08-2010 06:09 AM

Quote:

Originally Posted by Fritz_Monroe (Post 4026477)
I think you guys are over analyzing it. Based on the OP's response, it looks to me like he is asking:

In 2009, how many lines of code did you write? Or even, on average, approximately how many lines of code to you typically write in a week, month or year.

...

Ok I don't really want to post this since it might sound overture but back in 2009 I probably wrote at least 10000. That is by combining the projects I've played around, minor scripts, etc. That might sound too much but on other programmers with many projects (e.g. those in SF.net), that number means nothing. Not that I intend to make many but you'll really never notice until you've already made them. Most avid developers will even have 100000 yearly without even knowing that they have done it.

entz 07-10-2010 11:14 AM

Quote:

Originally Posted by Fritz_Monroe (Post 4026477)
I think you guys are over analyzing it. Based on the OP's response, it looks to me like he is asking:

In 2009, how many lines of code did you write? Or even, on average, approximately how many lines of code to you typically write in a week, month or year.

No need to bring in details about why it may be more one time than another. It isn't a scientific survey, he's just looking for a guess.

For me, I don't work as a programmer. I do a lot of BASH scripting, though. I probably only coded about 500 lines of code in 2009.

well that's a superb explanation of the actual (vague?) question plus a model answer to it (as it fits the question like a lid does a pot ;) )

Quote:

Originally Posted by gnashley;
Five lines of 'stable, working code' a day -averaged yearly.

hehe :)
i guess the best thing a programmer can do is to write lines that are only necessary in order to increase its quality.

complete the following sentence :

Quote:

write 5 lines of code a day .......
Quote:

Originally Posted by konsolebox;
Ok I don't really want to post this since it might sound overture but back in 2009 I probably wrote at least 10000. That is by combining the projects I've played around, minor scripts, etc. That might sound too much but on other programmers with many projects (e.g. those in SF.net), that number means nothing. Not that I intend to make many but you'll really never notice until you've already made them. Most avid developers will even have 100000 yearly without even knowing that they have done it.

well you should only count the lines that you've added or edited yourself and not the total lines of code in a project you worked on !
btw , deprecated lines also do count , so for instance if you wrote a function that was later removed from the code then that counts as well even if it no longer exists in the project.

cheers

gnashley 07-11-2010 02:25 AM

No, only lines of stable bug-free code count. The figure I stated is based on that criteria and is what has been suggested by others as being the average output of programmers. I thought it was low, but when I added up the lines of code of my main project divided by the years I've worked on it, the answer was quite close to that.

konsolebox 07-11-2010 05:54 AM

Quote:

Originally Posted by entz (Post 4029249)
well you should only count the lines that you've added or edited yourself and not the total lines of code in a project you worked on !

not to boast but actually.. i made all of them by my own.. from scratch :p

http://sf.net/users/konsolebox

and that does not include the projects i make for personal sake at home.
Quote:

btw , deprecated lines also do count , so for instance if you wrote a function that was later removed from the code then that counts as well even if it no longer exists in the project.
i didn't count deprecated lines.. i wonder....

entz 07-11-2010 07:53 AM

Quote:

Originally Posted by konsolebox (Post 4029768)
not to boast but actually.. i made all of them by my own.. from scratch :p

http://sf.net/users/konsolebox

and that does not include the projects i make for personal sake at home.
i didn't count deprecated lines.. i wonder....

well , in that case i've to lie flat on the ground and surrender LOL :D

anybody who wants to top that record of 10,000 lines per year?

btw , i see you're ultra fond with shell scripts , how come ?
in your position i'd write something in php for the command-line terminal , just put in #!/usr/bin/php

cheers

konsolebox 07-12-2010 07:02 AM

Quote:

Originally Posted by entz (Post 4029817)
well , in that case i've to lie flat on the ground and surrender LOL :D

anybody who wants to top that record of 10,000 lines per year?

I'll bet that there should be many. Lets say an average working developer finishes a stable project per month and by average each project takes at least 3000 lines. 3000's still small for a complete project. For a year that could be 24000. And we still haven't included the patches for finished projects.
Quote:

btw , i see you're ultra fond with shell scripts , how come ?
in your position i'd write something in php for the command-line terminal , just put in #!/usr/bin/php

cheers
Cheers as well. Perhaps it's just that I find it easier to accomplish tasks using shellscripts. Before I'm only used to creating simple scripts for simple tasks,.. but then I started playing around with a simple looping script that plays my favorite songs. Later on the script grew better and became serious and that's how I ended up with my projects. If I intend to create more serious projects like AIs (those like OpenKore), perhaps I'll use Perl or Ruby. So far though, I don't have any plan about creating one yet.

bigearsbilly 07-12-2010 11:10 AM

crikey! I am such a nerd

Code:

$ find ~/w ~/lib ~/include -type f -ctime -365  \( -name \*.sh -o  -name [Mm]akefile -o  -name \*.tk -o -name \*.tcl  -name \*.[ch] -o -name \*.?pp -o -name \*.pl \)|                           
> xargs cat | wc -l | commify
  39,467

ohmigod, i forgot to remove blank lines
Code:

$ find ~/w ~/lib ~/include -type f -ctime -365  \( -name \*.sh -o  -name [Mm]akefile -o  -name \*.tk -o -name \*.tcl  -name \*.[ch] -o -name \*.?pp -o -name \*.pl \)|^Jxargs cat|grep .  | wc -l | commify
  33,055

remove duplicates!!
Code:


$ find ~/w ~/lib ~/include -type f -ctime -365  \( -name \*.sh -o  -name [Mm]akefile -o  -name \*.tk -o -name \*.tcl  -name \*.[ch] -o -name \*.?pp -o -name \*.pl \)|^Jxargs cat|grep .|sort -u  | wc -l | c >
  18,335



All times are GMT -5. The time now is 06:19 AM.