24 comments

[ 4.3 ms ] story [ 61.3 ms ] thread
I love Modern C by Jens Gustedt. I will stick to the older version without C23, as I prefer C99, but pretty sure this version is great, too. I learnt a lot from reading this book.
[flagged]
Does it walk beside me?
Is this a reference?
Yes, it's a reference to the David Bowie song "Modern Love," whose refrain includes the line, "Modern love gets me to the church on time."
... which in itself is a reference to the song "Get Me to the Church on Time" from the musical "My Fair Lady".
lyric from Bowie's Modern Love.
It'll get you up the hill .. backwards.
If it doesn't, HolyC might
What, is auto and constexpr coming to C?! https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3220.pdf#s...
At this rate, they may just switch to C++ mode.
It won't work, modern C is all about being C++ without classes and templates, while coming up with worse approaches (_Generic), apparently.

Now better ways of doing strings and arrays, no need for something as modern as 1976's PL/I way of doing them.

What's so bad about _Generic?

I would not let the name distract you - it's equivalent to overloading, not "generics" (i.e. parametric polymorphism)

In that capacity I think it's quite a lot more sane than C++. Having a closed set of overloads, not having name mangling, not having complex name lookup rules are all a good thing.

I have made a lengthy comment about why I dislike C23. I cannot find it right now, but yeah, mainly because it is kind of turning into C++ and I do not like that, that is why I will continue sticking to C99. The earlier version of the book is great for that.
I have to say, of all programming languages, C is the one which gets the most strident opposition to the most minor of changes.

I would love to read your reasoning because so far I have not been able to understand the stiff resistance to what I see are very positive changes aimed at cleaning up so much of the mess that is C.

auto is insane seeing as how it's already a reserved keyword in C.
It used to be in c++ too and I have never even heard of a conflict this caused
auto is a historic artifact for porting code from the B language to C, when everything was implicitly int but int did not exist yet. It had absolutely no use afterwards, which is why it was repurposed in C++ as well. In C23 this is done because it is very useful in combination with typeof() in macros, which is a far cry from SFINAE terrorism in C++
I have never seen anyone use auto in code newer than the mid-70s, apart from C++ programmers accidentally using it in a case where it happens to work.
In the 1980's it was still around in compilers that were K&R C subsets for 16 bit home computers.
(comment deleted)