Purpose:
- Primary purpose is for my personal use; this is a collection of functions I commonly use in c++ projects. I like c++ for both large and small projects, however it can be tiring to rewrite the functionality that can be found standard with a python install. Therefore, as I write a 'utility' or 'helper' function I tend to save it in this 'library' to make my future life easier.
- Secondary purpose is for others to use this code, for the same reason as stated above.
- Finally, I wanted to write common functions that are easily readable AND understandable by others. When I was starting out with c++ I had a hard time finding code that was both useful and easy to understand. Trying to browse through the boost or STL libraries was an absolute nightmare (NOTE: I'm in no way comparing this to either of those) and SO/reddit answers are often specific to a single task with little context making them hard to learn from for novices.
Thoughts & Comments:
- The functions have been tested by myself (an older version was used by others, thanks Andrew). While I handled the obvious bugs before posting this I'm sure there are bugs I missed. Additionally, as this was designed for readability I make no guarantees about what systems this will and won't work on; it's been tested on OS X with clang and Ubuntu 16.04 with gcc and clang, those systems should should be fine.
- Performance was not a main design criteria. There are a handful of instances in numutils, strutils, and the entire design of dbHelper where readability was intentionally chosen over performance. This is not to say these functions are 'slow', however people with a lot more experience than myself have spent a lot of time optimizing and debugging libraries like boost, therefore if performance is your main criteria there are better options in some cases.
- This has been designed to be as modular as possible, only a few of the files have internal dependencies, no external (non-standard) libraries are required. If you don't want to include something massive for a small amount of functionality you're in the right place.
- Header only! The opinions on this go back and forth; and I actually tend to fall on the side of linking against compiled libraries. However, with the goals of ease of use, modularity, and readability the header only approach seemed like the obvious answer. Additionally, it's a small library, there won't be any boost-like compile time penalties.
- Some basic examples can be found in the examples/ directory. They are not comprehensive but they do demonstrate basic usage.