“C is how the computer works” is a dangerous mindset for C programmers
11–20 of 387 posts
Re: “C is how the computer works” is a dangerous mindset for C programmers
#12Re: “C is how the computer works” is a dangerous mindset for C programmers
#13Wait until they learn that machine code is not exactly how the computer works either. The hardware is doing things to your code you might not expect.
Re: “C is how the computer works” is a dangerous mindset for C programmers
#14Re: “C is how the computer works” is a dangerous mindset for C programmers
#15Someone told me back in high school that "C is just shorthand for assembly", which I think about a lot. Does anyone else feel that way?
Re: “C is how the computer works” is a dangerous mindset for C programmers
#16Actually I look forward for enough momentum to be created in the community, to allow new C standards to change the way undefined behaviors are conceived, and make them as specified as possible, and even when they cannot in reasonable unique ways, to provide reference possible behaviors to select in order to have the least unexpected outcome for the programmer. Especially now that low level programming is abstracting…
Dictating that all architectures implement UB the same way would have significant overhead, since it would force programs that don’t rely on UB to run in emulation on all but one architecture (at best).
Re: “C is how the computer works” is a dangerous mindset for C programmers
#17Re: “C is how the computer works” is a dangerous mindset for C programmers
#18Interesting this is less of blog post and more of an announcement that a blog post will not be written.
And yet a content-free post is gobbled up on Hacker News.
If you feel he isn't delivering value then feel free to output your own content instead of contributing to drive down the signal/noise ratio of HN's comments section with inane comments on other people's tastes.
Re: “C is how the computer works” is a dangerous mindset for C programmers
#19Actually I look forward for enough momentum to be created in the community, to allow new C standards to change the way undefined behaviors are conceived, and make them as specified as possible, and even when they cannot in reasonable unique ways, to provide reference possible behaviors to select in order to have the least unexpected outcome for the programmer. Especially now that low level programming is abstracting…
Last I checked UB was undefined by the standard, but compilers still need to define their behavior on each architecture. Dictating that all architectures implement UB the same way would have significant overhead, since it would force programs that don’t rely on UB to run in emulation on all but one architecture (at best).
Re: “C is how the computer works” is a dangerous mindset for C programmers
#20I think what's fair to say is: the "abstract C machine" tends to have a minimal amount of concepts on top of the machines instruction set, compared to other languages, and generally provides the least friction if you need to poke a memory address or layout a structure in a very specific way. It's just easier to say it's closer to the metal because that's a mouthful.