Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> C is not that deep.

It absolutely is. Look at its memory model, or look at any StackOverflow question or HackerNews discussion about edge-cases of undefined behaviour. Example: [0]. Alternatively, look at challenging interview questions that require a deep understanding of the C language.

C gives the appearance of being a simple language, but has many dark corners that many programmers are unaware of.

[0] https://news.ycombinator.com/item?id=22867059



Very little of this is relevant for performance. It’s important to know what’s UB so the compiler doesn’t miscompile your code, but most performance improvements don’t come from “oh the compiler can run aliasing analysis on this better so it’s 10x faster” but “this loop is O(n^3)” or “I should convert this linked list to a flat array”.


That's basically what I meant. But even taking all the ugly parts of C into consideration, they are shallow. You don't need to dig into 10 layers of abstraction to get to the bottom of things. And the example posted is about what others say about how to interpret the C standard. I don't care. At the end of the day you can look at the asm output and understand what's happening for the compiler you're using.




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

Search: