Live data from Hacker News

Master C++ Programming with Open-Source Books

ossblog.org

51–60 of 106 posts

Re: Master C++ Programming with Open-Source Books

#51
post #41

Can you ever really master C++? I've been at it more than 20 years and I'm still delighted to learn new things about the language and the library.

For me, that's the standard argument about C++ having unnecessary complexity. You don't keep learn new stuff because C++ is super, uber, powerful. It is because it is not designed well and there are far too many dark corners.

As I answered in another comment, I keep learning new stuff because the language is alive and evolving. IMHO it's getting safer and easier to use and understand.

Re: Master C++ Programming with Open-Source Books

#52
post #35

Earlier quoted context omitted.

>thinking it's the K&R of C++. You nailed it with that analogy though. K&R is a "first book" and important historically, but right now it's an atrocious book if you want to learn current C and this has been the case for a long, long time. Sometimes these first books don't withstand the test of time.

What's a good book for learning current C?

Ben Klemens' 21st Century C is good.

Re: Master C++ Programming with Open-Source Books

#53

Can you ever really master C++? I've been at it more than 20 years and I'm still delighted to learn new things about the language and the library.

I've been at it more than 20 years and I'm still delighted to learn new things about the language and the library. And it's under active revision and improvement. There are great new things to learn every few years.

I feel like I'm slowly marching toward a mirage. In a way, I dread the c++14/17 changes because it means that much more that I'm going to have to learn. Even if they stopped revising the language today, I'm probably going to learn my last C++ factoid on my deathbed.

Re: Master C++ Programming with Open-Source Books

#54
post #38

Earlier quoted context omitted.

Make the language easy to use without any mental burden? But you do realize programming is not easy, especially when you're aiming for high performance. How can you make a language easy to use "without any mental burden"? Programming is hard, programming well and with performance in mind is even more so. Some things you just can't magically make easy.

You can program with "performance in mind" in C and the big difference will be that the problem itself will be the obstruction, not the language. In C++, you fight with the language first and then face the problem.

I actually feel the exact opposite when I program in C. C is so bare that most of my time is spent building the correct constructs I need to solve my problem. C++ on the other hand has a decent set of high level features that makes it easier for me to focus on the problem.

Re: Master C++ Programming with Open-Source Books

#55
post #14

Earlier quoted context omitted.

> It has a few standards, which is the problem. You mean C++03, C++11, C++14, C++17? Or something else? If you mean those, I fail to see the problem. The language isn't dead, so it's not static, and it evolves over time. Publishing a new standard every few years is the only way to keep all compilers aligned, rather than each going off in its own "with extra features!" direction.

Yes, those. The differences between standards aren't trivial, and often the older standards have to be maintained. The standard already has lots of features, including a turing-complete sub-language. It is difficult to write code to standard (nothing that works, but is undefined either), that is safe, no segfaults, memory issue, secure, and all within a practical budget/timeline. Just being able to reason about the c…

> and often the older standards have to be maintained

exactly! what's wrong with that?

Re: Master C++ Programming with Open-Source Books

#56
post #35

I have some C programming experience and I wanted to learn C++ so I bought and started reading Stoustrop's book, thinking it's the K&R of C++. It's the worst programming book I have ever read! It's introduction made me hate C++ and if I didn't had to work with other C++ libraries, I would have avoided C++. The text is full of bloat, for the lack of better word. It's the opposite of crisp writing. I read some good lan…

>thinking it's the K&R of C++. You nailed it with that analogy though. K&R is a "first book" and important historically, but right now it's an atrocious book if you want to learn current C and this has been the case for a long, long time. Sometimes these first books don't withstand the test of time.

That's not entirely fair - it's not just about being first.

K&R may be archaic now, even obsolete. However, for decades it has was held up as a an example of what a good technical/language book could be. You don't have to agree with the assessment to agree with the fact - that this was touted as a very good technical book for various reasons.

There never was a "K&R" of C++. That's not unusual, many languages are in the same boat. If you want to go back to the "firsts" it would be a combination of The C++ Primer and Strousoup, putting them together gave you something that was both more and less that K&R was for C.

Re: Master C++ Programming with Open-Source Books

#57
post #35

I have some C programming experience and I wanted to learn C++ so I bought and started reading Stoustrop's book, thinking it's the K&R of C++. It's the worst programming book I have ever read! It's introduction made me hate C++ and if I didn't had to work with other C++ libraries, I would have avoided C++. The text is full of bloat, for the lack of better word. It's the opposite of crisp writing. I read some good lan…

>thinking it's the K&R of C++. You nailed it with that analogy though. K&R is a "first book" and important historically, but right now it's an atrocious book if you want to learn current C and this has been the case for a long, long time. Sometimes these first books don't withstand the test of time.

> but right now it's an atrocious book if you want to learn current C and this has been the case for a long, long time.

Strongly disagree.

Re: Master C++ Programming with Open-Source Books

#58
post #35

I have some C programming experience and I wanted to learn C++ so I bought and started reading Stoustrop's book, thinking it's the K&R of C++. It's the worst programming book I have ever read! It's introduction made me hate C++ and if I didn't had to work with other C++ libraries, I would have avoided C++. The text is full of bloat, for the lack of better word. It's the opposite of crisp writing. I read some good lan…

>thinking it's the K&R of C++. You nailed it with that analogy though. K&R is a "first book" and important historically, but right now it's an atrocious book if you want to learn current C and this has been the case for a long, long time. Sometimes these first books don't withstand the test of time.

True, but it maintains a cult following, for lack of better wording.

Re: Master C++ Programming with Open-Source Books

#59
post #56
post #35

Earlier quoted context omitted.

>thinking it's the K&R of C++. You nailed it with that analogy though. K&R is a "first book" and important historically, but right now it's an atrocious book if you want to learn current C and this has been the case for a long, long time. Sometimes these first books don't withstand the test of time.

That's not entirely fair - it's not just about being first. K&R may be archaic now, even obsolete. However, for decades it has was held up as a an example of what a good technical/language book could be. You don't have to agree with the assessment to agree with the fact - that this was touted as a very good technical book for various reasons. There never was a "K&R" of C++. That's not unusual, many languages are in t…

I first studied the K&R in the early 90s, and it was already terrible by then. Especially if you wanted to teach anything other than quirky systems programming.

From the software engineering point of view, almost every single code example is terrible. Abundant implicit casts depending on the OS, loops that leak buffered reading between iterations, etc etc.

Just no. Never, ever recommend K&R to anybody as a general programming book neither for C or in general. Only the intro descriptions of language characteristics and important functions of the standard library are any use, and then again even these are extremely obsolete now.

Re: Master C++ Programming with Open-Source Books

#60
For absolute beginners, The Rooks Guide to C++ is out there. (It is mentioned on the article)

Open source at: https://github.com/jeremyhansen/rooksguide-cplusplus

Previously discussed at https://news.ycombinator.com/item?id=6806598

Full disclosure: I joined as a technical editor on the kickstarter just before publication.

Post reply on HN