Last week you might have read about a few examples of parallel algorithms. Today I have one more application that combines the ideas from the previous post.
We’ll use parallel algorithms and the standard filesystem to count words in all text files in a given directory.
The Case In my previous post, there were two examples: one with iterating over a directory and counting the files sizes and the next one about counting words in a string.
A few weeks ago I gave another talk at my local C++ user group. We discussed recent “goodies” from C++ and tools that can increase productivity.
Intro In my post for the “C++ summary at the end of 2017” I mentioned that we could see a considerable improvement in the area of tooling for the language.
This post is motivated by one important comment from my last article about factories and self-registering types:
(me) So the compiler won’t optimize such variable.
Yet, unfortunately, the linker will happily ignore it if linking from a static library.
So… what’s the problem with the linker?
Let’s see pimpl and its alternatives in a real application! I’ve implemented a small utility app - for file compression - where we can experiment with various designs.
Is it better to use pimpl or maybe abstract interfaces? Read on to discover.
Intro In my previous post I covered the pimpl pattern.
Is C++ well suited for writing fast small utilities/tools?
Let’s see:
For my recent giveaway I needed a tool that would take an input file - CSV with data and then draw a few winners from all of the entries. To make things more complicated each entry might have a different weight.
How does your typical coding session in Visual Studio look like?
What’s the first thing you do when you’re about to start coding?
Yes… let’s check Gmail, Youtube, Reddit, etc… :)
OK, please be more professional!
So, let’s assume my Visual Studio (2013, 2015 or 2017) is already started. What to do next?
In June I’ve listed 11 tips that can save your time when doing debugging. As it appears, the article wasn’t that horrible :) I got a chance to update the content, extend the text and publish it on Visual Studio Magazine!
Instead of original 11, there are now 9 separate articles:
Programming is not only typing the code and happily see how smoothly it runs. Often it doesn’t run in a way we imagine! Thus, it’s crucial to debug apps effectively. And, it appears that the debugging is an art on its own! Here’s my list of tips that hopefully could help in debugging native code.
Visual Studio is my main development environment. I’ve been using this tool probably since version 2003…2005. I am really happy that VS is getting more and more powerful these days and you can also use it on multiple-platforms (through VS Code, for web or cloud apps). What’s even better - it’s free for personal use or if you’re a small company (Community Version)!
Maybe I’ll be boring with this note, but again I need to write that this was another good year for C++!
Here’s a bunch of facts:
Visual Studio 2015 was released with great support for C++14⁄17 and even more experimental features. Long-awaited GCC 5.0 was released at the beginning of the year.
Verify you assumptions about tools you use!
Some time ago I was tracing a perf problem (UI code + some custom logic). I needed to track what module was eating most of the time in one specific scenario. I prepared release version of the app and I added some profiling code.
You’ve just recompiled a 3rd party library in Visual Studio, copied the .lib file into a proper directory, added dependencies into your final project… recompiled and it worked nicely! Good. So now you can commit the changes into the main repository.
Then, unfortunately, you got a report from a build server (or from your colleague) that your recent change generated 10s of warning messages about some missing files from this new library… why is that?