4

I am Computer Science student and working on a project in java through netbeans 7.0.1 to be submitted in college, Today my faculty asked me how much your project is completed and i confidently replied that, Yes sir approx 50% completed already, he said how many lines u code, and i just go "Ummmm don't know exactly Sir", he replied, "Are you actually working or just buying it from somewhere!", my mind go blank!!! :D
I googled for this and found a WordCount Plugin for netbeans, but it does not working in NetBeans 7, or may be i do't know how exactly it works..
Any substitute for this WordCount available for NetBeans 7.x?
Or any other way, except manual counting of line in whole application?

asked Jan 6, 2012 at 13:55
4
  • I hope it's a trick question, as lines of code is not a good measurement of completeness or quality! Certainly not word count. Commented Jan 6, 2012 at 13:57
  • Yeah i know, but how can i say this to my faculty??? :D Commented Jan 6, 2012 at 13:59
  • I was thought that software is either ready or not... 50% is not really an answer... I agree with branzzy that lines of code is not a good measurement of quality, none the less completeness... Commented Jan 6, 2012 at 14:09
  • I know the things, learning java programing from a year, i its just my first line 50%, i do not write everything here that i showed the modules that are ready , i explain the profilation, pre-complete testing and all other things, because i don't think it is important to say all here..I've just a simple question, Is there a plugin or code API through which i can count no. of words, lines etc of my code directly...i respect your suggestions but did not need here... Commented Jan 6, 2012 at 14:28

4 Answers 4

6

It's not part of Netbeans, but I use CLOC for this and find it does a nice job - identifies different languages well, reports on how many lines are comments, how many are code and so on.

answered Jan 6, 2012 at 14:36
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks... this is the need of time.. :)
5

Since a 'nix-based answer has been given, in Windows you could accomplish something similar with Powershell:

get-content *.java | measure-object -line
answered Jan 6, 2012 at 14:34

Comments

2

If you are on a unix system the following would work:

$ find . -name *.java | xargs cat | wc
1262 2862 37780

That will merge all the files together into a stream and pass it to wc which will do various counts. The first number is the number of lines.

In the above example, my codebase (from the directory I run it) has 1262 lines.

answered Jan 6, 2012 at 14:00

2 Comments

I wouldn't use windows for that task. Sorry!
@Asif Consider installing cygwin, probably the easiest way to get Windows to be useful.
2

I'd like to suggest an answer to a different question:

How do I quantify progress in a programming project?

I have a preference for agile methodologies, so I would present a burn-down chart - which takes into consideration the total number of user stories/cards/tasks, the complexity/estimated time, and plots it against those remaining.

I think you need to do something simpler, but I expect simpler:

  • Start by breaking your entire project down into units - tasks / bugs / areas of functionality
  • Estimate the amount of effort required for each, and consider the risk + complexity
  • For each unit, assess the amount it's completed - units should be small enough to be completed within a day or two at most.
  • From this you can build statistics

I expect that just the act of project planning will be enough to improve your standing with your faculty as it shows a maturity in understanding there is more to a project than just the code.

answered Jan 6, 2012 at 14:18

4 Comments

very good explanation..very helpful for me as i am a newbe..but did not solve my current question...
I agree that counting LOC is a waste of time, and doesn't prove anything. Identifying function points and counting progress on those is a much better indication of completeness.
I also agreed to that, but it is just the matter of time that i just want to get the quantity of what i code, i am do not going to explain quality aspect of code by no. of lines anyways..
If you have done 10,000 lines of code or 20, doesn't mean you're any closer or further away from completion. It's not like essay writing!

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.