Take the 2-minute tour ×

I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.

So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language.

Any C# developers having same dilemma?

share|improve this question
Whilst I agree with you in some regards, I'm surprised you've been flamed for the child-play comment :) –  johnc Oct 7 '09 at 22:51
This is rather subjective. Because if you want to code for .. .let's say Google Chrome, you'll need C++, if you want to code for GAE you'll need Python. So, there is no a correct answer for your question. –  OscarRyz Oct 7 '09 at 22:57
@lagerdalek, did you mean haven't been flamed? I haven't seen any flamage. Neverlander's statement was so absurd, it is hard to know where to begin. Neverlander doesn't know Python, doesn't know much about languages in general, yet feels qualified to proclaim that Python isn't mature. Absurd. –  dan-gph Oct 7 '09 at 23:46

10 Answers 10

up vote 1 down vote accepted

C# is a little closer to Java and C++ than it is to Python, so learn Python first out of the two.

However, my advice would be:

  • Stick with your current language and learn more techniques, such as a wider range of algorithms, functional programming, design by contract, unit testing, OOAD, etc.

  • learn C (focus on figuring out pointers, multi-dimensional arrays, data structures like linked lists, and resource management like memory allocation/deallocation, file handles, etc)

  • learn Assembly (on a modern platform with a flat memory architecture, but doing low-level stuff like talking to hardware or drawing on a canvas)

  • learn Python or Ruby. Chances are, you'll stick with one of these for a while, knowing all of the above, unless some hot new language has come along by then.

share|improve this answer

I think you just asked wrong question. It is not about the tool itself. It should be about what kind of software do you really find enjoying to create. C++ is used in creating different types of applications that are written in C# or Python. Please mind, that C# or .NET itself is not easy to learn. It may be quite easy to develop something that works somehow, but if you just delve into the details...

Anyway, my point is: if you're interested in developing web solutions: go for Python. There is a lot of hype about Python at the moment, and even Microsoft realized the power of this language (you may use your knowledge of .NET and Python programming using IronPython). C++ is at the moment used in some specific areas. Business apps are written mostly in Java or .NET, and C++ is still great for more low level programming, in areas where performance is the crucial thing (and I mean 'performance' as performance of language/platform itself). The good example is game industry: Java and C# are definitely easier to learn than C++, but... how many 'big games' have been created entirely in C#/Java?

I have another advice for you: if you want to work for Microsoft or Google, do not focus on language itselft. It is NOT the most important thing. Focus on problem solving, algorithms and other stuff (Stevie Yegge's post about how to prepare for an interview at Google). Oh, and of course as a fan of C++ (and C# too) I must admit that it is not true, that developing anything in C++ takes ages. You probably think of C++ as of "C with clasees" - take a look at STL, templates, advanced templates, Boost... Somehow all those people working in games industry manage to create better and better games in not so looooong time that takes others to create 'boring and easy' business app in Java/C#.

share|improve this answer
Even though typically in the games industry we don't use the STL or Boost! –  Crashworks Oct 7 '09 at 23:30
Yes, I have heard that STL and Boost are not in the standard tool set of every game developer... but could you please tell my why? (I am wondering, as I am just going to start working for a video game company in a couple of weeks). Oh... and I found your blog very interesting :) –  MaciekTalaska Oct 8 '09 at 9:21
EA's Paul Pedriana lays out game development's problems with the STL (and their motivations for rolling their own) here: open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html . In a nutshell, the biggest reasons to avoid the STL are: 1) performance and code bloat (anyone who says that's not a problem shouldn't work in games); 2) poor control over memory allocation strategy &mdash; STL allocators are inadequate; 3) all those nested function calls don't actually inline properly; 4) no support for explicit alignment; 5) debugging is very painful. –  Crashworks Oct 12 '09 at 2:45
thanks a lot for explaining me those reasons :) –  MaciekTalaska Oct 12 '09 at 14:17

If you want to apply to Google and/ or Microsoft then I'd say that of the two you need both!

Given more choice, probably C++ and one other language - either dynamic, functional, or both (Scala might be a good choice too).

It's not necessarily about whether you'd use the languages themselves but more about the different approaches they require and encourage.

If you continue to be "scared" by C++ you're probably going to struggle applying as a dev at either of those organisations - unless you are highly specialised elsewhere.

share|improve this answer

C++ is usually used when speed, and low-level OS access is involved. It's a good skill to have if you want to expand.

Python allows you to do thing quickly, and it's quite easy to learn, and provides more power than you'd expect from a scripting language, and probably one of the fastest ones out there.

C++ isn't exactly slow to develop, if you've got an IDE, it's not hard to write per-se, but the syntax is going to get you.

share|improve this answer

As someone familiar with C# and .NET you should consider IronPython. Python for .NET. This would be a good way to leverage what you know and learn a new dynamic language at the same time.

share|improve this answer
Yeah, not so sure about that if his intention is to prepare for a future job change. Not a lot of demand for IronPython developers currently. –  Ed S. Oct 7 '09 at 21:58
Can't agree, as IronPython is too dissimilar from python to be useful as a method of learning python. Yes, it would build on what he knows, but his intent is to learn NEW things. –  Lee B Oct 7 '09 at 22:57

You might be interested in looking at Windows Powershell. It's the latest scripting technology from Microsoft, built on .NET, and can be extended via C#.

Granted, it's not as portable as C++ or Python, but it would leverage your C#/.NET experience more readily. Otherwise, I would suggest C++ (and possibly C). Microsoft builds a lot more of its products with C/C++ than with Python.

share|improve this answer
Powershell Scripts are not remotely comparable with general purpose languages like C++ and Python. –  Lee B Oct 7 '09 at 22:58
Lee, I'll concede that Powershell as a language doesn't match the functionality of C++ or Python. In the context of C#/.Net/looking for something new, it fits well. I would up vote your answer (for recommending C & ASM), but can't yet do so. –  Joe Internet Oct 8 '09 at 7:55

Why not learn some of each. Studying a language for a week or so won't make you an expert, but it will answer a lot of questions in your head and plant a seed for the future.

It's important to not just read through exercises. Find some simple problems that can be programmed in a page or two at most and solve them with each language. That will help you to learn the strengths and weaknesses in the context of the way you think and how you solve problems.

share|improve this answer

I Am a little scared of C++ because developing anything in it takes ages.

I'm not sure how you can say that when you say yourself that you have no experience in the language. C++ is a good tool for some things, Python is good for other things. What you want to do should be driving this decision, not the technology in and of itself.

C# programmer or not, I would assume that you can pick up any language, but a language is just a tool, so your question is difficult to answer.

share|improve this answer

Python may be easier to get started with, but a dynamically typed scripting language is a very different language from C# or C++. You will learn more about programming learning it than you will by hopping to a close cousin of a language you already know. Really, solid familiarity with at least one scripting language (Python, Perl and Ruby are the favorites) should be a requirement for all programmers.

share|improve this answer
I would argue that, syntax aside, C# is also very different than C++. The type system between C# and C++ is more similar, but C# and Python sit around the same level of abstraction. –  Ed S. Oct 7 '09 at 22:06
Not at all. Late binding, high-level data structures as syntax, runtime mutability of symbol tables, duck typing -- these are all things that are alien to a statically typed language. It's not just about abstraction per se, it's about what the natural "things" in the language are. Thinking in perl or python is very different from thinking in C/C++/C#/Java. –  Andy Ross Oct 7 '09 at 22:09
I didn't mean to say that C# was closer to Python than C++, I am just saying that there are big differences either way, and learning C++ takes longer (well, to really learn the ins and outs) –  Ed S. Oct 7 '09 at 22:12
The lack of garbage collection makes C++ an enormously different language to program in than C# or Java (be that a good or a bad trait;-) -- roughly as different as Python's duck typing makes it. –  Alex Martelli Oct 8 '09 at 1:52
I think that's overstating the case. Manual resource allocation (of file descriptors, disk files, network sockets, etc...) is a universal paradigm in all languages. Garbage collection just removes the need for it from memory allocation, it doesn't change "the way things are done" in the way that scripts do (unless you write python that looks like C++, in which case I'd argue you're missing the point.) –  Andy Ross Oct 8 '09 at 2:24

If you want to apply to Google then Python might be the one to go for, surely MS would like the C# already. If nothing else the competition would not be as fierce as there are much more folk out there with multi years of C++ experience. Also Python gives you a broader language skill and would be a good path to more languages and scripting.

But as said and will be said again, choose your tool wisely and see whether it's a nail or a screw you're trying to secure.

share|improve this answer
Python, C++, and Java are the 3 languages Google explicitly talks about in their generic "Software Developer" position. –  joemoe Oct 7 '09 at 22:14
@joemoe, yes, they're our three main languages (though Javascript's rapidly gaining in importance, too). –  Alex Martelli Oct 8 '09 at 1:53

Your Answer

