By lowellheddings
via johnnysthoughts.com
Published: Nov 04 2006 / 23:47
By lowellheddings
via johnnysthoughts.com
Published: Nov 04 2006 / 23:47
Comments
bloid replied ago:
A nicely written little tutorial that.
But he doesn't take blank lines or comment lines into account, both of which are a good thing.
But I guess spacing and comments push up the LOC -- and as everyone knows, a lower LOC means a better quality product: eg: http://www.dzone.com/links/python_tetris_program_in_just_15_lines.html ;)
Lowell Heddings replied ago:
Good points... I also found a really interesting article that unfortuneately only works for VS2005:
http://www.dzone.com/links/line_counter_writing_a_visual_studio_2005_addin.html
dagi3d replied ago:
I think that if you have 2000 lines of code in a single file there is a problem with your code and you should try to refactorize it
Lowell Heddings replied ago:
No kidding!
atripp replied ago:
Holy cow, all that to count the number of lines in a file???
Get yourself a UNIX or Linux machine or cygwin and type "wc ".
I always wonder to myself how Windows-only people get any work done, and posts like these give me an answer: they don't :(
If you want a real line counter (comments, blank lines, etc.) you can use my free servlet at jazillian.com.
Firewheels replied ago:
Just about my reaction. Need the linecount of a file?
cat file | wc -l
How about the linecount omitting comments?
cat $file | grep -ve "^\/\/|^ \*|^\/\*" | wc -l
Doesn't get much easier than that. YMMV depending on coding style, of course.
Voters For This Link (10)
Voters Against This Link (0)