Useful to learn.
Word Counting in C++: Implementing a Simple Word Counter
by Jonathan Boccara
From the article:
Word counts can reveal information about your code, or make an unknown piece of code more expressive to your eyes.
There are online tools to count words in generic text, but most of those I’ve come across are designed around counting words in text and SEO (Search Engine Optimization). Since analysing source code is not the same thing as analysing the text of a blog post, let’s design a tool fit for our needs of counting words in code. This way, we will be able to make it evolve when we discover new tasks to try with our word counter.
Another reason to write our own word counter is that it will let us practice interface design, and also STL algorithms, which are useful to master for coding in C++.
For this first version of our word counter, the objective will be to put together a working prototype. Then we will improve it over future posts, by adding features and by refining its implementation...
Add a Comment
Comments are closed.