Jump to content
  • Advertisement
Sign in to follow this  
BBB

Code counter for DevCpp

This topic is 5425 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
You could just chuck this into a batch file:

@echo "linecountfile" > counter.txt
@for /r %%f in (*.c;*.cpp;*.cxx;*.h;*.hpp) do @type "%%f" >> counter.txt
@find /c " " counter.txt
@del counter.txt

And it'll do it for ye. Not super efficient, but it works.

Share this post


Link to post
Share on other sites
I wrote a tool that uses .NET and accomplishes what you need. You must have the .NET 1.1 Framework installed (Available from Microsoft.com) but here is the download to the app.

Catalogs different languages across multiple directories too.

Hope that helps,

~Graham

Share this post


Link to post
Share on other sites
BBB:

If you do not change your "style" of coding, you'll never succeed in the industry at all. Your methods are unpractical, and some are even asking for errors. For example, the fact you put small functions in your header (which would then require inline always) could cause nasty redefinition errors. You also must get confused really easy if you can not keep member functions of the same class in the same CPP file. I don't know how you do it, but it's obviously not working too well for you if you can't even count the lines of code :).

Share this post


Link to post
Share on other sites
I would like to add my two cents to the argument on coding style.

In my experience I have had trouble with large files and finding the relevant code sections when I need to, epically in other peoples code.

I if you have ever tried to program without an IDE and only a basic text editor then you will know, as I have when I learnt Java, that large project can get overwhelming.

That is why IDE's were invented. Forget about navigating by files, use the class/function browser. The best IDE GUI's enable you to have many files open at once allowing you to navigate easily between code section of large files.

Admittedly Dev C++ has its class/browser function problems but it does work.

It just seems to me that BBB is re-invent the wheel when it comes to code navigation, by using the file browser, instead of the class/function browser.

GGamer

Share this post


Link to post
Share on other sites
Quote:
Original post by BBB
And btw the batch file is buggy, i get another result when i
count the lines manually.

It only counts lines with spaces in them, which will be almost any line, except completely empty ones.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!