Ángel Ortega

@angel@triptico.com

ex-writer, ex-programmer, ex-musician, ex-illustrator
ex-escritor, ex-programador, ex-músico, ex-dibujante
40.4231709,-3.6612241
https://triptico.com
0 ★ 1 ↺

Ángel Ortega »

Modern C for C++ Peeps:

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").

History