Hacker News new | past | comments | ask | show | jobs | submit login

...which is lower than the number of platforms with a C89 compiler. A lot of popular projects known for their high portability are C89 for this reason.

There's also the fact that there are far more compilers for C89, and it is easier to write one than for the newer standards. This becomes important if you are interested in avoiding Ken Thompson attacks.

Personally, I still stick to C89 and the only newer feature that I've found to be useful is mixed declarations and statements, but it's no big loss as it both avoids the "variable proliferation" that some codebases seem to be afflicted with, and blocks can be used to start a new inner scope if you really need a new set of declarations anyway.




I'm so glad to not be the only weirdo out there just sticking to plain old C89. I concur to all your reasoning. C89 is simple, readable, gets the job done.

My only pain point is indeed stdint.h. Though it's often available everywhere even if not standard per se.


What are Ken Thompson attacks? I searched online but did not find anything informative. Can someone explain what these attacks are?


Which search engine? DuckDuckGo had a useful result right at the top https://duckduckgo.com/?q=Ken+Thompson+attacks > https://softwareengineering.stackexchange.com/questions/1848... (although the answer to the linked question https://softwareengineering.stackexchange.com/questions/1947... explained better to me).


They're actually called trusting trust attacks (the original paper on the topic is "Reflections on Trusting Trust" if you want a guarranteed search term); I'm not sure why userbinator used a eponym instead.

I'm also not sure why they would be relevant for a general project, since the source language being easy to write a alternate compiler for only matters for the compiler itself: once you have non-infected compiler, you can bootstrap gcc or whatever and compile everything else at whatever C standard you like.


I'm not sure why userbinator used a eponym instead.

It's the first thing that came to mind when I thought of the concept. Perhaps this discussion may yield some additional insight: https://news.ycombinator.com/item?id=24385389


See "Reflections on Trusting Trust"


Is there an equivalent of babel.js for C, which would translate C99 into C89?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: