C++ gripes #1: static functions as friends
While programming as a an activity is something I, as many others, derive joy out of, there are obstacles that make it less appealing from time to time. One of those obstacles is C++. I know picking on C++ is a bit of a fashionable thing to do at the moment, but it's no wonder why: the language is easy to pick on (and it's widely used, for what ever historical reason). Well, lately I've been involved in a project utilising sepples and it's features heavily, and here's my latest gripe with the language: headers polluted with implementation details.
In C, if you want to write a static function inside your source file, unknown to the header file, and the function manipulates some data structure defined in the header, you can. For example:
foo.h: ---------------------------- struct my_struct {int x;}; ---------------------------- foo.c: ---------------------------- static void _modify_struct(struct my_struct *s) {s->x = 5;} ----------------------------
So yeah, I'm not a fan of sepples.