Live data from Hacker News

Deep C and C++ (2011)

slideshare.net

151–160 of 243 posts

Re: Deep C and C++ (2011)

#151
post #126

Earlier quoted context omitted.

> Why are you forcing those two choices? One could be well-versed with the arcana AS WELL AS point out that bit about statically declared variable .. You're the one forcing the choices. He's just saying that one should consider another metric to gauge developers, that is knowledge of good software practices over deep language arcana wisdom. And he's saying that whatever the knowledge depth (or lack of) of a candidate…

>You're the one forcing the choices. "I would much rather [a person do X] than [a person do Y]" I parse this kind of statement as a person doing X is more important than a person doing Y. I stated that I thought both were achievable. How have you parsed it? Also trivia implies some memorized factoids. The entire point of the article is having an understanding of the underlying implementation of the compiler, maybe th…

> Also trivia implies some memorized factoids. The entire point of the article is having an understanding of the underlying implementation of the compiler, ...

That's some of the point of the article, but some of it is also about memorized factoids. There is a lot of focus on what different versions of the C standard say about different things, which is just factoids. There is a lot of focus on how different declaration syntax behaves (statics, linker visible, etc.), which is just factoids.

Re: Deep C and C++ (2011)

#153
post #15

Earlier quoted context omitted.

Arguably if people have such strong understanding of things they will be better programmers too. I would prefer the person who knew what they were doing, because they also know _why_ weird things are weird, and have a better real understanding of what to do and not do. A person who just knows it's "bad code"--but not why--is almost certainly going to leave other bad code from lack of understanding. To pull an example…

However, I'd be concerned that the person with strong understanding of things will simply leave uninitialized static variables lying around in the code simply because they _knew_ it was always initialized to 0. It might work if your entire coding team has that innate understanding, but that is unlikely. Sometimes I think that having deep and expert understanding of a language may cause you to create code that other t…

Again, I think one with deep understanding would know that leaving it unset would result in zero, but also know that initializing it declares intent of the original author, and is thus useful.

Re: Deep C and C++ (2011)

#154
I signed up with HN to get articles related to C, yet they're about as common as hens teeth. I've just executed a word search on this comments page: 18 instances of "static", but no mention of "volatile" or "extern", which is the same situation in several textbooks on C. The article mentioned looking at the assembler output of a program, but didn't give any hints on where to learn some assembly.

Re: Deep C and C++ (2011)

#155
post #28
post #10

People complain loudly about gotchas in JS, but when you look at what C++ programmers have to contend with...

At least C++(11) is a (better) statically typed language :) Although, This isn't even half of it! thanks god the girl didn't know anything about templates.

Templates are a horrid syntax for an okay functional, compile-time language. They can be useful - in quite a few ways an improvement on C macros. I say this as someone who's done quite a bit of C and C++, and am currently working mostly happily in C at work and Haskell on my side project.

Re: Deep C and C++ (2011)

#156

I'm not sure "provide only one way of doing things" is a core principle of C. It at least seems to have fallen to "type less" in several cases: i = i + 1; i += 1; i++; ++i; a[i] *(a + i) a->foo (*a).foo

You left out: i[a]

I considered it, but decided it would be more noise than substance in this particular list. I do like that pun, though.

Re: Deep C and C++ (2011)

#157
post #132

Earlier quoted context omitted.

I think the point was that mathematics relies on a small set of postulates from which you can derive everything else. Changing a postulate results in a separate system. The same is true in programming languages, but the number of postulates is very large compared to mathematics to the point that their utility is greatly reduced. And also there are so many languages each with its own postulate set that it's really ine…

>I think the point was that mathematics relies on a small set of postulates from which you can derive everything else. And I agree, this is one of the assertions my opponent has made. I did not go to refute it because, if not outright false, it's disingenuous. >Another way to put it is, learning the postulates for langx doesn't provide enough value for many to be worth doing. This is also true, same goes for everythi…

Trying to derive C from its postulates is like trying to derive 70s television from its postulates. Most of C is an accident of history.

Re: Deep C and C++ (2011)

#158
post #81

I haven't seen these tricks come into play when solving real problems at ALL. Not saying you should not know the language, but better to have problem-solving skills than rot the standard. The bit about leaving a new line after main tells me she really has memorized the standard.

It's not about tricks, it's about precisely understanding the mechanics of the language. This can be exploited to craft tricks, which is occasionally important. It can also be exploited to avoid gotchas, which is usually important. It can also be exploited to better and more quickly understand what some behavior means when things aren't working as expected, which is always important.

Re: Deep C and C++ (2011)

#159

I love this presentation. It led me to read Expert C Programming [1] by Peter Van Der Linden. My knowledge of C had vastly improved after reading that book (and subsequently C++). Even if you're not a C programmer I would recommend the book as the anecdotes alone are worth reading for the questions that it encourages you to ask. I've since come to believe that reading the specifications and having the attention neces…

"C programming is a craft that takes years to perfect. A reasonably sharp person can learn the basics of C quite quickly. But it takes much longer to master the nuances of the language and to write enough programs, and enough different programs, to become an expert. In natural language terms, this is the difference between being able to order a cup of coffee in Paris, and (on the Metro) being able to tell a native Parisienne where to get off." The behaviour of this quote from the beginning of Linden's book is, strictly speaking, undefined. I interpreted it as being able to give instructions to a native Parisian, in order to find the nearest red-light district.

Re: Deep C and C++ (2011)

#160
post #154

I signed up with HN to get articles related to C, yet they're about as common as hens teeth. I've just executed a word search on this comments page: 18 instances of "static", but no mention of "volatile" or "extern", which is the same situation in several textbooks on C. The article mentioned looking at the assembler output of a program, but didn't give any hints on where to learn some assembly.

I've noticed that the internet contains information about various assembly languages. I would suggest googling for their manuals.
Post reply on HN