Jump to content

C or C++? Which do you choose?

Featured Replies

  • 3 months later...
Originally posted by Syntax

Well C++ is known to be bad for kernel programming, plain C is what I've mostly seen. I think Linus Torvalds posted something about the cons of programming the kernel with C++.

Linus Torvalds is somewhat of a dweeb. I've written a small x86 kernel in C++, and I think it's a very suitable language. The only disadvantage of using C++ in a kernel as opposed to in user-level is the lack of runtime type information in the lowest parts, which makes using virtual functions and the like impossible. There's no reason why you can't add RTTI in those layers, though, and use virtual functions all you like in the layers above.

 

Note that I'm not a very big fan of C++; in fact, I dislike it very enthusiastically. I'd choose C over it any day, but then again, kernel programming is the only realm where C/C++ is viable, so it doesn't matter much.

Well, no matter what you do, C++ is where the moneys at. BUT when you learn VB6 you get too lazy to learn C++ so I warn you..:D. Good luck with whatever you choose. But damn, C++ is hard. :P

  • 1 month later...

I had to program in C for years before we could program in C++. I just appreciate how C++ can make many things easier for the programmer compared to C.

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.