curmudgeon / cascarrabias

Ann Hell Musichttps://exode.me/accounts/annhell
GPG KeyB498DDC28F4584FF
0 ★ 1 ↺

Ángel »

Modern C for C++ Peeps:


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