Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm graduating college, about to start a junior software engineering position, and I've been wondering how much I'm going to be expected to do on what kind of timeline.

I mean, in python I can write maybe 500 lines in 8 hours. In C, maybe 200 lines in 8 hours. And that's a big maybe. (I'm f#$*ing terrible with C.) Other languages are somewhere in between.

I don't even know if that's ridiculously slow or normal or even good, hence the question.

How much code do you write a day? It would be helpful to specify what language/technology you're using, and to make note if there are big differences between them like with myself.

share|improve this question
I did not measure, but I think I can write (at most of the languages I use) several thousands of lines a day. Usually, though, the work day isn't 8 hours of pure coding, but has several hours of researching, thinking and brain-storming. – Ramon Snir Nov 18 '12 at 7:10
8  
More important than the no lines of code, do you get the job done in time. In addition, for me programming more and more becomes a lot of thinking about how I'm going to solve the problem, and less about typing code. – Paul Hiemstra Nov 18 '12 at 7:22
6  
If you write 100 lines of code that can replace 1000 lines of code, did you just write -900 lines of code? And if so, did you do better or worse than the guy that wrote the original 1000 lines? – Michael Shaw Nov 18 '12 at 7:36
5  
LOC is a very poor proxy for productivity - you shouldn't measure productivity on how many lines of code you write, nor should yoru managers. Measure it by features delivered (with bigger features being more valuable) – Oded Nov 18 '12 at 7:39
2  
I'm refactoring code at work for an upgrade and am DRYing up the old code. I figure I average -200 lines of code per day. LOC for productivity in code is like increase in weight for productivity in airplane design. – Greg Nov 18 '12 at 11:39
show 1 more comment

closed as not constructive by jmort253, Jim G., dasblinkenlight, Thomas Owens Nov 18 '12 at 13:10

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

1 Answer

up vote 10 down vote accepted

How much code do you write everyday, at work?

This is not at all an important aspect. The crucial part is:

How much work do you finish with the least amount of coding ?

One should have a tendency of accomplishing the most with the least coding. The advantages are:

  1. More you code, more you need to test as there is more possibility of bugs
  2. Lesser the code, lesser the maintenance effort by you and your colleagues
  3. Small but modular code is often clearer and it can be understood well & extended easily in future

Let's take a simple C/C++ example: suppose you want to dynamically allocate an array and initialize its element with 0 and then after using it you want to deallocate it.

  1. Do a malloc() and then use memset() with 0; after using it do a free()
  2. Replace malloc() and memset() with calloc(); use free()
  3. Replace calloc() with new[]() and use delete[] instead of free()
  4. Use std::vector<> instead of above
  5. Change your code so that this code is needed only within a function with fixed size and use std::array<>
  6. Change your design so that you don't need this array at all!

The steps above are starting from the worst towards the best approach. We accomplish the same task with lesser and lesser of code.
Do more brain storming, search for better tools and write minimal code.

share|improve this answer
3  
@Aerovistae: Just remember that "minimal" in this context refers to the amount of commands, variables, etc. necessary to solve the problem. It doesn't refer to space and compactness. In C you can write a compact one-liner using lots of side-effects++, abbr var nms and+no*whitespaces. You can as well write it in 10 lines that are readable and maintainable, which is much more important. Yet another reason why LOC is pretty meaningless. – Secure Nov 18 '12 at 8:33
1  
@Secure, ...write it in 10 lines that are readable and maintainable. that's a good add on to the answer. – iammilind Nov 18 '12 at 9:11
1  
+1 for answer and Secure's comment, strive for simplicity and reduce LOC... within reason. – Matt Nov 18 '12 at 11:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.