5 ms·
It’s cool to have these, it’s fun to use them for fun. But please don’t use them in production code. Also don’t assume most of them will he known by other devel
by neverrroot 4y ago
It’s cool to have these, it’s fun to use them for fun.
But please don’t use them in production code.
Also don’t assume most of them will he known by other developers.
- suprjami 4y agoProfessional C developers definitely should be using at least designated init and FAM, standard features both added in C99 and currently 24 years old.
- neverrroot 4y agoWell, it’s either a lesser known trick or it’s something people should be using. In general using lesser known tricks it’s not a good idea for production code. But I understand there are cases where there is no good alternative, so it’s warranted.
- suprjami 4y agoMy point is that these aren't "lesser known tricks". They're important language features which solve real problems and which anyone writing production C should be at least aware of, if not actively using for the advantages they provide.
- neverrroot 4y agoI was taking for granted the storyline, and assumed they are indeed lesser known and tricks. To me it’s never about what I know, it’s about what the others know, my production code is not mine alone, and I also don’t want to be responsible for it forever. So I try to be explicit and use no tricks wherever possible.
- suprjami 4y agoI agree with this in principle, but where do you draw the line between language features (good) and obscure tricks (bad)? Is your team really writing only ANSI C89 from the K&R 2nd edition book and ignoring the last ~35 years of language improvements?
- Jorengarenar 4y agoI mean, I titled the article "Lesser known trick, quirks and features of C". Not to mention the very first sentence: > There are some tricks, quirks and features (some quite fundamental to the language!)
- Jorengarenar 4y ago>Also don’t assume most of them will he known by other developers. Given the title of the article, one ought to assume the opposite ;)
- Gigachad 4y agoPlease don’t use C at all in production if you can help it.
- jjgreen 4y agoSo no Unix, Linux, Bash, cURL, Ruby, ...?
- suprjami 4y agoNo Windows or OSX either (yes I know OSX is a Unix). Looking forward to all the RIIR people using Redox as their daily driver.
- icedchai 4y agoThe entire world runs on C. Even if you’re not writing new C code, it is useful to understand.
- flohofwoe 4y agoSome of those are regular modern C features and definitely should be used, most importantly compound literals and designated init, since they make the code both safer and more readable (and I blame the Visual Studio compiler team for dragging their asses for 16 years to support at least a subset of C99 for those features to be 'lesser known').