Live data from Hacker News

Deep C and C++ (2011)

slideshare.net

1–10 of 243 posts

Re: Deep C and C++ (2011)

#2
> Why do professional programmers write code like this?

Because we 1) for some reason or another we _must_ use C or C++, 2) we're coding for a single CPU platform, and 3) we need to get the friggin' job done in this century.

Re: Deep C and C++ (2011)

#4
Heh, and they didn't even get into the aliasing rules. In embedded software, life would be a lot easier if I could hit every engineer who wants to type-pun without a union in the head with the ISO standard.

For this reason, a lot of compilers have options to not strictly enforce the aliasing rules

[edit] Also C and C++ are both permitted to reorder structs, it's just that they don't because that's the easiest way to follow the standard.

Re: Deep C and C++ (2011)

#5
It's a good discussion of the behind the curtains working of compilers

But I'm very aware of "smart code" and we shouldn't be writing code that relies on the details (especially ones that might change between compilers)

Re: Deep C and C++ (2011)

#7
I'm not so jaded as to think that deep language understanding isn't a useful or good thing, and I'd like to think I have some myself. However, deep language understanding is not what separates the great engineers from the good ones.

In an interview, I would much rather hear a person say something about a statically declared variable with no initialization being poor code to leave behind for the next person than some arcana about the standard.

Re: Deep C and C++ (2011)

#8

It's a good discussion of the behind the curtains working of compilers But I'm very aware of "smart code" and we shouldn't be writing code that relies on the details (especially ones that might change between compilers)

But we should certainly be aware both of what the language requires of the compiler and of potential pitfalls.

Re: Deep C and C++ (2011)

#9
I've been a C developer (among other things) for about 20 years or so, but I've always described my C++ skills as being "in the C with objects" range, I might have to change that to being "nearly in the C with objects" range.
Post reply on HN