views:

2135

answers:

33

I'm not asking if C++ is better than C# or vice versa. But if given the option of moving into a new job that exclusively used C++ or one that exclusively used C# (or .NET in general), which would you choose? And I'm looking at this entirely from the view of being a Windows programmer either way.

I ask because I currently use both languages almost evenly and I somewhat feel like if I gave up using C# for C++ only that I would be dooming myself to be stuck with older technology. For example, you're never going to see someone create the latest and greatest web app (or whatever) in STL C++. (I know there is C++.NET, but I'm not counting that.)

Edit: Just to clarify, I'm not talking about which one to learn. I'm already very fluent in both languages.

+12  A: 

In terms of future development, I would imagine C# (and .NET in general) as being much more competitive than C++.

TheTXI
But I think it really depends on what kind of software you want to write. If you love mySQL storage engines, or the FreeBSD kernel C/C++ is the only way to go.
RussellH
mysql works perfectly fine under c# - and in fact, the software we write at my workplace is in c# with mysql for storage.
SnOrfus
+9  A: 

C# is pretty tightly bound to MS so I would go with C++. Once you've learned it you can apply it to many domains and not just MS specific ones.

Naturally if you are going to only focus on microsoft technologies then C# is your choice. It's what MS has chosen so it would most likely be best to follow suit.

Syntax
Does Mono factor into this at all? C# may not yet be as strong a cross-platform choice as C++/Qt/Boost/etc, but to say that its advantages as a language and runtime system cannot be harnessed outside of Windows is a bit disingenuous, no?
Matt J
What about Mono?
tunnuz
I'm not sure I agree with the logic. Just because C++ isn't tied to Microsoft doesn't mean that there are going to be more or better job opportunities. Also, C++ tends to get very proprietary because of the liberal use of macros and frameworks, so C++ skills are not completely portable.
Michael Meadows
I'm not going to cover 'mono' controversy. Naturally the domain changes aspects of the language. However the same patterns, practices, syntax, and use come into play in most if not all domains for C++. The domain changes things, its a given. Search for C++ jobs - then mono and c#. Let the #s talk
Syntax
I'll give you that Microsoft owns the majority of the C# market, but there is often a lot to overcome to make even cross platform libraries truly cross platform.
senfo
Don't forget that Java is pretty similar to C#. So if you want to develop a cross platform application as a C# programmer, picking up Java shouldn't be ~to bad~.
srand
A: 

My personal preference in that situation (I'm in a roughly similar situation with C#, Java, and C++) would probably be to pursue the C# avenue. I'm not sure why, other than it feels like there are more options available in that direction. (You mentioned web apps, for one.)

JMD
+22  A: 

I'm pretty sure you'll get plenty of C# votes just because SO is .net-aligned (don't argue - it really is). But I reckon C++ jobs are more techy in the sense of being more related to low-level algorithms and such. Not always, of course, but I think if you like the highest level of challenge in terms of coding, C++ could do it for you.

Dmitri Nesteruk
Don't argue? That's supposed to stop us arguing? It's aligned to whatever happens to be popular when it comes to asking questions. There are more questions for C# because it hasn't been around as long as C++. That's all. Don't argue...because I said, "don't argue". ;)
Jeff Yates
Don't argue about arguing...it's redundant ;)
Adam Haile
It's aligned with the readers of Jeff and Joel's blogs, which happen to have a decidedly MS focus, and that's where the majority of SO users come from... I agree with Dmitri.
rmeador
SO is certainly not hostile to non-MS issues, but it sure looks more MS-aligned than otherwise.
David Thornley
Maybe because .NET devs are less self-sufficient than others ;)
Alan
Or more social. =)
Erik Forbes
+12  A: 

My 2 cents:

If you currently have job experience with both languages, it doesn't matter which you choose, as you will be able to take a position in the future since you have experience with C++/C#.

C# is a bit more dynamic, in that the .NET platform has evolved more lately, as it is a newer language, compared to C++; however the fundamentals of each language remain the same.

If you are a good engineer, it won't really matter what your last job was.

Alan
The good programmers can write good solution in any language. Even vb6.
Ismael
Also should be able to learn quickly whatever tool does his jobs more productive, be it a particular language, IDE, or OS.
Ismael
A good programmer can write a good solution in any language, true. But can they get a good job in any language? The hiring process is stacked against you if you're not playing to your most recent experience.
Mark Ransom
A good programmer picks a language appropriate for the task at hand.
SnOrfus
+3  A: 

You aren't going to see someone create the latest and greatest web application in STL C++, but you will see some amazing desktop applications written in C++ (I believe all of the Microsoft Office products are C++, just to mention a small subset).

It all really depends on you. Personal preference and career objectives.

I, personally, would never give up C# for C++. I love my C#.

Max Schmeling
+5  A: 

If you have the time, I would say learn C++ well first. It makes other OO languages appear a lot simpler to understand :)

Andrew Rollings
Already there...that's the point. Considering knowledge of both completely equal, which to choose?
Adam Haile
Make yourself available for both. No reason to artificially limit yourself.
Andrew Rollings
Word. C++ is insanely complex. The other languages almost feel like toy languages after it. HOWEVER, learning frameworks, etc, will require additional effort.
Andrei Taranchenko
+4  A: 

C# is tightly coupled with MS, and MS is prone to radically changing technology every few years. Remember when ActiveX was supposed to take over the world?

If you'd like a language that will stay relevant for the next 20 years, go with C++. C# may provide slightly better ROI for next 5 to 7 years, until MS changes their mind again.

Arkadiy
That argument has a hole in it. If C# (and Java) are abandoned, it will not likely be because of a return to C++. C++ is where it is now because it is too low level, and therefore too difficult to solve busines problems. Look for an even higher level solution to replace C#.
Michael Meadows
You can do high-level stuff with C++; many (not all) of the things that got it a bad rep are not problems with a modern implementation and modern approaches.
David Thornley
By low level, I mean that you're forced to write low level code, like memory management and pointer referencing. These things don't relate directly to solving business problems. .Net still forces a lot of low-level code too, but less than C++, so LOB development is cheaper.
Michael Meadows
Memory management on C++ is a mostly solved problem, along with other resources GC does nothing about. I almost never write anything like "delete" or "*p" any more. New-style C++ is much better than old-style.
David Thornley
@Michael Meadows - I did not mean that MS will go back to C++. And you're right - C# will be replaced with same or higher level language. My point was, whatever replaces C#, we can be sure that C++ will still be there.
Arkadiy
+1  A: 

It really depends on what you like to do. I see C++ still living around for a long time, not necessarily in web apps with the latest flashiest technologies, but very specific systems (think Air Traffic Control, railroad systems, embedded systems, etc).

Stick with what you like most, if you're good at it, you will do good (considering, like I said, that C++ will be around for a long time, IMHO.)

Ricardo Villamil
+2  A: 

It depends on what type of a programmer you want to be. If you're looking to develop client applications or line-of-business applications, .Net (most likely C#) is definitely the way to go.

If you're looking to do more low-level programming, like device drivers, then you should do C++. C++ is out of fashion and will probably never come back in for client applications.

Michael Meadows
A: 

C++ is becoming more niche every day. The managed languages are becoming more powerful and they are faster to develop in. This is slowly relegating C++ to fewer and fewer spaces. If you have to choose one for the long haul, there will be more C# jobs than C++ jobs out there.

That said, if you are asking what to learn, learning C++ would be better because you can move from C++ to C# easily. The opposite is not true. Knowing C++ makes you more flexible.

Steve Rowe
+4  A: 

I currently work extensively in C# and only reluctantly in C++. But, if I had to pick only one to move forward in my career with, it would have to be C++.

I love my C#. I can work faster in it and build more powerful applications out of the ready-made building blocks in the .NET library than I would be able to in C++ at any time in the foreseeable future. Still, if I had to stick with exactly one language, C++ has a much larger installed base, runs on far more platforms, and is not dependent on a single company for its survival.

Fortunately, I don't have to pick jobs based on such limiting criteria. I'll stick to working in C#, C++, C, VB.net, Python, Ruby, PHP, LISP, JavaScript, and whatever other languages I can solve problems with.

Jekke
A: 

I would say that it depends on what you want to make or what kind of job you want. If all you want to do is be a software developer making windows software/applications, then I'd say that c# is your way to go but if you want to get a little closer to the grain, then c/c++ has some advantages there while still allowing you to develop against win32 or the clr.

SnOrfus
A: 

I would say that it depends on what you want to do. As an application developer I see no reason to do anything by .Net code (and my preferred route is C#). But outside of the Quickens and Excels and Words and other ubiquitous apps of the world (all of which can be done fairly easily in .Net at this point) what is there left to do?

Custom apps for data management are always easy enough to do in .Net (+1 for C#) but if you want to flex your muscles more and go with performance based apps like games or server side processes (+1 for C++) or delve deeper in the inner workings of Windows and do device drivers or other OS goodies then C++ is pretty much the only way you can go. I've gotten lazy, haven kept my C++ skills polished and have been caught hook, line and sinker into .Net. It turns out that I'd rather query a relational database than write one.

thaBadDawg
A: 

In terms of entry level Associate Software Engineer type jobs, I see way, way, way way more C# jobs these days. But for more sophisticated technologies, C# does not seem to be as preferred.

Paul Nathan
A: 

It's not really hard to jump from one to another (though probably harder to go C# to C++ than C++ to C#).

I did all my schooling in C++ but then ended up doing C# programming without missing a beat.

Kris
A: 

It depends. Neither language is going to die out tomorrow. C# is definitely more popular in application development on Windows, but C++ still has a lot of uses. It works on any platform, it works better with legacy C/C++ code, it gives you more control over the system, which can be essential in high-performance applications.

So rather than asking which is better for your career, the question is which direction you'd like your career to go.

jalf
A: 
  1. Open your favorite job search site
  2. Search for c# jobs
  3. Search for c++ jobs
  4. See which language has more openings

I would guess c# would be a better career path. In my market there are significantly more jobs in .Net/C# than C++.

Shaun Bowe
Career paths should be determined by more than snapshots of raw job offerings.
David Thornley
+2  A: 

I'd chose the position that offers you more interesting tasks and more chances to push your personal limits. The langauge is - after all - just the tool of your craft. What you do with it is what really matters!

lithander
A: 

Obviously, depends on the type of work, but I can say at our office (lots of back-end apps, some website work, some agent-type code) that our C++ stuff has definitely become more specialied. We now only write C++ when we have to (either maintaining existing C++ code, or stuff that's going to run on non-Windows platforms). We used to have solid C++ skills throughout the team, now we have maybe 1/4 of the staff that can write reasonable C++.

Joe
+9  A: 

Take the job you like the most, and use the language that comes with it.

Don't pay too much attention to numbers of jobs available currently in a given market; that can come and go, and there's no good way to filter out the jobs of interest to you (whatever that is, but probably not exactly the jobs of interest to me).

David Thornley
A: 

I was in a very similar position 3 years ago; picked the C++ route, and never looked back.

Nemanja Trifunovic
A: 

Personally, I would go with C# because it is far easier to program with than C++ at times. You also get so much more exposure to different areas such as web and fat client user interfaces, and latest breed in SOA using WCF from Microsoft. However, I would still pick up C++ because when something doesn't run fast enough in C# on a users machine. You can write it in C++ to make it run faster. Also some of the other comments on multiple platform developement do hold true as well. C++ can pretty much go on any type of box out there from a Mainframe to a small integrated processor box. Good luck on whichever you choose.

SamIam
+7  A: 

Picking a job or employer by the language they use is probably one of the WORST ways I can think of. It is certainly a good way to weed out jobs, but never use it to CHOOSE one.

Pick the employer based on the environment, the problem domain, turnover at the employer, what you can learn on the job, the people there, commute distance, salary, benefits, vacation time, allow dogs at the office, work from home, etc. But never choose based on the coding language. That is as bad as an employer choosing someone for their specific language knowledge.

Pick another metric.

Tim
+1  A: 

It's a tough question.

From the MS support, "corporate push" perspective, C# is definitely newer, and more likely to be in vogue. For a while MS thought they could kill C++ for Windows development (which would have made your choice very easy), but recently they have been coming back to the idea that "real" apps will continue to be written in C++ for various reasons. So, I see it as 50/50 in terms of future Windows development support (slightly favoring C# though).

As a few people said, C++ certainly opens more potential job avenues, with multiple platform support and variety of applications. You probably also want to consider the type of apps you're going to be employed to write: C++ will be more hardcore, run everywhere, or legacy; whereas C# will be more internal tools, web services, or client UI. It's a toss up for number of opportunities, but personal preference could push the decision to one side.

If I were you, I'd look for a job which allowed (or preferably paid you more) for your ability to do both, but admittedly that's kinda a cop out. I see C#/C++ as 50/50 for future Windows development at this point, more or less.

Addendum: I write both in my job (although I focus on C++), and my company would pay more for candidates which had knowledge of both. However, we would be more likely to hire a C++ programmer with C# knowledge rather than visa-versa, because there seem to be far fewer bad C++ programmers these days than bad .NET developers. Just an observation which might be relevant.

Nick
A: 

I guess I would disagree with the sentiment that just go with "the best job" or "what interests you most".

For me personally, at the end of the day I work to live - I don't live to work. If there are twice the C# jobs available as C++ (I'm making up numbers here, no flames please), then I would go with C# on the assumption that if I ever did need a new job, I would be more marketable.

So see what is in demand out there and at the very least take that data into account.

mjmarsh
You are forgetting the supply side of the equation. There are more C# programmers on the market and they are cheaper.
Nemanja Trifunovic
A: 

I agree with the others who say that other factors in choosing a job are far more important than whether the tech being used is C# or C++. I work professionally with both languages, and I find C# development on average to be far more pleasant than C++ development. But if you had a job between, say, developing a sales web site in C#, or developing a cutting edge video game in C++ for the same salary and benefits, which would you be more inclined towards? :)

Parappa
+1  A: 

C# is now a productivity language like VB used to be - its favored for developing Line of Business applications, you know - the departmental apps, the ones that are dull and boring and often don't even make any sense. The same ones that pay well and always seem to be in demand. Rarely are those undertaken in C++. I dont see as much demand for C++ as there may have been back in lets say - 1999.

jackberry
+1  A: 

It all depends on what your doing, or want to do. If you are going to be doing low level development like drivers or other system level applications where you need to have direct access to the memory then you use C++, if you want to do line of business or web apps and you don't need direct access to memory then c# is a better fit(garbage collection is a good thing).

As far as cross platform use java or c# (mono for linux/unix), unless you really like writing everything in ANSI c++ otherwise porting c++ is a nightmare. The first c# development I did was in mono, I've used the LAMA stack, c# works great in both Linux and windows if you take the time.

Most importantly learn good development practices and then the language becomes secondary. switching from one C style OO language to another is fairly simple and it doesn't mater if it's c++, java, c#, and php is a lesser degree.

Bob The Janitor
+1  A: 

Want to code something safety critical? Learn C++ Want to learn something easier but useful for many desktop applications? Learn C#

I would definetely recommend this order: C++ and after that C#.

Iulian Şerbănoiu
A: 

You can't choose C++, it chooses you. Have a try C++ and see If you are one of the chosen ones. Above all, read this C++ link.

Comptrol
A: 

I don't think of C++ as older technology really, but from what I see it is not commonly used in typical corporate I.T. shops. C# is far more common there. If you want to use a lot of C++ at work, you'll probably be in engineering, scientific, or aerospace realms.

catfood
+1  A: 

I wouldn't go for a job that limits you to either (unless I had good reason). It depends on what you like to do though. Since you write in both, you know what they are used for generally. C# is great for GUIs, C++ is great for anything other than GUIs. If you love GUIs go for Java/C#. If you love "drivers/embedded/pointer fun" go for C++. The real key is to be such a good developer that the language is secondary, just a tool on your belt. Design is the primary tool.

Chap