News for hackers. Stuff that matters.
Re:The ups of downs of porting 50k lines of C++ to Go by shawn-butler on Saturday March 07, 2015 @10:33AM (#9161993)
What is the fascination of software people with LOC as a code measure / metric?

It seems indicative of nothing, not quality, especially not readability nor maintainability.

I've never understood this apart from the very early days of punch cards and memory/storage limitations which placed physical limitations on computation.

Re:The ups of downs of porting 50k lines of C++ to Go by frostmatthew on Saturday March 07, 2015 @10:55AM (#9162060)
> It seems indicative of nothing, not quality, especially not readability nor maintainability.

It's not meant to be indicative of any of those things (though I'd argue, all else being equal, maintaining an application with more LOC is harder than one with less).

It's indicative of complexity and scale. A programmer can read through an entire 500 LOC program and will know everything about the program. This becomes much more difficult for a 50K LOC program and outright impossible for a 5 million LOC program.

Taking a 50K LOC program and bringing it down to 10K (regardless if that's by refactoring, removing unneeded code, or rewriting in a new language) makes it much easier for each developer to know/understand a larger portion of the program.

Prior to my current job I had only worked on relatively small applications (<25K LOC) and I was blown away by the difference between working on things like that and working on something measured in the millions.

[And in this specific context I doubt it would be on the front page of HN if somebody took 500 lines of C++ and rewrote them in a hundred lines of Go, i.e. knowing the LOC is useful to determine if this was a meaningful undertaking or not]

Re:The ups of downs of porting 50k lines of C++ to Go by lomnakkus on Saturday March 07, 2015 @11:10AM (#9162105)
AFAIR one of the few things that software engineering research has consistently shown is the bug-count is correlated with LOC, esp. with churn, i.e. number of lines changed. (I can't recall exactly how robust the effect is, but I remember reading about it in "Making Software: What Really Works, and Why We Believe It" and you can probably find a few cites in there.)
Re:The ups of downs of porting 50k lines of C++ to Go by dr_zoidberg on Saturday March 07, 2015 @11:20AM (#9162145)
Writing 50k lines of code takes a lot of time, and every line has a chance of spawning a bug or undesired behaviour. Of course it's not a perfect metric of a system, and of course a line of code written by some experienced C guru will be completely different from one written by a newcomer to the language. But it is also true that the less lines of code, the less potential points of failure in a program.

Also, if you were given the task to read and analyze a piece of code, you'd surely wish it were shorter! As long as the software performs the desired tasks and readability is cared for, shorter tend to be better.

Re:The ups of downs of porting 50k lines of C++ to Go by coliveira on Saturday March 07, 2015 @10:35AM (#9161998)
Most software engineers still view software construction as the task of manipulating text files. That is why they have such a fascination with lines of code. People coming from a different programming tradition such as SmallTalk or APL know that this makes no sense.