Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think to learn C/C++ it's helpful to have a mindset of wanting to understand the machine rather than build code. It's of course great fun to use Python's built in maps etc (and C++ has equivalents) but what you can do in C/C++ that you can't in Python is create the raw data structures down to the exact memory locations where they'll be used. One of the ways to learn C++ is make a relatively complex data structure (red-black tree, or bloom filter) and then throw as much data as you can inside it, see when you cross a threshold of memory usage -- then see if you can improve on that.

Having said that, C++ has come a long way, despite what haters say. I program primarily in C++ and very rarely have to use pointers. C++11/14 has excellent features (lambdas, initialization lists etc) which can make programming almost seem like writing a Python or Ruby script.

You may also have some luck with Bjarne's smallish "Tour of C++" book -- http://www.stroustrup.com/Tour.html



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: