views:

2221

answers:

15

I am a CS student currently learning C. I'd like to get into low level programming, whether as a hobby or career and may contribute to some open source projects down the line. So far I really enjoy C and think I will continue down the abstraction level and take ASM next semester.

The question I have is this, is knowing C enough to be a complete programmer at this level (meaning closer to the machine than managed languages like C#, Java and all the scripting languages) or is it really needed to know C++ as well.

Also, considering that I will have the fundamentals of C and a strong background in OOP with java and php how much of a leap is being a decent C++ programmer and is it worth it.

+4  A: 

It's a matter of job scope and potential. You will probably know enough with just a solid C background and experience to get a job, but you may be able to get a better job with a wider skill set.

I would say it's worth it to know at least C++, given the way languages are moving today, but that's just my opinion. You will probably be able to get a job with just a C background for many years to come.

Also, I'd highly suggest reading this thread on indispensable languages. I gave an opinion there also, but there are many to read through.

Nick
+16  A: 

The multi-billion dollar game industry is very heavily entrenched in C++. Embedded computing in general (console video games being one example) still relies heavily on C++.

postfuturist
Embedded computing is mostly just straight C; I don't think modern video games really qualify as embedded computing.
Adam Rosenfield
C is only dominant in the low end of embedded - 8 bit processors etc. There's plenty of C++ in medical devices, industrial control, military/aerospace etc.
Steve Fallows
@Adam, we develop embedded solutions primarily in C++ for a higher levels of abstraction and speed, and mix in C as required for performance.
Shane MacLaughlin
there's plenty of C++ in mobile devices too, Android's libraries are written in it (with a Java app layer on top), Symbian is predominately C++.
gbjbaanb
Since you don't have to use classes and other OO concepts with C++, there's no reason to use "C" except for a lack of a good C++ compiler. Why give up all of the improvements in C++ in a misguided quest for performance.
James Schek
+6  A: 

H*ll yes, it matters! :-)

There are a lot of projects where a scripting language is useless (for speed or other reasons). C++ is, in my opinion, the best (compiled) general-purpose programming language currently in active use.

(EDIT: It's far easier to write good collaborative programs in C++ than it ever was in C.)

Head Geek
+28  A: 

I think so, there are still plenty of jobs for C++ programmers. It all really depends on your life goals as to what you should do.

If you just want to be marketable, any good C programmer who knows OO concepts will be hired without questions. Most companies hiring a new grad expect to do some mentoring and learning and won't be too concerned about that.

But if your goal is to make yourself well rounded, well, then invest the time in C++. There are lots of cool things in C++ that will make you very happy as a C programmer. Investing time in really understanding how C++ handles objects in memory is a very worthwhile exercise in understanding computers. The STL is loaded with great opportunities to learn new paradigms of programming that you won't see in Java or C#.

It will make you a better programmer to really put the effort into understanding it.

Chris Boran
Checked the local listings for software devs, and I was surprised to find that about 1/3 jobs listed C++ as a requirement or desired knowledge.
postfuturist
+17  A: 

Yeah, I would say that C++ still matters, but its position today is rather tenuous.

C is used for the exciting work in low-level operating system stuff (Linux, *BSD, most embedded work). For the high-level web and database and business application and quick-and-dirty work, we have Java (which is not a huge leap from C++) and all the dynamic languages (Perl, Python, PHP, Ruby, others). C++ tries to be as expressive as the dynamic languages and as efficient as C, and it has gotten very very complex and that's one reason think many are looking elsewhere.

But as much as I find C++ frustrating (practically whenever I use it), I really have to admire it. It's an incredibly ambitious language, and there is a reason for every one of its complex features. Its great ambition is to map all of the very high-level abstractions ever invented onto a statically-typed, compiled language... so that programmers can use very expressive features without any run-time overhead.

For example, dynamic language designers think "we want complex datatypes and don't want to worry about how their memory is managed too much, so allocate them all on the heap and we'll worry about the types at run-time." While C++ takes the approach, "we want complex datatypes without wasting bytes or clock cycles, so provide a whole lot of syntactic hints and memory management options to optimize these data structures at compile time."

C++ really makes me appreciate the delicate balance between speed and flexibility inherent in computer programming.

Dan
Agreed. What you said (except the part where you say you find C++ frustrating) is why I love C++.
Eduardo León
+3  A: 

It all depends on what types of systems you intend to work on and in which industries. Having started my career in C, moving through several years of C++ (both in device-driver/process control settings) and now having spent the last 5 years or so with a mix of Java and C# (in financial systems), I would say that C++ is by no means a common denominator for all programming work. If you have a solid grounding in C, you should have a good low-level knowledge of general programming. For object-oriented concepts and higher-level application and systems architectures, managed languages and platforms are great ways to learn these, and are extremely widely used today. Not to mention that if you're looking at any kind of business UI work, you won't want to be doing this in C++.

Having said that, if you intend to get into game programming, mobile programming or low-level device driver or operating systems work, you'll probably need to learn C++. For me, that's a limited set of areas, though, and doesn't make C++ my first-choice general purpose language.

Wayne
I think that maybe you are selling C++ short here. The enterprise software industry is hugely focused on C++ even today. Anyone dealing with huge data volumes tend to move towards C++. I don't think that the set is that limited.
Chris Boran
+3  A: 

Hi Mark,

if you are entering the workforce, that is an important question to ask.

if you'd like to work on certain projects at
1) google
2) MS
3) YAHOO
4) AMAZON
and other big/small internet/Web 2.0 companies, knowing C++ can be useful.

Given that a good number of java companies are eyeing python, ruby, etc for their future projects AND(this is a big AND) it takes a lot of time to master C++ as opposed to mastering java/ruby/python/C#, unless you're after a certain type of job, I would suggest that you take the leap and master either Java/C#/ruby/python -- these 4 languages probably should get you into 75% of all the current jobs in the world today.

Summary : knowing C++ will help you in low-level development BUT if you know a higher level language and C, you should be doing fine for most LOW LEVEL development. Case in point, Crazy bob(http://crazybob.org/) at Google recently worked on the Android SDK -- it required his java skills as well as C skills.

Good luck

anjanb
+5  A: 

Yes it does. First is the fastest OO language around, and the mos used. Second for some aplications, like embedded system, real time controllers and games C++ is still the best tool and Third it provides a step into the other "Object" languages like Java , C# , etc and gives you a deeper understanding of how they work internally.

Plus is a fun language to learn!

AlePani
+12  A: 

I've been programming in C++ for 16 years, so I may be a little biased...but some of the most interesting job fields out there (to me at least) are all solidly C++: game development (especially consoles), visual simulation, and medical imaging. Lots of communications stuff still uses C++, and many companies doing heavyweight data processing still use it. It's an incredibly powerful and incredibly complex language that rewards those who make the effort to really learn it. At my current job, even though we are using C# and WPF for our user interface, all the real 3D graphics and image processing work is still being done in C++.

Brian Stewart
+7  A: 

I think that even for your stated purpose knowing C++ will matter. I think that only in certain shops (particularly embedded shops) is knowing just C good enough anymore. And even in those shops knowing C++ is not considered a detriment (although insisting on using it might still be). However, as time goes on, I think that even shops that consider themselves mainly C-based will have requirements for C++.

Having an OOP background with something like Java may give you a leg up on some C++ concepts and will definitely help with using C++ as more than a "better C". however, there are major difference between the managed OOP worlds (Java and .NET) and C++ - the main one having to do with object lifetime management. In many ways, this requires a significant adjustment in viewpoint. While it doesn't mean that you can't be proficient in both, I do think it means you can't just say that since I know Java OOP and C that C++ will come naturally.

Michael Burr
+1  A: 

I would say language is not really that important.
Although i write strictly in C for all my career i seen C# developers becoming a really good C coder in almost no time (few months).
The concepts are relevant, good understanding of object oriented programming is important not meter which language you using. You can't be a good programmer if you don't understand the basics of operating system (i guess i will be bitten on this, but i strongly believe on this). You can write code without pointers and relaying on garbage collector, but you can't write good code in any language if you don't understand memory management and pointers, synchronization primitives and what they really mean.

Ilya
have you really seen C# devs becoming really good C coders? The rest of your post is good, but that 2nd sentence is almost meaningless.
gbjbaanb
Yes i did. She is sitting next door. Writing low level drivers for embedded platforms.
Ilya
+1  A: 

It sure does - failing anything else, it seems like a fine way to learn about the fun and evil of Pointers.

So I think it should be taught at universities and used in low-level or realtime systems, but in general business systems, C++ is probably gone. This is a problem, though, because if C++ is not really used, it won't be as useful to learn.

Conundrums, conundrums.

Riddari
when i look on to my desktop i see 90% of programs written in c/c++ and this is not including Operating System itself. So i guess "gone" is a little bit premature...
Ilya
+1  A: 

I think it's very useful to learn. You may or may not need it professionally, but it is neat to learn a transparent object-oriented language. By "transparent" I mean that it's relatively easy (and necessary) to see how the compiler implements inheritance and virtual methods and so on.

Beyond that, if you do need it professionally the longer you've spent with it the happier you'll be. It's a complicated language and takes a very long time to master. There are no end of weird little corners of the language to know.

As others have noted, it can be very useful for dealing with legacy codebases (tons of commercial software is written in C++) and arguably for large projects where performance matters a lot.

If I was writing a new big project from scratch there's one case where I'd use C++: a Win32 client application meant for broad distribution. .NET is great, C# is amazing, but it is still hard to guarantee that a given machine has the right version of the framework -- and the framework is still a giant download.

For any system where I control the deployment (servers or IS apps) I'd use Java or C#.

Moishe
A: 

I'm only 10 years in, but I've spent 99% of my time with c++. I'd say if you wanted to learn OO c++ is where you should do it. Java and c# are lacking some of the more interesting memory management aspects that should be learned.. Skipping this I think is a problem for future generations.

Many times c# and other languages call down to dll's and other libraries that were and still are written in c++.

There are tons of jobs in c++ including business applications.

All in all I'd say it's quite relevant now and for many years to come.

baash05
+1  A: 

Yes, especially if you want to pursue low-level programming and contribute to open-source projects, c++ is still widely used, as others have pointed out. From my perspective, and take this as opinion, there's a lot more cool software written in c++, as opposed to business sofware.

Another benefit of c++ is the number of libraries and frameworks available for it. Its staggering really. Anytime I hit a roadblock in a project and say, "Hmm, I wish there was a library for doing such and such," chances are for c++, there is.

JimDaniel