Live data from Hacker News

Master C++ Programming with Open-Source Books

ossblog.org

91–100 of 106 posts

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

#91

Earlier quoted context omitted.

And that's the real problem with C++. You can spend 20 years solving real problems with it and still feel like a noob when you take a look at "idiomatic" template code from the standard headers. On the other hand, people like Scott Meyers have spent their lifetime and careers explaining its intricacies, without solving any real problems.

You can spend 20 years solving real problems with it and still feel like a noob when you take a look at "idiomatic" template code from the standard headers. It can be misleading to think of standard header code (especially template code) as "idiomatic C++". It'd be better described as "idiomatic standard-library-implementor C++", since the folks implementing stuff in std are operating under a whole set of constraints…

Yes, and I think this same principle is roughly true for a lot of programming language implementations. It's one of the reasons it pays off to know some details about your implementation -- People should always keep this in mind.

Designers and implementors are traditionally under a very different set of constraints than "average users" (who in this case are programmers), though their goals do align. But this leads to very different set of assumptions, optimizations, and tools being available. Things that would generally be overkill are suddenly very viable and worthwhile goals to achieve (e.g. micro-optimizations add up repeatedly so they're very worth it, vendoring is much more useful to control dependencies/scope of bugs), and vice versa.

So I wouldn't be extremely miffed if you look at libstdc++ or libcxx or and find it somewhat unkempt or gross compared to average code. It's often very much not-average. In fact it's likely given careful understanding of the constraints that code exists under -- you'd come up with similar results.

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

#92
post #66

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…

> The text is full of bloat, for the lack of better word. It's the opposite of crisp writing. You mean somewhat similar to the programming language the same person developed?

I'm glad I'm not the only one.

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

#93

Earlier quoted context omitted.

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.

For me personally, that would be a positive statement. I don't think any good programming language can stay good unless it keeps evolving (and yes, to me, C++ counts as one despite the occasional gotcha it comes with). That is - any language except for Lisp :-) And to be frank: I'd say that anyone opposed to continue to learn new things is entirely in the wrong field if he/she works on any technology-related job.

I mostly agree with you. However, there's something to be said for being conservative and not always tweaking things. C++11 is amazing. I'm still working to solidify my knowledge in it and haven't even peeked into c++14 or higher yet.

However, constantly learning and updating things has its drawbacks. One of the rare times I tried to be hip and use the latest stuff, I tried rewriting parts of a small Android app of mine using java 8 and lambda closures. I made it work, but it required upgrading my minimum build version (locking out older devices), the compiler could barely handle it (gave some strange indecipherable errors relating to lambdas), and ultimately it was just a step backward. That kind of thing really frustrates me, because it's wasted (at best, deferred) effort.

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

#94

Earlier quoted context omitted.

For me personally, that would be a positive statement. I don't think any good programming language can stay good unless it keeps evolving (and yes, to me, C++ counts as one despite the occasional gotcha it comes with). That is - any language except for Lisp :-) And to be frank: I'd say that anyone opposed to continue to learn new things is entirely in the wrong field if he/she works on any technology-related job.

I mostly agree with you. However, there's something to be said for being conservative and not always tweaking things. C++11 is amazing. I'm still working to solidify my knowledge in it and haven't even peeked into c++14 or higher yet. However, constantly learning and updating things has its drawbacks. One of the rare times I tried to be hip and use the latest stuff, I tried rewriting parts of a small Android app of m…

Learning the shortfalls of new technology isn't wasted effort.

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

#95

Earlier quoted context omitted.

For me personally, that would be a positive statement. I don't think any good programming language can stay good unless it keeps evolving (and yes, to me, C++ counts as one despite the occasional gotcha it comes with). That is - any language except for Lisp :-) And to be frank: I'd say that anyone opposed to continue to learn new things is entirely in the wrong field if he/she works on any technology-related job.

I mostly agree with you. However, there's something to be said for being conservative and not always tweaking things. C++11 is amazing. I'm still working to solidify my knowledge in it and haven't even peeked into c++14 or higher yet. However, constantly learning and updating things has its drawbacks. One of the rare times I tried to be hip and use the latest stuff, I tried rewriting parts of a small Android app of m…

On one hand, I'd agree with you on that; I think we all know the urge to "modernize all the things!", whenever a language implements something new and shiny. And there's definitely much merit to resist that urge to some degree. However, it also is rarely really necessary to do this all in one go; one can also polish things up with strategies like the boyscout rule. And if there is no test for a piece of code - maybe leave it until you have corrected that.

Being conservative with new additions to your codebase seems a bit backward, though. Why not use the new, improved shiny language feature™ if you can?*

Of course, if you are prohibited by business requirements (e.g. missing modern compilers for a certain target platform) that's another story. Basically, it always comes down to practicality.

* A prime example would be the new way you can implement Singletons with C++11. Once you've used that, you realize how horrid pretty much all C++98-based attempts at this are.

Yes, I realize Singletons are often a bad idea.

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

#96
post #83

The best place to master c++ is StackOverflow. Many people share knowledge accumulated from experience and they explain much better than Herb Sutter or any gray beard people in C++ community. Another important thing, no matter how many books you read, you can't be a master without actually solving a lot of problems.

SO is a great resource but it's about as good a place to learn something as Wikipedia is to do serious research. Questions from learners are often poorly formulated and then poorly answered. Since many people are just looking for getting their code to run or finishing their homework, this sort of stuff just piles up without getting fixed. If you're trying to learn anything non-trivial, don't rely on SO alone.

SO launched a new feature recently called Documentation. Check out the C++ section [1]. Personally, I'm enjoying it a lot. I think they managed to find a very concise way of showing the basic grips of a language and some advanced ones. Most stuff are through examples, which I think works better when you're already familiar with the language, and just wants to do some specific thing. From time to time, I find myself on the page surfing through the C++ topics.

[1]: http://stackoverflow.com/documentation/c%2b%2b/topics

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

#97

The best place to master c++ is StackOverflow. Many people share knowledge accumulated from experience and they explain much better than Herb Sutter or any gray beard people in C++ community. Another important thing, no matter how many books you read, you can't be a master without actually solving a lot of problems.

There is a lot of wrong and dangerous advice on Stack Overflow about C++. I also disagree that it is good as a learning tool. The C++ Annotations book linked to will much better place to master C++. As it turns out, 'gray beard people in the C++ community' actually know the intricacies of the language, and you better learn them too otherwise you're never going to be productive with it.

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

#98

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…

That's his reference book. It's not designed for systematic learning. It's designed as a reference, as in "cut-and-paste stuff". You want one of his other books, meant to take you from zero to literate in not just C++11 but programming in general: https://www.amazon.com/Programming-Principles-Practice-Using...

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

#99
post #63

I didn't see Bruce Eckel's Thinking in C++; the PDF is free: http://mindview.net/Books/TICPP/ThinkingInCPP2e.html I thought Eckel's book was especially good for someone who already had a background in C.

Anything that hasn't been updated to take into account C++11 is going to do more of a disservice than be of help.

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

#100
post #97

The best place to master c++ is StackOverflow. Many people share knowledge accumulated from experience and they explain much better than Herb Sutter or any gray beard people in C++ community. Another important thing, no matter how many books you read, you can't be a master without actually solving a lot of problems.

There is a lot of wrong and dangerous advice on Stack Overflow about C++. I also disagree that it is good as a learning tool. The C++ Annotations book linked to will much better place to master C++. As it turns out, 'gray beard people in the C++ community' actually know the intricacies of the language, and you better learn them too otherwise you're never going to be productive with it.

please show some 'wrong or dangerous' advice on SO with more than 10 upvotes.
Post reply on HN