Skip to content(if available)orjump to list(if available)

Modern C

Modern C

24 comments

·March 27, 2025

Alifatisk

What, is auto and constexpr coming to C?! https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3220.pdf#s...

feverzsj

At this rate, they may just switch to C++ mode.

pjmlp

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.

mmaniac

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.

z_open

auto is insane seeing as how it's already a reserved keyword in C.

eska

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++

ndiddy

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.

pjmlp

In the 1980's it was still around in compilers that were K&R C subsets for 16 bit home computers.

jcelerier

It used to be in c++ too and I have never even heard of a conflict this caused

johnisgood

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.

keepamovin

The INRIA page links to a downloadable PDF version here:

https://inria.hal.science/hal-02383654v2/document

null

[deleted]

casenmgreen

[flagged]

cudder

If it doesn't, HolyC might

plexom

Does it walk beside me?

GTP

Is this a reference?

FroshKiller

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

Supernaut

... which in itself is a reference to the song "Get Me to the Church on Time" from the musical "My Fair Lady".

defrost

lyric from Bowie's Modern Love.

defrost

It'll get you up the hill .. backwards.