News for hackers. Stuff that matters.
Re:You only get 1,000 lines of code a week by methyl on Monday November 17, 2014 @10:02AM (#8618431)
Actually 1,000 lines of code a week is quite a lot. Of course it depends on language / technology stack, I'm speaking from Rails / JavaScript programmer point of view.
Re:You only get 1,000 lines of code a week by phkahler on Monday November 17, 2014 @10:08AM (#8618469)
Yes. And this: "Your 1,000 lines should be the essential core that enables a team of programmers to write another 10,000 lines effortlessly."

If you're writing critical core stuff like that, you better spend a lot more than a week on it. I can't imagine working on anything where the team regularly writes 10,000 lines a week. Prototypes by one person can easily grow at 1kLOC per week for a short time, but that's a special case.

Re:You only get 1,000 lines of code a week by Bahamut on Monday November 17, 2014 @11:03AM (#8618756)
I'm a senior engineer who has written over 150k loc the past month :( . I have had to tackle some difficult problems that allowed the other engineers to keep moving.

My workaround so far has been to do most of the critical work during after hours or before everyone comes in the office, since my primary role during regular hours is to keep everyone unblocked. It isn't sustainable though, and I only do it at the moment because we are in crunch mode - 'tis the startup life.

Re:You only get 1,000 lines of code a week by segmondy on Monday November 17, 2014 @09:13PM (#8622038)
Since no one in HN has called you out, let me do so. You sir, are a liar. 150k LOC? GTFOH! Seriously, how many did you throw out? BS! Being that you are on HN, you definitely have free time, what's your github?
Re:You only get 1,000 lines of code a week by GuiA on Monday November 17, 2014 @11:10AM (#8618784)
150 000 lines of code / (10 hours * 5 days * 4 weeks) = a sustained 750 lines of code an hour? That's impressive. Can you share a bit more about how you manage to achieve such productivity for those of us who aspire to be like that?
Re:You only get 1,000 lines of code a week by eloff on Monday November 17, 2014 @11:28AM (#8618870)
750 LOC/hour on average? The secret to that is either having a very loose definition of code (e.g. counting generated files, copy and pasting huge amounts of boilerplate, etc) or a very loose definition of honesty. Nobody is that productive, especially not working 10 hours a day. If I do 750 LOC in a week, that's a good week!
Re:You only get 1,000 lines of code a week by artmageddon on Monday November 17, 2014 @01:58PM (#8619784)
> If I do 750 LOC in a week, that's a good week!

I'm so glad I'm not the only one who feels this way.

Re:You only get 1,000 lines of code a week by georgemcbay on Monday November 17, 2014 @03:03PM (#8620160)
If I can do -750 net LOC in a week (while maintaining or extending functionality), that's a great week!
Re:You only get 1,000 lines of code a week by ska on Monday November 17, 2014 @12:58PM (#8619403)
In my experience aspiring to this would be a mistake.

You can pull off very high production numbers for a while [under whatever metric you choose] before you start babbling in a corner somewhere, but invariably i's mostly crap and you'll end up replacing every 100k lines with 10-20k lines later, but this time it will be well though out, tested, and maintainable.

I've met a few people who have convinced themselves this isn't true, but nobody who has managed to convince anyone else.

So you can paint yourself into a corner where all you can do is crank as fast as your tooling allows, but it's like deficit spending, it will cost you more in the long run than doing it right would. Of course, if having a long run at all to worry about this depends on your current output, crank away.

Re:You only get 1,000 lines of code a week by Bahamut on Monday November 17, 2014 @11:23AM (#8618844)
I have an excellent command of JavaScript and AngularJS, which allows me to focus on the problems themselves and not get fussed up with language subtleties...usually. I also have been working 70+ hour weeks for the past month, often 75 hours. There have been multiple times I had to shut my brain for the night because my focusing ability starts to deteriorate if I code too long. I also try to get a good night of sleep most nights - 7-8 hours prove optimal for me, although I often end up with 6.

A good portion of those loc have been complete rewrites based on existing code to clean it up and meet unforeseen changes in requirements that nobody planned for. Honestly, the amount of code I pumped out is a miracle, I'm hoping I don't get stuck in such a situation again at my current job.

Re:You only get 1,000 lines of code a week by RogerL on Monday November 17, 2014 @12:12PM (#8619134)
That is under 7.2 seconds per line, nonstop. [1]

I'm a fast typist, and I can't type that fast.

[1] 75 hrs/week * 4 weeks * 3600 sec/hr / 'over' 150,000 lines = 'under' 7.2 sec/line

Re:You only get 1,000 lines of code a week by dahart on Monday November 17, 2014 @03:55PM (#8620493)
And don't forget- its not nonstop; he's managing others during the day and setting his fingers on fire before & after work, its probably under 4 seconds per line!

Which, as long as you never under any circumstances have to actually read, build, run, or debug any of the code, is totally do-able.

Even if this physically impossible feat of coding were true, that's 150,000 lines of code to debug, written while tired. Enough to set a full engineering team back for a year.

Re:You only get 1,000 lines of code a week by jbergens on Tuesday November 18, 2014 @06:30AM (#8623448)
I work with Angular and Javascript as well. I don't think you should count the html code, if that is what you did. Count the javascript-code only and see how many lines you write in a week. And if the number still is as high as you've said I must wonder what kind of system you are building? Normally you rewrite everything that is repetetive into services/controllers/functions to keep the line count down. There was a talk recently from Google about some large application they had written in Angular, the problems they ran into and what they learned from that. They provided some line counts and it wasn't millions of lines even for them and they still had a team of something like 10-20 developers.
Re:You only get 1,000 lines of code a week by jessedhillon on Monday November 17, 2014 @03:29PM (#8620325)
Others are downvoting you, possibly bc they think you're exaggerating, but I just find your claims to be curious and would be really interested in meeting you. That is, if you ever have time to meet other people. Let me know, contact info is in my profile.
Re:You only get 1,000 lines of code a week by cowsandmilk on Monday November 17, 2014 @11:18AM (#8618825)
I don't think he was suggesting you aspire to that.

And both 10 hours and 5 days are probably underestimates of the time he is spending.

Re:You only get 1,000 lines of code a week by RogerL on Monday November 17, 2014 @11:59AM (#8619061)
The claim was he did this mostly while others weren't in the office. If you assume they work a straight 8 hours (and why would they at crunch time) that leaves 14hrs/day to eat/sleep/work. 10/5 isn't so unreasonable approximation

But hey, another way to look at it. 150,000/30 = 5000 lines/day. At 16 hrs/day, that is 312.5 lines/hour, or 5 lines/minute non-stop.

Not killing myself, and leaving the typos in that wouldn't affect compilation, I generated the code below in 36 seconds; I knew what I was going to program ahead of time - there was no thinking involved. I honestly could have typed faster, but I also didn't want to type faster than I could sustain for 16 hours nonstop. I haven't had my coffee yet, so that is a factor.

So that is right at the target rate. I don't think I could maintain that 16/7 for real problem. I'm going to have to stop to think, to look up things, to make mistakes, to write tests, to document. Unless we assume I am perfect, I'm going to have to spend time debugging. This is for a stupid Euclidian distance function, whereas the claim was it was difficult, critical code. And the claim is not 16/7, it is "before/after" office hours.

    import math

    def distance(x,y):
        """ compute striaght line distance between x and y"""

        return math.sqrt(x**2 + y**2)
Re:You only get 1,000 lines of code a week by hawkice on Monday November 17, 2014 @03:01PM (#8620148)
I agree with your conclusion.

Worth adding this doesn't even find the two dimension distance between two points, it finds a hypotenuse length using the Pythagorean theorem and doesn't accept two points as parameters (unless they are on a number line, and in that case math.abs(x - y) would be the correct code).

Re:You only get 1,000 lines of code a week by wernercd on Monday November 17, 2014 @11:33AM (#8618906)
That... and I shiver to think of the amount of buggy code being churned out. 150k lines of crappy code isn't something to be proud of.

More code = more points of interaction = more bugs.

Caveat: This is assumption based. I assume that much code is due to "quantity not quality". Boilerplate code, copy/pasta, 10 lines of actual code, 100 lines of test, etc

Re:You only get 1,000 lines of code a week by fsloth on Monday November 17, 2014 @12:43PM (#8619310)
Whoa. Is this code amount due to the crunch mode you are in or is it typical you need so much code to implement features?
Re:You only get 1,000 lines of code a week by drylight on Monday November 17, 2014 @11:59PM (#8622439)
That's a lot of "copy and paste 'programming'".
Re:You only get 1,000 lines of code a week by jahewson on Monday November 17, 2014 @12:36PM (#8619283)
What tool did you use to measure your loc?
Re:You only get 1,000 lines of code a week by coldnebo on Monday November 17, 2014 @10:57AM (#8618724)
I read the essence of that statement without the same time constraint applied to it. i.e. the type of 1000 lines you should be working on each week is the type (systems code) that enables (application) programmers to write the rest of their code effortlessly.

e.g. Rails core (system) vs people who use Rails (applications).

Re:You only get 1,000 lines of code a week by pjc50 on Monday November 17, 2014 @10:54AM (#8618706)
It very much depends on whether it's new code or maintenance mode as well. I've managed to put out 2kloc of MFC C++ over the past two weeks for an internal test app, but that's very unusual and my maintenance work is more like 100 loc a week.

I think the most extreme of this was a colleague of mine years ago who spent two weeks bug-hunting and eventually removed a single wrong minus sign. Vital work that this metric is completely useless for.

Re:You only get 1,000 lines of code a week by peter12355 on Monday November 17, 2014 @10:19AM (#8618533)
Same here. The German Wikipedia page for LOC (http://de.wikipedia.org/wiki/Lines_of_Code) says that usually 10-50 LOCs per day are normal which would be 70-350 LOC per week.
Re:You only get 1,000 lines of code a week by k__ on Monday November 17, 2014 @11:52AM (#8619022)
seems okay to me.

Sometimes I hack away 100s of lines a day and sometimes I search for problems for days without writing a single (persistent) line of code.

I think the longest span I went was about 3 weeks till I tracked down a bug in a legacy system and wrote about 4 lines to fix it :D

Re:You only get 1,000 lines of code a week by JamesSwift on Monday November 17, 2014 @11:19PM (#8622350)
And sometimes I search solutions to a problem for days which results in only writing a single line of code.
Re:You only get 1,000 lines of code a week by atmosx on Monday November 17, 2014 @10:13AM (#8618493)
Still it's not a metric. I know people that use ruby in a way that every 6-lines method of mine, could be 1 (hard to read, sometimes extremely cryptic) line of theirs. I'm not sure you can measure, not even using third party apps.
Re:You only get 1,000 lines of code a week by kstenerud on Monday November 17, 2014 @10:27AM (#8618575)
Every metric can be gamed. You need a trustful relationship for it to work.
Re:You only get 1,000 lines of code a week by digsmahler on Monday November 17, 2014 @01:22PM (#8619572)
Some weeks I write negative lines of code. Those are good weeks.
Re:You only get 1,000 lines of code a week by mathattack on Monday November 17, 2014 @10:03AM (#8618445)
That was my reaction too. If you want to force thought and conciseness, make it 100 lines. :-)
Re:You only get 1,000 lines of code a week by collyw on Tuesday November 18, 2014 @09:46AM (#8624022)
Agreed. As I get more experienced with Django (and a greater understanding of things like class based views) my code gets a lot more concise. I just updated some code from 6 months ago. If I were to replace it, it would probably be half as many lines, and more reliable.
Re:You only get 1,000 lines of code a week by protonfish on Monday November 17, 2014 @10:19AM (#8618531)
1,000 lines are probably not as much as you think. For web developers, if you included HTML, CSS, JavaScript, CGI language and SQL you can easily get over 1,000 characters in a week. (That's only about 25 lines an hour for 8 hours/day 5 days/week.)
Re:You only get 1,000 lines of code a week by pdpi on Monday November 17, 2014 @10:31AM (#8618591)
Every time I get anywhere near that sort of number, I look at it, and factor out all the boilerplate I'm almost certainly writing.
Re:You only get 1,000 lines of code a week by eterm on Monday November 17, 2014 @10:23AM (#8618557)
I'd struggle to think in a job which required 25 lines an hour ever, let alone constantly for 8 hours/day!

I don't think I've ever written more than a few hundred LOC in a week.

Re:You only get 1,000 lines of code a week by k-mcgrady on Monday November 17, 2014 @10:36AM (#8618612)
What kind of projects do you work on? I'm sure the experience differs a lot between people working on important, complex legacy projects, and people developing consumer mobile apps for photo sharing etc.
Re:You only get 1,000 lines of code a week by Kiro on Monday November 17, 2014 @11:19AM (#8618830)
For me working on complex legacy projects means even less LoC since you're so afraid of breaking stuff.
Re:You only get 1,000 lines of code a week by k-mcgrady on Tuesday November 18, 2014 @07:12AM (#8623548)
Exactly, that was my point. If you're starting a simple consumer product you'll write lots of code quickly. When working on something complex you need to consider how your changes will effect every aspect of the product.
Re:You only get 1,000 lines of code a week by matwood on Monday November 17, 2014 @03:49PM (#8620446)
Exactly. When I was working on a payroll system it could take a day to change a modify a few lines and test all the various scenarios before releasing. The cost of making a mistake was large.
Re:You only get 1,000 lines of code a week by jpfr on Monday November 17, 2014 @11:02AM (#8618746)
It's easy to change/add 1000 lines in a week.

However, most code is rewritten/refactored many times. So only little of what you write in any week will be the _final code_.

Re:You only get 1,000 lines of code a week by hawleyal on Monday November 17, 2014 @12:19PM (#8619184)
LOL

A line of Ruby is worth a <INSERT-RAGE-HERE> lines of Java.