Ángel
@angel@triptico.com
Location: 40.4235492,-3.6617828
76 following 89 followers
https://floooh.github.io/2019/09/27/modern-c-for-cpp-peeps.html
I find the article interesting not only for C++ "peeps", but for us greybeard C programmers as well, who learnt the language in the eighties. Remarkable sections in the document are:
- Use struct wrappers for strong typing (I've never done this, but it's interesting; accessing the components inside the structs may become a bit tedious, though).
- Initialization in C99 (I haven't used this to its full potential).
- Don’t be afraid to pass and return structs by value (as an old fart, I always pass pointers to structs, and this section reasons otherwise for small structs).
- Named optional arguments (or, as the author more accurately describes this, the "option bag").