Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Please don't ever ask about "lines of code". This measurement means absolutely nothing, and I've been programming for over 20 years. Any responses would be misleading at best.

There are huge programs that should be tiny. And there are small programs that are so clever that they're unmaintainable, and should be bigger. There are many ways to show that lines of code won't tell you what's really important about a program or programmer.



Here's the way to phrase it, "How much of your day can you spend working on your projects?" That's the difference, seemingly, at a startup.

I've had days where I was writing mindless interface code and banged out a couple thousand lines in a day. The hacks I'm really proud of are the ones that are 300 lines of code that took me two weeks. It's figuring out what those 300 lines should be that was the interesting part.


Program A has 20 lines of code. Program B has 20.000.000 lines of code. Is this absolutely meaningless information?


Bearing in mind that you haven't said anything else at all about either program, I'd have to say yes, absolutely meaningless.


Ok, let's say someone proposes you to maintain either A or B, giving you 10.000$ per year. You have the right to choose one of the two. He tells you that the only info he can give you is the lines of code of each program.(think of it as a thought experiment.) If you say, I don't care to know - it's meaningless. you lose the chance to make 10.000$ per year by maintaining a toy application of 20 lines. Even worse if you say, I just need the 10.000$ and choose B randomly.

I mean, at least one info you get is that A is a toy application and B is a big program. Might be big because it's full of useless sh*t, but still it's big and this IS some information.


Thought experiment eh?

Consider A == B without line breaks.


That was a good one. But somehow it supports my argument, showing that any additional information (like how many of the lines are blank) brings some new value.


Not meaningless. But potentially unhelpful or even misleading.


I absolutely agree. The problem is that unless you have a one man project without a deadline you need some kind of count. And LOC seems to be the best there is.


Might want to try team velocity, at least if you're on an agile project. That seems to be a nice balance between the need for metrics and the reality of technology solutions.


All lines are not created equal.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: