4 ms·
After doing application-level programming in C for a while at a job, I learned to re-appreciate some of the abstractions that C++ gives you that you have to cod
by sreque 17y ago
After doing application-level programming in C for a while at a job, I learned to re-appreciate some of the abstractions that C++ gives you that you have to code by hand in C. Once you get used to the ridiculous compile errors and slow compilation times, isn't it nice to have access to a built-in string library and efficient data structures? To not have to roll your own implementation of a v-table and inheritance if you want OO? To be able to do compile-time generic programming where the compiler can more easily do things like function inlining?
I'm no longer certain which I consider is the better language to code in overall. I've heard the C++ hate from Yossi Kreinin, Linus Torvalds, Steve Yegge, and other high profile people, and I've experienced the pain and misery of trying to understand and use its more complex features myself, but in the end, for most applications are you really better off sticking with C than using a "tasteful subset of C++" like the LLVM team does?
- ighost 17y agoI wish someone would publish this "tasteful subset of C++," kind of like Douglas Crockford's Javascript: The Good Parts. Then I could just learn that and skip all the crazy template shit.
- mullr 17y agoThey did, and it's called "Effective C++". Okay, it's not exactly the same thing. But they both tell you what NOT to do.
- haberman 17y agoCheck out the Google C++ Style Guide. I'm biased (being a Googler), but I think it leads to pretty nice and readable C++: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml http://google-styleguide.googlecode.com/svn/trunk/cppguide.x...
- Locke1689 17y agoThis is fantastic. My main gripe with C++ in non-system code is that there are too many features which complicate the code base and should never be used. This seems like great guidelines and a good subset.
- ighost 17y agothxu. Too bad it assumes knowledge of C++. I hope I can still follow it with my limited C++ knowledge.