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.

Whilst I agree with you in some regards, I'm surprised you've been flamed for the child-play comment :)
–
johncOct 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.
–
OscarRyzOct 7 '09 at 22:57

1

@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-gphOct 7 '09 at 23:46

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.

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.

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

3

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 RossOct 7 '09 at 22:09

1

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 MartelliOct 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 RossOct 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.

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.

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#.

Even though typically in the games industry we don't use the STL or Boost!
–
CrashworksOct 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 :)
–
MaciekTalaskaOct 8 '09 at 9:21

1

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.
–
CrashworksOct 12 '09 at 2:45

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.

Powershell Scripts are not remotely comparable with general purpose languages like C++ and Python.
–
Lee BOct 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 InternetOct 8 '09 at 7:55

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 BOct 7 '09 at 22:57