Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I'm a hobbyist programmer with a fair grasp of Python and I'm currently learning C. Recently I was talking to a colleague who also wants to learn to program. In his case, he wants to learn C++ as a path to Windows game programming using DirectX. Personally, I feel diving straight into C++ as your first language is a bit much - it's hard enough keeping motivated in an easier language, and I think it's better to learn another language to get your head round most of the basic concepts, then go into something like C++.
I found Python worked well as my first language as I'm more interested in network and web programming on Linux/Unix platforms, but for someone mainly interested in Windows game programming I was thinking C# might be a better choice as he could learn using Visual C# Express Edition and XNA, then switch over to Visual C++ when he's ready to start learning C++ and therefore already be in a familiar environment. I think memory management is a lot to take in, and C# at least handles that so he can put that off till he starts learning C++.
What do others think of C++ as a first programming language for this kind of application? Should I recommend he go for C# instead?
C++ should be fine. I think he is best off learning about memory management, pointers, etc. BEFORE jumping up to C# as he will understand how the program is working better. Otherwise, he will just see memory as being magic and the garbage collector will have no real meaning. It's always good to have a solid understanding of underlying languages (C, C++, Assembly, etc.) to produce the best code.
C++ is the main language used for most "serious" gaming titles. If programming for a major gaming studio then he needs to know the dirty little bits of C++.
Starting out with C++ might be a bit much for a complete novice. I would recommend C as a great starting point. You get familiar with the concepts of memory management and the other low level stuff before adding the complexity of C++.
Since C# is managed code, he would not be gaining the insights of the low level memory management. That will not serve him well when having to deal with C++. In this case, starting closer to the metal will help him in the long run.
C++ game programming is great. But unless you like total pain while you are learning to program, you might look at starting with XNA. This will allow you to work on the game content and logic instead of fighting with your engine code.
Now if you like pain go the DirectX and C++ route to start with.
I think it is better to thoroughly learn a language such as Java or C# before taking on C++. The reason I say this is because you can easily get bogged down in the details and intricacies of C++.
I struggled with C++ on and off (as a hobby) for a few years, then at Uni I was taught Java, stopped doing any C++, got a job doing Java for a couple of years, then moved into C++ dev. I picked everything up very quickly because I already knew what patterns and concepts I wanted to apply and it was just a matter of learning the syntax and weirdnesses and getting used to pointers again. I just had to learn HOW and not WHY. Taking on C++ as a first major language is learning HOW and WHY at the same time and it can be very confusing!
XNA is a good suggestion.
Python is good at game programming. See i-want-to-learn-game-development-which-language-should-i-use. Consider learning Pygame.
Pygame is a set of Python modules designed for writing games. Pygame adds functionality on top of the excellent SDL library. This allows you to create fully featured games and multimedia programs in the python language. Pygame is highly portable and runs on nearly every platform and operating system. Pygame itself has been downloaded millions of times, and has had millions of visits to its website.
If he wants to get into the industry, then knowing C++ is vital, as the majority of game engines use C++. (I also developer should at some point lean C or C++)
However, if he wants to write games (as in, finish writing a game) then C++ may not be the way to go. It is very complex and has a lot of pitfalls that make it a slow language to develop in. It is not just the memory management, but things like the horrible stl related compile errors etc that make it very hard to get anything done when first trying to program.
Looking at something like C# or Python would be a better option, as they are far less complex languages and each have some good game library's.
If he decides that C++ is the right way to go, then I would recommend at least a rendering library. Something like Ogre3D at the very least. The reason for this is covered in this article Write games not engines. While writing (or trying to write) an engine from a base API is going to be a good experience, it is unlikely that the game will get finished.
Something you have to consider is existing SDK's, you probably don't want to program everything yourself. For example, there are pretty good 3D engines with different types of licencing that may suit you well.
So you should check outthe existing libraries and SDK's and the few languages you want to stick with together at the same time. Adapting to C++ or C# is not that difficult, the former is more strict and more demanding whereas it gives you more extensive control on memory, the latter allows you to focus on the main development area but takes the memory management in charge (mostly), which means you could have real-time issues.
At the end of the day, what help you can get to build your application will invariably outweight the small differences between those OO languages (to some extent).
There are lots of game engines, most are listed on this page. Of particular interest are, in the free world:
Panda3D (http://www.panda3d.org/), C++ and Python;
NeoAxis (http://www.neoaxisgroup.com/), essentially C# (.NET);
Ogre3D (http://www.ogre3d.org/), C++;
CrystalSpace (http://www.crystalspace3d.org/main/Main_Page), C++ and Python;
Esenthel (http://www.esenthel.com/), ...
Non-free packages include Unity, and others.
If you do not want any of those engines, there are still very good libraries like Qt for C++, that allows scripting - though not directly Python, you would have to embed it yourself - and others for C#, but the listing could get quite lengthy.
Typically, people run out of steam before completing their first game. Therefore, unless your friend has a track record of being doggedly determined, I'd recommend the most high-level option available. If you are choosing between C++ and C#, that'd be C#.
I would prefer XNA and C# for a quick and painless introduction.I would use C++, and a library like DirectX, for game programming after having some experience on the topic.Most of the most successful games have written in C++.
If your goal is to have fun, and actually finish games yourself (or in small teams) that are relatively small in scope, then I say C# and XNA.
If your goal is to work in the industry, on super big budget games with giant teams... Then C++...
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
What is best C# or C++ for making a game engine. I currently am a .NET C# developer and really want to use C#. Although I know C++ does support memory management and that is why a lot of big companies go for it. That being said C# is quicker in the development process and extremely familiar to me. Before anyone suggests it, yes I've used unity. I like it but want to go the long and hard extra stretch to own 100% of my own built game.
What do I lose by not going to C++? and what kind of libraries do I use, for graphics and stuff? Is that what DirectX is for? I'm trying to wrap my head around this and any help would be much appreciated.
I need some opinions
Perhaps I shouldn't presume to tell you what you need, but I think you'd be much better off receiving information you need to form your own opinion. Asking for opinionated answers (notice irony here) in my opinion isn't generally desirable here.
C# and C++ are both very powerful general purpose programming languages. Either language is 100% capable of creating full fledged high performing games. With that said, there are some (mostly) objective differences one can point out that may effect your decision.
Garbage Collection
Whether this is a pro or con for you is for you to decide. Some people want to save themselves work and have to spend little time taking care of memory. Obviously C# shines in this regard. C++ can have elegant and easy memory management if you know how to properly use smart pointers of course, but that's still more effort than garbage collection. If you're very concerned with having tight control over resources, then C++ might be more your thing.
Libraries
When you want to write software without reinventing wheels (and you should) a language's libraries can be just as important as the language itself. This isn't an obvious pro for either language, as both have lots of libraries supporting games. If you have to pick a winner though, I'd say it's probably C++. The language has essentially been the vernacular of game programmers for years now, and has a lot of maturity in this domain. C++ can directly leverage APIs as low level as OpenGL and as high as Ogre3D. There's no guarentee that your game will actually benefit from a C++ library over a C# library though. It depends on your use case.
Standard Libraries
Continuing on the theme of libraries, this could be a pro for C#. C and C++ are two languages that have an enormous amount of libraries available. If you only count their standard libs though, then things change. Some people don't mind, or even like this. One may also want a more expansive standard set of functionality however. C++ doesn't have a small or incapable standard lib by any means, but C#'s is definitely more feature rich.
Platform
Unless you're going to use Mono, C# is not portable. Mono is a great option, but it does have cons (that you'll have to research yourself). C++ can't tow a line like "Build once, run anywhere", but it does all the same offer damn good portability if that's what you're going for. With an OpenGL renderer (or some higher level wrapper API like SDL/SFML) you can build for pretty much any desktop environment. If you're only worried about making games for Microsoft platforms though, then this point is probably mute.
Virtual Machine or Native
This just like garbage collection is just a factor to consider. It'll be up to you to decide if it's right for your use or not. VM's sometimes have a stigma among game programmers it seems because of supposed performance issues. It's true, if C++ is used intelligently, it will probably be a better performing game. C#'s performance isn't anything to laugh at however. A lot of games that are written today can perform fine with a C# implementation. Is using C++ really an advantage if it means 450 FPS vs 400 FPS? Sure, there's a measurable difference, but it doesn't mean much to anyone playing your game, even if they have a 144hz monitor. Memory overhead is in a similar boat. Usually C++ isn't actually a necessity until you start getting into seriously heavyweight games.
Learning
Last but not least, consider the fact that you have tools you know, and tools you don't know. You already know C#, the time you have to invest learning is probably going to be much less if you choose to pass up on C++. C++ simply has additional concepts and responsibilities compared to languages like C# and Java. Some of these things you can choose to ignore. C++ won't hold you at gunpoint and force you to use multi-inheritance, and hey, that's probably easy to pass up on. Will you pass up on destructors though? Those are pretty important. What about the STL in general? Passing up on that is probably not a great idea, no best you learn STL if you're going to use C++. If you think this is worthwhile doing, then by all means go ahead. Again though, it's just something to weigh in.
Creating a game engine in C++ while learning C++ is a big challenge.
C# is more enjoyable than C++
Why?
In C++, pointers are powerful and you need to know how pointers work and how to use them
In C++, finding libraries is not as easy as pulling a nuget package
In C++, creating/refactoring header and source files is annoying
In C++, need to compile for every CPU architecture
In C++, syntax may be harder to grasp at the beginning
In C++, using the compiler and optimizing it is a topic on its own
But if you want your game/game engine to be fast then you should go for C++
When i see people coding for games in C++ they mainly use OpenGL but thats a common mistake since most of the non-console gamers are Windows users.
My advice is to first start creating a small game using DirectX, if you feel comfortable with it, then take the next step and create your own game engine
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am coming towards the end of a project that I created in C#. Unfortunately, the target hardware only comes with compilers for C/C++. My dad is an embedded programmer so he will be making the necessary code to integrate with the hardware, but in the meantime I need to find a way to translate the language. Free translators are a very high preference as I am extremely tight on funds at the moment.
While I am not fluent in C++, with a dirty translation I should be able to figure out most of what is required to make it run.
Edit:
The target platform is mbed Microcontroller
Don't. This will not work.
C# has a garbage collector. C and C++ don't. You will have to rethink how you allocate objects and release them in C++.
Chances are, since you already have completed the project, rewriting it in C/C++ will be quite easy. You already understand the problem and have expressed it once before.
There is no 1 to 1 mapping from c# to c++. The programming model and platforms are very different at the lower levels. Take memory management for example.
Your best chance is either to rewrite your application or try to get .NET Compact Framework or .NET Micro Framework to run in the hardware.
Edit:
Note that at least the .NET Micro Framework has a porting kit if your hardware is not supported.
Since design is half the battle in application development, your C# prototype should serve you well, but you are unlikely to find a suitable automatic translation tool. If you have not made heavy use of the .NET class library, especially those parts that relate to the underlying OS API, C# should be easily manually translated to C++. The code body syntax and semantics are very similar; it is the enclosing structural elements such as class definitions that are more different.
The required effort depends on the size of the application code, but much of that is mechanistic. The biggest difference being that you need to be more careful with memory management in C++ since there is no automatic garbage collection.
Learn C or C++. There are no alternatives.
Both languages are radically different from C# and .NET, and automatic conversion is not possible. (and if it were, it certainly wouldn't allow you to "figure out most of what is required to make it run". It would be completely unrecognizable code, that'd be impossible to read or extend.)
In order to write a working C or C++ program, a C or C++ programmer needs to write the code. The good news is that it doesn't have to be that difficult. You don't have to learn every corner of the C++ language. But you do need to learn the basics.
If you're looking for the quick and dirty way to get off the ground, learning C might be a better option, because the language is so much smaller and simpler. But C++ is doable too. Just don't think you can get away with reading a 15-minute online tutorial.
There are no translators.
The .NET Micro Framework has been ported to a Phycore LPC3180 (NXP) platform that is not to dissimilar to your board so it can be done but you still need to port the .NET framwork to your platform.
It is unlikely that you will be able to use Mono AOT unless you are going to port Meamo to to your mbed board.
Any porting would require you to be able to program C code.
The best and fastest way forward would be for You to learn C++.
The differences between C++ and C# are not to big once you get going with C++ and understand the differences. You also going to have to use the mbed library for your hardware control and communications instead of what is provided by C#.
The C# code was a good prototype to debug your program design but it is not going to help you on the target. Now that you understand the problem it should not be to hard.
I'm not sure how you got this far without realising that the target platform couldn't run .NET, but it might be worth seeing if Mono's Ahead-of-Time compiler is able to output to your target platform.
At least then you wouldn't be throwing out (months of?) code.
Since you wrote the application in a garbarge-collected language, the fastest way to port this to an mbed platform should be to port the application to a garbage-collected language which runs on mbed.
I haven't tried it, but eLua is supposed to have a preliminary port which runs on the mbed platform, and Lua is fairly simple to learn.
http://mbed.org/users/jsnyder/notebook/elua-preliminary-port/
If you can get your dad to bring up eLua on the mbed platform, I suspect you could do the conversion fairly easily compared to trying to convert your application to C++.
Port the code manually, and as you do, you will learn C++. :D
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Is it possible to learn C# as your first computer language without any knowledge of the other three languages it combines?
I learned objective-c without knowing c first, but assuming I know nothing of C# or any other language is it possible to learn as a first language?
Yes. It's possible to learn C# as a first language.
It doesn't really "combine" other languages. It takes some inspiration from other languages, but doesn't use C or C++, etc, directly. C# is its own language, with its own syntax and rules.
You can learn ANY language as a first language.. Some are easier than others, and use different concepts. Personally, I think C# is a decent choice for a first language, since it has a good development environment, a great community, and is flexible enough to provide good growth and usage in almost any environment, but easy enough to not be overwhelming.
Yes.
....also (trying not to blow Microsoft's trumpet) Visual Studio is a very good IDE so that + the language will help any newbie get into the swing of things quite quickly
“It is practically impossible to teach
good programming style to students
that have had prior exposure to BASIC.
As potential programmers, they are
mentally mutilated beyond hope of
regeneration.” (E. W. Dijkstra)
IMHO, the importance of a first language is often overstated. E.g., people like to slag BASIC as a terrible first language. However, I was introduced to many fundamental concepts via BASIC (flow control, subroutines, etc.), as well as some more interesting things like:
direct access to and manipulation of memory via PEEK and POKE
self-modifying code! many cool things were done with this
optimizations such as storing data at the end of the code, which taught me a bit about how interpreters work
my first (and, oh, how I wish my last...) infinite loop (10 GOTO 10) - terrifying and beautiful at the same time!
That spurred interest in interrupts and soon I was doing assembly. Later I got into OO via JScript in classic ASP, and then more formally with C#.
I guess what I am saying is, is there is no one true language, and any of them is enough to open the door a crack, enough so you can see the big room filled with light beyond. So, yes, by all means, C#.
Many computer science curricula are using Java to introduce programming. C# is in many ways very similar to Java, so I would think a student could be pretty successful starting out with C#.
If your question is, "Is C# the best language to start out with?" then I think I'll leave that alone - the answer is going to be very subjective.
I learnt C# as my first "serious" language (I knew a bit of PHP and actionscript before, but nothing serious)
And while it wasn't horrible, I'd strongly recommend combining learning C# with learning C.
I learnt C# in school for 3 years, and then learnt C for a year, and came back to C# knowing how everything works MUCH better.
Especially recursion, arrays, pointers, etc. Just like assembler helped me understand C better.
To sum it up: It's not a horrible language to begin from, it's pretty noob friendly, but for deeper understading I'd learn C aswell.
You have to start somewhere. C# is as good a starting point as any.
Of course. C# does not combine languages!
It's a completely self-sufficient language that of course has roots/draws inspiration from Java, C and C++, but that does not mean you have to learn them.
Or do you need to learn Latin before you start learning Spanish?
Yes of course and IMHO it's a good choice.
Yes, C# is a perfectly valid language to learn first.
Yes it is a reasonable choice. Knowing the languages that came before it is interesting and useful, but is not a prerequisite.
See also http://portal.acm.org/citation.cfm?id=948843
It was my first, still using it 99% of the time today, 8 years later.
Certainly. But learn at least one other language too - it will make you a better programmer.
Yes, C# would be a fine first language. You can easily learn spanish/french/english without knowing latin.
C# is rather high level, so it will be easier to start with, and cuts out a lot of the crap you have to deal with with earlier languages (NOT because those langauges are bad! C# owes much of its beauty to its predecessors).
C# will also teach you Functional Programming early, which is becoming increasingly important in our industry as multi-threading becomes omnipresent.
Sure. One of the things that you learn about programming languages is that there isn't really that much difference between them. Once you learn one or two pretty well, you should be able to pick up others in a matter of hours or days - the syntax may change, but the concepts don't. What's challenging is getting the right mindset for programming in the first place and learning the API for getting things done with a particular platform and language.
C# is a perfectly good place to start because it maintains most of the features of more advanced languages while keeping away the most complex parts, and still allows you to develop full-featured GUI applications.
IMO, the ideal learning order should be:
A wide background on Math (strong arithmetics and algebra, good formal logic (a.k.a. Boolean algebra), and optionally some set theory).
A solid background on digital electronics.
A good background about hardware: what a computer has, what can it do, etc.
Machine code/Assembly, because it (machine code) is the only thing the machine really handles (and assembly is the only "sane" language close enough to it).
Some low-level language; probably C because of it's prominence at that level (does anyone build systems with something else than C/Assembly?). This includes going down to interfacing with your platform of choice (for example, building some GUI through the Win32 APIs).
Any OOP language, ideally C++ (because .Net languages and Java normally use intermediate bytecode).
A good interpreted language, like Perl or Python.
Anything you want.
While I really thing this is the best learning order (the knowledge acquired through that path always builds upon the preceding steps, and ends up covering most of the aspects relevant on modern computing), it'd be an utopia. I didn't follow that path (although I have dealt with most of the languages listed), and it's not practical to follow it on modern times: it may involve years of studying before you can take profit of your skills.
Recently, I started private classes on programming and I'm teaching maths (as needed), pseudo-code, and C#. Sincerely, I think C# is the sanest choice as the first language: it takes you quite early into nowadays' most used stuff: GUI, DB, Networking, etc, and it isn't as aberrational as alternatives like VB.
It would also be advisable to dive a bit on other languages spanning different paradigms, just to get a bigger picture about programming. I'd suggest Assembly (preferably on a virtualized system, because bad things happen) and Python or Perl.
Just my opinion.
Yes. The fact that it has syntactic roots in the C family of languages doesn't require you to know C, C++, Java or whatever: you can treat that as a historical curiosity.
Sure, just because it's like another language doesn't mean that you have to know the other language to learn C#.
Heads First C#
I'd go so far as to say that learning another language as a halfway step is more likely to leave you with bad habits than to reduce your C# learn time.
Start with Scheme ..that's what they teach in school first.
In my opinion may be it's possible to learn C# as your first programming language, but it's very difficult (I should say impossible) to learn programming using this language. Using any mainstream (may be it's better to say industrial or production) language. This languages are overloaded by different programming concepts, syntactically complex and has enough "dark places" to confuse newbies in programming...
And it's not only my opinion (of course). Take a look at what Niklaus Wirth thinks about it.
So you can choose another road and learn Component Pascal for example. The only problem on that way is the lack of books. It seems that this book is the only option.
Anyway, good luck!
I'm a C# convert and I freakin' love it when coupled with Visual Studio Intellisense and autocompletion. It's basically the nicest programming language/IDE combo.
I would say that C# is probably one of the best first languages as it teaches you some lower level, C-like programming but gives you an easier to use and manage object/memory platform.
It's a nice, clean language with good software and community support, and I wouldn't say it requires anything a beginner wouldn't have.
That said, I was faced with this question recently in helping a teenager learn to code. I decided in the end to steer him towards VB.Net instead; not because of any preference on his or my part - he didn't ask for anything specific, I use both - but I felt its increased verbosity was beneficial to a beginner. With less symbols and more words, I think most complete novices would find VB.Net a less intimidating starting point for no great difference in results.
Absolutely it is possible. I taught my son C# as his first programming language so that he could do a science fair project. He was 13 at the time.
I think C# makes a great first language for someone who will go into more serious programming or computer science. There has been a movement towards Python as a first language recently, and while I love Python, I think it's a poor choice for a first language because it lacks data abstraction. C# on the other hand, has excellent support for data abstraction (properties is one place where it shines compared to competitors like Java).
It also has a huge standard library behind it that enables beginners to write functional programs that do cool things early on (which is essential to keeping a beginner motivated).
After the student masters the basics of object-oriented programming, C# will also let them add other paradigms to their repertoire without having to learn a whole new language.
C# is a really good language to be learning first... However having learned C and VB .NET at first, in my opinion will give you significant boost :)
I think languages like: C, C++. Are the best languages for beginners - they help you understand how the system works - what is memory, how to use it, allocate, and so on. C# and its garbage collector allows you neglect this things.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Is it possible to do CAD/CAM software without having to use C++? My company developed their software with c/C++ but that was more than 10 years ago. Today,there is a lot of legacy code that switching would force us to get rid of but i was wondering what the actual risks are. We have a lot of mathematical algorithms for toolpath calculations, feature recognition and simulation and 3D Rendering and i was wondering if C# can handles all of that without great performance loss.
Is it a utopia to rewrite such algorithms in c# or should that language only deal with UI.
We are not talking about game development here (Halo 3 or Call Of Duty) so how much processing does CAD/CAM really need?
Can anybody enlighten me on this matter? Most of my colleagues are hardcore C++ programmers and although i program in c++ i love .NET but i am having a hard time selling .NET to them other than basic UI. Does it make sense to consider switching to .NET in such a field, or is it just not a wise idea?
Thank you
If you have a lot of legacy code that would need to be rewritten, I don't see it making business sense to switch to a different language. Even if there were gains to be had from using a different language (which is questionable), the cost of testing and debugging the new code would more than overcome them. You also have a development team that are experts in C++. There would be a big productivity drop while they came up to speed on the new language.
C# Can interop with C++ code. You can start writing new code in C# and have it call existing c++ code when needed. It wouldn't have to be just for UI. Look into C++/CLI and the C# Interop methods for information on how to use existing c++ code with new C# code.
Also, I asked a similar question here:
C# Performance For Proxy Server (vs C++)
CAD/CAM applications are fairly calculation intensive, and speed will definitely be one of the criteria for selecting a package, so I would be wary of moving to a slower language.
You need to think very carefully about the reasons for switching language. Is it because you don't like C++, or because C# will bring real benefits. It is quite likely to slow your application down. Check out the C++ C# speed comparisons.
Computer Language Benchmarks Game C++ vs C#
In my humble opinion, you'd be better off keeping all of the toolpath calculations in C++, and if you really must move any code over to another language, move it over to a scripting language which the user can easily edit, without re-compiling.
I use CAD/CAM applications every day at work, and there are a number of things in the UI which get on my nerves. They would be simple fixes if only I could get at the source.
If your company makes a CAD/CAM application which has a UI written in a scripting language which I can tweak (Lua, Python etc), I'll buy a copy.
Hugo
Have a look at pythonocc. Its provides you with a python module that wraps the OpenCASCADE CAD kernel. OpenCASCADE is the sole industry strength open source kernel I'm aware of. Nice features are STEP and IGES support and the ability to generate FEM meshes from BRep data.
Another thing you need to consider is platform independence - if there is a possibility that you/you company need to migrate your CAD software to Linux/Unix (Of course, for bussiness decision), it will be quite painful. Currently, even C++ with MFC/Win32 calls gave us many headache...
The Open Design Alliance library is cross-platform. They have recently introduced a beta of the .NET version of their library. See my answer to Open source cad drawing (dwg) library in C# for more details.
Having said that I concur with the other answers here - if it ain't broken, don't fix it, both the code and the coders. MSFT still use C++, as does the ODA - their codebase originates in C++ & is wrapped for .NET.
Currently I am developing in the .Net environment using C# but I want to know whether it is worth learning python. I'm thinking of learning the Django framework. What is better?
Yes, you should learn Python, but it has nothing to do with Python or C# being better. It is really about making you a better programmer.
Learning Python will give you a whole new perspective on programmer and how problems can be solved. It's like lifting weights, except you're building up the developer muscles in your mind.
For example, if you've only ever programmed using a statically typed language then it is hard to imagine any other way. Learning Python will teach you that there is an alternative in the form of dynamic typing.
For a summary of Pythons benefits:
http://www.cmswire.com/cms/enterprise-20/2007s-programming-language-of-the-year-is-002221.php
Personally I feel you can write good/bad code in any language. I also firmly believe in learning a new language every so often for the sake of learning itself. On those grounds I say if you have the time just go for it. Python is a great language that many others are inspired from.
Whether one framework or language is better or not depends on your definition of better. Do you want more work as a programmer? Do you want to develop business apps quickly, or do you want to compute 3D matrix transformations?
Once you've answered those questions you might find yourself taking a completely different direction, say F# if you had particular interest in the financial or scientific sector.
It can't hurt to learn Python, especially considering some of the heavy weights (Google) are really getting behind it.
As for the actual use, it all depends on the application. Use the best tool for the job.
Never stop learning!
That said, how can you compare the two? How good is Python support in .Net? Is there C# support in Google App Engine? It really depends what your target system is. Therefore, the more languages you have the better equipped you will be to tackle different challenges.
Depends on what you will use it for. If you're making enterprise Windows forms applications, I don't think switching to Python would be a good idea.
Also, it is possible to still use Python on the .NET CLR with IronPython.
What's better is inherently subjective. If you like Python's syntax - learn it. It will probably be harder to find a Python job, C# and .NET in general seem to be more popular, but this may change.
I also think it's worth to know at least one scripting language, even if your main job doesn't require it. Python is not a bad candidate.
Both are useful for different purposes. C# is a pretty good all-rounder, python's dynamic nature makes it more suitable for RAD experiences such as site building.
I don't think your career will suffer if you were competant in both. To get going with Python consider an IDE with Python support such as Eclipse+PyDev or ActiveIDE's Komodo. (I found a subscription to Safari Bookshelf online really invaluable too!)
I have been thinking about this same question myself. I believe however there is still a lot of stuff C# can offer that I want to get good at before I job into Python. Because Python is easier to learn it. One advantage I have found in languages is not the language itself but the materials available to learning them. For example let's say you could make a 3D game in JavaScript, but you would be more likely to find resources to do so in C++. Or you could make phone apps in PHP but C# or Java would have more material out there to help you with the phone apps. For me personally I know when I become good at programming in C# I will be able to branch off into other languages. This is the main reason I have chosen to devote most of my time to that one language. I also am learning a little bit of Java and C++ just practice thinking in other languages. I think in the future however Python will become more popular because coding is becoming more popular and Python is the easiest of mainstream languages right now.