I like to use C++ just as a better C. Things like single line // comments and not having to declare all your variables at the top of your functions is really useful. STL is also really useful in that you don't have to (badly) reinvent basic data structures like vectors and maps. Of course, STL also means reading compiler errors that are pages long... :-/
Why You Should Know C++
21–30 of 63 posts
Re: Why You Should Know C++
#22Re: Why You Should Know C++
#23Wow, I like C++ (at least, more than most), but I don't agree on any of those points. In fact, I am sad to say that unless your job requires it, I can't really think of any reason to learn the language. It relies on a mixture of paradigms that are easier learned from other languages where they are isolated. And for lolevel stuff, you are better off learning C.
To do low-level C++ you'll have to learn low-level C anyway and learning C in and out is a far easier endeavor than learning C++ in and out. So if you're wanting to dip into low-level stuff, you need to learn at least C and may want to learn C++ as well.
(More generally the above does not hold -- the way you approach and solve problems in C and C++ does vary a good deal in higher-level stuff, but if you're doing bit-wrangling, you do tend to end up with something that approximates C bunched into classes.)
Re: Why You Should Know C++
#24Earlier quoted context omitted.
Windows API is pure C. GTK is pure C. And these are quite serious (and not exactly obscure) development frameworks.
The Windows API is an array of functions that can be called the same from C as from C++. Microsoft provides several object oriented wrappers for this API, and it's very rare that any significantly large application is not calling the API over some kind of wrapper.
Re: Why You Should Know C++
#25I feel the most compelling reason to use C++ is that it is one of the de facto programming languages in competitions.
Seriously, the defining aspect of most programming competitions is that you're making a program as fast as possible, whatever it takes. C++ rewards this: if you keep sinking an order of magnitude more effort into it, you can seemingly always shave off another tenth of a percent of the time. There are some cases in which this is actually relevant (many involving graphic rendering, a niche I work in, PS), but they're really a tiny part of programming.
It makes sense to code them in C++ (or C), but it's really not the best fit for more general development, which usually places a higher priority on being able to deliver an adaptable and correct solution.
Re: Why You Should Know C++
#26Skip to http://yosefk.com/c++fqa/defective.html for a great overview. And if anyone ever mentions "templates" again I'm gonna smack them hard.
Re: Why You Should Know C++
#27Re: Why You Should Know C++
#28Earlier quoted context omitted.
What's the point of using C when most modern programs on modern operating systems are written using frameworks that are a form of objectified C? All serious development frameworks nowadays for desktop applications are either C++ or Objective C. Most native libraries are one of the two. Even the driver SDKs are mostly build on an object oriented approach. And learning C++, you will know C. Your opinion is a popular op…
Windows API is pure C. GTK is pure C. And these are quite serious (and not exactly obscure) development frameworks.
Re: Why You Should Know C++
#29Earlier quoted context omitted.
Learning C++ you will not know C. At least, not in the time it could have taken you to learn C by itself. There are a few core differences, and with C++ you'll spend a lot of time learning things that will distract you from the core language. If you want to learn C and understand it's advantages don't assume you'll pick up what you need by learning C++.
Yes you will. It's better to learn C++ straight up, because the things you learn there will help you become a better modern developer compared to just C. The core differences between C and C++ (apart from the entire object oriented thing) are easy for any competent developer to pick up. Were they difficult for you to understand?
Re: Why You Should Know C++
#30Yeah right! You are "seen as a hacker" if you write code that is useful to others and/or is brilliant in some respect. Nothing to do with knowing a particular language.
If knowledge of a specific language is a criterion, I'd rather have someone be an expert in C/lisp/smalltalk/haskell/prolog.... C++ originates or embodies no concepts that weren't discovered or done better elsewhere.
e.g: An expert smalltalker is more likely to understand OO than a C++ programmer.