7 ms·
Having lots of lines of code isn't a badge of honor, nor is it a particularly good measurement to begin with. I wish that publications would stop stating this
by makecheck 14y ago
Having lots of lines of code isn't a badge of honor, nor is it a particularly good measurement to begin with. I wish that publications would stop stating this number like it means anything. I could probably think of 10 ways off the top of my head to skew the lines of code that a function would require without even affecting the size of the binary (heck, just change the style of braces...). I could change one line and create a buggy mess, or remove 1000 lines and create a brilliant masterpiece of efficiency.
Something that might mean more is growth in code complexity over time. For instance, if measured every month for a year without changing the compiler version or platform, how much bigger or smaller did the compiled binaries become? How much more or less memory and runtime were consumed? How many "severe" bugs were found? When overlaid with information on the features that were added or removed during that time, it should become a lot clearer how large the code base really is and how maintainable it will be.
- austenallred 14y ago"How Company X manages a 15,000 pixel icon."
- Trufa 14y agoI don't understand you comment. Could you please explain? Sorry, thanks.
- austenallred 14y agoSaying that a company has 10,000 lines of code is just as relevant as saying they have a design that's 10,000 pixels big. It could hold more data, or it could be something super simple just made really poorly and very bloated. "Lines of code" is not a good unit of measurement for complexity.
- GlenAnderson 14y agoWhat would you use instead? LoC isn't a perfect metric but it is very easy to relate to. Given some extra context like the type of application, the size of the company or the age of the codebase one can mentally account for some of the weaknesses of using LoC as a metric. If this were a study using LoC as a sole metric with no other context I'd agree with you but LoC seems perfectly adequate in this case.
- austenallred 14y agoYou're right; in this case it probably is adequate. I'm by no means an expert programmer (alas, I come from the business development/marketing side of things), and I used to measure things in LoC as if it were a be-all end-all metric. Then I started programming and realized how ridiculous that is. It's probably the best metric to use, I just wish there were something better.
- Darmani 14y agoHalstead complexity? Cyclomatic complexity? Those are just a couple of famous, old-school ones. Software metrics is a major research area, and dates back to the 60s. The paper "Software Metrics: A Roadmap" has a good summary of the state-of-the-art as of 2000.
- stonemetal 14y agohttp://www.neverworkintheory.org/?p=58 http://www.neverworkintheory.org/?p=58 After controlling for lines of code, most complexity metrics become worthless.
- Silhouette 14y agoCould you, off the top of your head, give a rough idea of what cyclomatic complexity or Halstead complexity corresponds to a "large" project? In fact, given even a very simple code snippet, could you state on a cursory examination what these complexity values would be? Could most people reading this discussion? If not, your alternatives don't serve the required purpose. Everyone gets that a project with 10 million lines of code is big. Whether it's bigger in any useful sense than another project of 8 million lines isn't really the point, and any alternative that doesn't have an immediate intuition for people reading the discussion isn't helping much.
- roel_v 14y agoLOC is not an exact measurement, but it can be (with some context like which language the code is in), a useful approximation of complexity. Your analogy with image size is flawed - it's not a black/white case, 'useful' or 'not useful'. LOC is somewhere in between - useful in some cases, even if not exactly quantified, because other measurements are unavailable or are too complex for a first-order assessment. Let's compare with a movie, one that is constantly updated and worked on by many people, if such a thing exists. Is length of such a movie an exact measure of the complexity of that undertaking? No, but managing such a process for a 10 hour movie will probably be harder than that for a 2-minute one, even if it's just because there are probably many more people working on the 10 hour one.
- deleted 14y ago[deleted]
- DeepDuh 14y agoReminds me of that anecdote about Bill Atkinson (http://stackoverflow.hewgill.com/questions/380/070/7.html http://stackoverflow.hewgill.com/questions/380/070/7.html) and his negative 2000 LOC report.
- anthonyb 14y agoOr Bill Gates and his (apocryphal?) quote about airplanes and weight: http://thinkexist.com/quotation/measuring_programming_progress_by_lines_of_code/338362.html http://thinkexist.com/quotation/measuring_programming_progre...
- snowwrestler 14y agoI think the reference to lines of code here is not to show how great it is, but to show how complex it is.