• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

calculating LLOC

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi there ive asked this b4 but i had no luck of understanding the answer. I began to experiment with code but failed so im asking again "how do i calculate the number of Logical Lines Of Code (LLOC) in a Java source code file"
is there a tutorial i can learn from even some code i can experiment with.
thanks people.
 
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As far as measuring lines of code goes, I'm afraid I can't add anything above what others have already said.
However, as far as the utility of counting lines of code as some sort of metric goes, I'm afraid that I'm very cynical. From my experience, the only utility of counting lines of code other than as a general indication of software complexity goes is is management is looking for something to flog the programmers with.
I can write some pretty tight code, though it may take longer to create. I can make it even tighter by omitting error-checking code (after all, that's non-productive code, right?). If I choose, I can even do the infamous obfuscated code trick, where the entire program is compacted into a single statement full of postfix operators, embedded multiple assignments and other dangerous tricks.
Conversely, I can unravel lots of code, do a lot of cut-and-paste work without doing any cleanup and otherwise be very sloppy but produce thousands of lines of code a day.
In either case, the "bean counters" may be happy, but the quality of the software - and thus, its usability and long-term cost - is likely to suffer.
Personally, I am one of those who think that "function points" are a better metric. The more decisions in a component, the more labor it will require and the more likelihood exists for bugs. However, any attempt to have technology mindlessly scan for "good" and "bad" is to me an abdication of managerial responsibility. Software isn't a uniform product like cheese. Sometimes the best solution is one that annoys the metrics.
By all means measure, but don't let the measurements become the goal at the expense of the product.
 
But how did the elephant get like that? What did you do? I think all we can do now is read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic