How many lines of code shall one write per day at the maximum ?
How many lines of code shall one write per day at the maximum ?
Lines of code per day is an irrelevant measure of performance.
A lazy programmer will write 10 lines of code while a productive programmer writes 100.
A highly skilled programmer will write 10 lines of code that do the same as 100 written by an inept programmer.
An inept highly productive programmer will write a 10,000 lines of code, while a lazy but highly intelligent programmer will write 100 lines of code that does the same thing.
So unless your workforce is completely devoid of skilled programmers, the use of the lines of code per day metric is grounds for downsizing the manager.
((Random hijacking split from really important and useful thread))
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I think Abachler pretty much summed it up. But if you're just talking raw statistics, it really just depends. My most productive days can work out to up to 1000. My record is probably something like 10,000. Of course, I always break up long lines for readability, so once again, line counts really aren't the best indicator of productivity.
Does changing a line count as writing a new one? Theoretically, one could modify existing code, or remove lines of code all day long, thus in effect producing 0 lines of code!
So I'm tempted to say that 0 lines of code is the best quote to hit per day!
And there's also...
Anyone writing 0 lines of code because they spent the whole day debugging or testing should be sacked. While anyone writing 10,000 lines of code in one day because they refactored their classes with an automation tool should be promoted to project manager.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Also theres formatting.
6 linesCode:int main() { cout << "Howdy Erf!!!"; return 0; }
3 lines.Code:int main(){ return printf("Helo Byd\n"); }
So is the guy that inserts frivolous whitespace twice as productive?
I wrote a program that wrote 1 million lines of code in 5 minutes, does that count?
Last edited by abachler; 09-15-2009 at 02:22 PM.
It was one of those marathon sessions - a constant flow of coffee and a slice or two of toast every couple of hours and I can write code pretty much non-stop (with a few short naps in between to keep me fresh), if necessary.That's (more than) 200 pages. How many arms do you have? I don't even like having to read that much in 24hrs.
Incidentally, I'm not a very fast (nor accurate) typist, either. People have actually complained about my typing style - I mostly use my two middle fingers, and so to get up to a good speed I sort of pound on the keys quite rapidly, which can be a pretty noisy.
Anyway, I actually enjoy writing code, which helps (although I can certainly reach total burnout if I'm not careful - if that happens, it can be days before I get back to it).
Well, exactly. I might take a function that most would put on two lines for the declaration, and break it up like this:
...which is like 15 lines! So, yeah, obviously, as you said, not the most relevant measure of performance.Code:template < typename Foo, typename Bar, typename Baz, typename Qux > void process ( Foo const& foo, Bar* bar, Baz& baz, Qux qux );
Kook. I thot this was "Cmasochists.com"
I am doing gtk stuff again and the friggin API drives me nuts. "They" evidently do not believe in even the slightest possible form of abbreviation:
95% of the calls require the macro cast, too, since the pointers are all declared of one type (GtkWidget) but the actual function calls always apply to a "more specific" type.Code:gtk_container_set_border_width(GTK_CONTAINER(frame),PAD); *num=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(spin));
I guess I can see why but holy mother of god...write a 1000 lines of this in a day.Code:gtk_abstract_thing_aspect_variant_create_element_round_data_float(GTK_THING_OTHER_MATCH(myx));
Last edited by MK27; 09-15-2009 at 03:11 PM.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Heh. Well, you might be suprised to find out that there are plenty of good programmers out there that don't actually enjoy the process very much (being more concerned with the end result, I suppose). To me though, writing code is very much an art form - sort of like composing music or poetry, and as such, I find it to be quite a therapeutic experience. Almost like taking a relaxing bubble-bath...if you could imagine one where your eyes get sort of glazed over, of course.
I don't know. Personally, I find that abbreviations can be difficult to remember, and so almost always opt to use more "long-winded" names.I am doing gtk stuff again and the friggin API drives me nuts. "They" evidently do not believe in even the slightest possible form of abbreviation:
Code:
gtk_container_set_border_width(GTK_CONTAINER(frame ),PAD);
*num=gtk_spin_button_get_value_as_int(GTK_SPIN_BUT TON(spin));
95% of the calls require the macro cast, too, since the pointers are all declared of one type (GtkWidget) but the actual function calls always apply to a "more specific" type.
Code:
gtk_abstract_thing_aspect_variant_create_element_r ound_data_float(GTK_THING_OTHER_MATCH(myx));
I guess I can see why but holy mother of god...write a 1000 lines of this in a day.
Of course, you could always define a typedef or a wrapper macro if it really bothers you.
Last edited by Sebastiani; 09-15-2009 at 03:24 PM.
I used to write, like to the extend that I had a self-published book, and used to go perform at open mics and stuff like that. When I first started programming, it totally reminded me of poetry, not so much (but partially) because of the concrete arrangement of the "words", but mostly because it is so compressed and is not bound by a simple repeating structural cycle (like the prose sentence), at the same time as being very precise. The compression and the precision create a compound "high level" realm in which the code actually has a meaning. And of course the magic of it.
I don't really regard it so much like poetry anymore, but I totally believe that it hits that spot in me sufficiently -- I no longer have much interest in writing, and I don't feel at all sad about that, because while the product is very different, the activity still seems similar without being so "draining".
I generally prefer reading poetry to listening to it and like people like bp nichol and ee cummings...
There are literally hundreds of these functions and the only thing they have in common is they start with gtk_ -- but I guess you're right, it would probably take an afternoon to come up with something.Originally Posted by Sebastiani
Last edited by MK27; 09-15-2009 at 03:39 PM.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
I'm not suprised, actually. You really are a natural when it comes to writing, honestly. And come to think of it, I would even buy your book.I used to write, like to the extend that I had a self-published book, and used to go perform at open mics and stuff like that.
I hate to admit it, but I never got to know much poetry. I think it has a lot to do with being dyslexic, though (something I still struggle with) rather than a general disinterest. Maybe I should revisit some of the classics and see if there is something there that I can relate to.I don't really regard it so much like poetry anymore, but I totally believe that it hits that spot in me sufficiently -- I no longer have much interest in writing, and I don't feel at all sad about that, because while the product is very different, the activity still seems similar without being so "draining".
I generally prefer reading poetry to listening to it and like people like bp nichol and ee cummings...
As a kid I actually attended quite a few poetry readings (not suprising, considering that my parents were a bunch of hippies), and my overall impression was that of extreme pretentiousness. Nothing wrong with a heartfelt delivery, of course, but when you've got this guy wearing a beret or something and belting prose in a jazz-like tempo, it get's pretty annoying, IMO.I generally prefer reading poetry to listening to it and like people like bp nichol and ee cummings...
Hey, at least you don't have a hundred or so function with names like gtk_abs_thg_asp_var_creat_elem_rnd_dat_flt!There are literally hundreds of these functions and the only thing they have in common is they start with gtk_ -- but I guess you're right, it would probably take an afternoon to come up with something.