Comment

Comment by PaulRobinson

Ironic that you've drawn the eye to the thing that needs to be front and center of any C tutorial, and also the thing that makes C so tricky to work with.

When somebody says "This program is written in C", my initial thought is "Which C?". There is no one, single C.

I don't write C daily. Heck, I don't write it monthly any more. And so my grey cells are struggling with which versions introduced what, and you've spotted something I would have missed on a first read.

And this is a problem.

Can you list all the undefined behaviours, and which language features came into which version across ANSI, C99, C11, C17 and C23? The last one feels a little brighter in my mind, but I definitely can't, and if I was writing a C tutorial - like many that have been written - I'd probably be explicit about choosing a version and sticking with it, and good luck and godspeed to everything outside that version.

Of course this is one of the reasons learning C is harder than other languages, and why languages like Zig and Odin have a decent chance: ergonomically simpler than Rust, all the power and flexibility, (much) less of the head scratching.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton