Live data from Hacker News

Modern C [pdf]

icube-icps.unistra.fr

51–60 of 396 posts

Re: Modern C [pdf]

#51
I personally prefer Prehistoric C, which only has the two language keywords "ugh" and "grunt". Modern C has too many keywords for my taste.

Re: Modern C [pdf]

#53
post #52

Another day for the HN crowd to express their distaste for C :)

In a PDF no less. I for one do not miss C (or Objective-C for a long time) at all. I built my first commercial app in C starting in the mid 1985 (Mac). That's how much of an antique this language is.

Re: Modern C [pdf]

#54
It strikes me as odd you'd even go to the lengths of producing such a book. If you really wanted to protect people from the worst vagaries C the book should simply say "don't".

Re: Modern C [pdf]

#56
post #52

Another day for the HN crowd to express their distaste for C :)

Yeah, again and again. it's like blaming a hammer for the potential of breaking your finger when you use it, and proposing the use of a spoon, instead.

Re: Modern C [pdf]

#57
post #52

Another day for the HN crowd to express their distaste for C :)

Yeah, again and again. it's like blaming a hammer for the potential of breaking your finger when you use it, and proposing the use of a spoon, instead.

If the handle of the hammer you're holding was a chainsaw that randomly turns on and off. And also sometimes explodes killing your entire family and pet dog. Don't blame the explodey-chainsaw-hammer, it's just a tool. Okay an idiotically dangerous too that nobody in their right mind should use, but still just a tool.

Re: Modern C [pdf]

#58

Earlier quoted context omitted.

> Would anyone choose C for a new systems project with no legacy baggage or dependencies, in a world with Rust and Go? I imagine it is easier to hire C programmers than Rust programmers, at the moment, especially in fields like embedded development.

Also Rust doesn't support compiling to certain architectures like the Xtensa ISA used in the popular ESP8266 and ESP32 wi-fi chips.

Also, Rusts standard library is simply too big for many embedded systems.

Last time I checked the compiler didn't support bare-metal and resource constrained builds without using crazy hacks. Although the situation may have improved since then.

Re: Modern C [pdf]

#59

I've had no luck learning a language on its own. But I've had a lot of luck learning languages as part of something bigger. Like C# via. Unity, Swift via. 2D game dev in XCode. Any suggestions on what I should apply C to as a way to learn it?

POSIX.

Or unix in general.

I learned C by implementing my own versions of popular unix commands, starting with echo then cat and so on...

Re: Modern C [pdf]

#60
It's nice to see this perspective kept alive. I put some effort into a numerical library (github.com/maedoc/sddekit) in C99, and I didn't find the language lacking until I tried to imitate inherited interfaces with virtual dispatch by hand (empirically I can say, a poor move in C lib design).

I did find it useful to apply rules like only use uint32_t, double & bool as primitives.

My main wish is that it would be possible to opt into automatic const & restrict, as a compiler flag or pragma, so that something like

https://github.com/maedoc/sddekit/blob/master/doc/C.md#alias...

would be easier to do.

Post reply on HN