Live data from Hacker News

Why You Should Know C++

unknownprogrammer.com

61–63 of 63 posts

Re: Why You Should Know C++

#61
post #32
post #7

Earlier quoted context omitted.

Windows API is pure C. GTK is pure C. And these are quite serious (and not exactly obscure) development frameworks.

Have you subclassed any GObjects lately? Or otherwise implemented custom GTK widgets? If so, you might know why GTKmm exists (nevermind that PyGTK, GTK# etc are arguably the intended ways to use GTK.) There is a good reason everyone in the Linux world screamed with glee when Nokia LGPLed Qt, and C++ (even the basic stuff) is a big part of that reason.

I'll second that. Qt is a beautiful toolkit. It's just enough C++ to be useful, and avoids all the templates and obnoxious flotsam that makes that language such a horror. Signals and slots work great, and other tools (qmake for example) are a pleasure to use.

Re: Why You Should Know C++

#62

Earlier quoted context omitted.

If I were to extend C by adding python style classes on top of it, I would end up with roughly the same number of keywords. I don't think it's true that C++ has a lot of new concepts in the language itself. I agree that C++ is very library oriented, and it changes your approach to the language, but this is not a fault of the language itself, this is a side-effect of its very wide popularity. If you have a pattern use…

"Templates are not used"? Do you mean that you code C++ without the standard library?

The STL is optional. Templates are widely used in container formats, but in real world programming, for example when people model shopping carts or so, most of the code out there does not use templates. Let's get real here and look at a code repository like codeproject or codeguru - those sites hold diverse examples of real world code - and template usage is minimal.

Re: Why You Should Know C++

#63
post #43

Earlier quoted context omitted.

The difficulty in both languages lies in pointer manipulation and understanding the system below, it does not lie in using classes or templates. That's utterly untrue. The low-level details of C++ are mostly the same as C's, unless you want to write a shared library in C++ and thus need to extern the C++ symbols, or need to worry about the details of the object-system implementation like vtables, or need to mess with…

If I were to extend C by adding python style classes on top of it, I would end up with roughly the same number of keywords. I don't think it's true that C++ has a lot of new concepts in the language itself. I agree that C++ is very library oriented, and it changes your approach to the language, but this is not a fault of the language itself, this is a side-effect of its very wide popularity. If you have a pattern use…

If I were to extend C by adding python style classes on top of it, I would end up with roughly the same number of keywords.

You can use Objective-C as a datapoint here. That's Smalltalk on top of C. You can use the same sort of trick (delimiting the dynamic sends) to recycle the C keywords in the dynamic context, and end up with a language with just a few more keywords than C.

Post reply on HN