Live data from Hacker News

Deep C and C++ (2011)

slideshare.net

71–80 of 243 posts

Re: Deep C and C++ (2011)

#71

This was good, but… Hermione (I'm sure that's her) rates her C++ knowledge at 4-5, and Stroustrup himself at 7!? Bullshit. Either they are poorly calibrated, or they are displaying false modesty. Sure, they probably still have plenty to learn about C++, but come on, Hermione is already at the top 97% in terms of language lawyering. Wanting to be stronger is good. Not realizing you're already quite strong is not so go…

It's real, it's called the Dunning-Kruger Effect. I've seen it plenty of times with real superstar-experts rate themselves as "slightly above average"...

http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

Re: Deep C and C++ (2011)

#72
post #66
post #65

Earlier quoted context omitted.

[deleted]

Ooh. I remember "Dynamic-C" and its built-in support for coroutines. TI and Microchip had their own quasi-proprietary extensions to C, but I don't think I ever saw anyone go as far as Rabbit did.

Sorry I deleted my original comment as I thought it might be too off-topic.

Yes, Dynamic C had built-in coroutines :) I think it's hard for me to use threads now because of how convenient a single-threaded main loop with coroutines is. A lot of concurrency "problems" vanish when you realize you as the programmer are controlling the context-switching and that race conditions are implicitly not possible then.

I went so far as to write my code so that it compiled in GCC and Dynamic-C to speed up development time (not needing to wait for the 2 minutes it takes to compile and reflash), which meant abandoning all those things and re-implementing them in a cross-platform way buried in a mountain of #ifdefs

Although I can't remember all the details now (5 years since I touched that compiler) but I still have a lot of deep seated hatred towards it for reasons I can't remember clearly :)

Re: Deep C and C++ (2011)

#74
post #6

The girl forgot to mention exception safety on the class A slide, no hire.

Right, like what happens with the memory allocated for px in situation like below, if new ClassY throws?

A::A() : px(new ClassX), py(new ClassY) { }

Re: Deep C and C++ (2011)

#75
post #27

Earlier quoted context omitted.

Yes, this worries me. Especially today some people think "great programmers" are the ones who knows all the "fashionable" tools and frameworks, wants to abstract everything (god help him if he install vim in his test environment without a fab file that configures chef) and maybe worships Uncle Bob Knowing how to use Redis is cool, do you know what's even cooler? Being able to write it (or at least knowing how it work…

I'll rather pay an artist to paint me a nice piece using store bought paint than making his/her own paint. Each programmer is great in their own right.

I'll rather pay an artist to paint me a nice piece using store bought paint than making his/her own paint.

That's fine if you just need a nice picture to hang on your wall, but probably won't work if you want a genre defining piece that that redefines how artists think about the color blue.

Re: Deep C and C++ (2011)

#76

A college student in CS here. I'm always impressed by people with deep understanding of programming language internals and try to pick up as much about programming language internal workings and compilers as I can. How does one get really good at this? Is it by spending a lot of time programming and building stuff? Is it by reading books/blogs/articles about programming languages? Any recommendations for such resourc…

Everyone else's advice to learn by doing is great, but there is also _Expert C Programming_ by Peter van der Linden:

http://www.amazon.com/Expert-Programming-Peter-van-Linden/dp...

The presentation's "Deep C" pun is a reference to this book, and if you make it all the way to slide 444 you'll see it mentioned as further reading. It's a wonderful book for understanding C (not C++) and what's really going on.

Re: Deep C and C++ (2011)

#77
What bizarre nonsense. I hope nobody thinks this level of (mis)understanding is replacement for understanding, you know, how to program.

The majority of this is undefined behavior or implementation details of your compiler. If you rely on that, I don't want your code anywhere near my machine.

Re: Deep C and C++ (2011)

#78

What bizarre nonsense. I hope nobody thinks this level of (mis)understanding is replacement for understanding, you know, how to program . The majority of this is undefined behavior or implementation details of your compiler. If you rely on that, I don't want your code anywhere near my machine.

I think you missed the point. It is more about coder's attitude than about using (or not using) the presented examples in real code. I wouldn't like to work with a programmer than writes shitty code accidentally relying on UB, and denies every criticism by saying "it works, so what's up?".

Re: Deep C and C++ (2011)

#79
post #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.

I didn't have any trouble with the C examples, but with C++ it just puzzles me why people would want to use a language like that in the first place. What does it buy you except bigger head aches?

It buys you the speed of C (or close), with nice abstractions. And when you use destructors correctly, it can provide pretty much automatic memory management too, much safer than C.

And it's pretty simple to avoid all these warts, just... you know don't write them. On the other hand I don't have any experience with old C++ codebases, which is where you're likely to find this hellish stuff.

Post reply on HN