Sign in to follow this  
modmiddy

C# vs Python: A Few Questions

Recommended Posts

I've decided to learn programming and after much research have narrowed it down to Python and C#. For me Visual C# is a huge plus. However, I am uncertain if it is that big of a plus in the long run. So I have a couple of questions; 1. Does a visual IDE really save you that much time? 2. Is C# considered a high level programming language like Python is? 3. Does C# theoretically have a steeper learning curve due to the need to learn .Net as well as C#? 4. Is C# a smarter choice if I only plan on developing for the Windows platform? That is, does C# have clear advantages over Python when developing Windows OS only programs.

Share this post


Link to post
Share on other sites
I honestly have no clue what it even means to "learn programming" these days, given that the term Hacker these days is applied to someone who learned Ruby and built a web app. So here are just some random thoughts:

Quote:
1. Does a visual IDE really save you that much time?
It can. Or it might get in the way. Either way - it does nothing to teach programming, I'd have to say some features hinder learning of programming, but can help get stuff done.

Quote:
2. Is C# considered a high level programming language like Python is?
When you are stuck in a room full of bored CS students, that is a topic that will keep discussion going for hours.

For everything else - it doesn't matter.

Quote:
3. Does C# theoretically have a steeper learning curve due to the need to learn .Net as well as C#?


Languages, as such, don't do anything useful besides basic arithmetic. To do anything - you need libraries. Most languages come with fixes set of features packed nicely in so-called Standard Library. This is .Net.

If you want to do the same thing with Python, you will need to learn just as much, it just won't come conveniently packaged with the IDE, and you will need to piece it together from various sources.

In the long run, it doesn't matter as much, since all other factors matter more (pricing, portability, support, ...).

Quote:
4. Is C# a smarter choice if I only plan on developing for the Windows platform? That is, does C# have clear advantages over Python when developing Windows OS only programs.

It has lower barrier to entry. In the long run, it doesn't matter. I believe Python has QT bindings, so they are equivalent.


But none of the above will teach you programming (as in how to solve problems, engineer solutions, algorithms, etc...). So in this respect, it doesn't matter.

Share this post


Link to post
Share on other sites

Quote:
1. Does a visual IDE really save you that much time?


I feel that for most developers it really does save them some time. As a beginner, however, there is going to be quite a bit of reference checking that will slow it down either way.

Quote:
2. Is C# considered a high level programming language like Python is?


As has been stated, the discussion could go on for hours. I would put C# slightly lower than python on the high/low level scale.

Quote:
3. Does C# theoretically have a steeper learning curve due to the need to learn .Net as well as C#?


.NET in itself is not much of an extra undertaking. Through practice you will begin to learn the various parts. One added benefit of learning .NET is carries with it a whole bunch of languages including VB.NET and C++ /CLI. That fact alone can make getting into those languages easier.

Quote:
4. Is C# a smarter choice if I only plan on developing for the Windows platform? That is, does C# have clear advantages over Python when developing Windows OS only programs.


It needs to be pointed out that C# programs can be run on Mac/Linux with a few exceptions (Windows Presentation Framework for one) through the mono project. Check it out here: http://www.mono-project.com/Main_Page

Overall, either language is a great choice. The number one thing is GET STARTED. Don't worry so much about learning the CORRECT language. There isn't one. Just languages made for different purposes. Any language you learn will help you in the long run.

Share this post


Link to post
Share on other sites
Moving you to For Beginners.

Quote:
Original post by modmiddy
1. Does a visual IDE really save you that much time?
As with all things this depends somewhat upon your personal style and preferences, but I would say that on average a "visual IDE" with properly integrated tools (good debugging facilities, code completion, syntax highlighting, etc.) will save time on any non-trivial projects.

Due to the additional complexity there will however be a learning curve involved when you first start off with these tools, meaning that you may not see these advantages until you're more experienced and have learned to make proper use of them.

For trivial projects (simple one-off scripts and the like) a simple text editor or a very basic editor -- like the interactive interpreter provided by Python -- is often quicker to work with.


In my personal opinion good IDE can be invaluable and is worth spending a little extra time learning, and it is worth seeking out and mastering the best available editor which suits your personal preferences for whichever language you choose to make use of.

Quote:
2. Is C# considered a high level programming language like Python is?
Different people have different opinions, and you'll probably get varying responses to this.

My own response is to consider C# higher level than languages such as C or C++, but perhaps slightly lower level than Python. Either is an excellent choice for a beginner.

Quote:
3. Does C# theoretically have a steeper learning curve due to the need to learn .Net as well as C#?
As has already been explained, programming languages aren't much use without accompanying libraries, and .NET provides a lot of that for C#. You'll still have to learn libraries when using Python if you want to do anything non-trivial, they'll just have different names and may not be all packaged together as with .NET.

Quote:
4. Is C# a smarter choice if I only plan on developing for the Windows platform? That is, does C# have clear advantages over Python when developing Windows OS only programs.
Neither has clear advantages in a general sense, it depends on your personal goals and preferences. Both are excellent choices, and you should do just fine with either.

C# may allow you to achieve more impressive results with greater ease due to the availability of XNA if that interests you.



My general advice: just pick one and get started with it - if you stick with programming you'll end up learning multiple languages in the long run anyway, and either choice will have both advantages and disadvantages.

Hope that helps. [smile]

Share this post


Link to post
Share on other sites
So the guys above me provided some pretty good answers to your questions already. I thought I'd propose another question you should consider. Which is "Why did you decide to learn a programming language?"

It's near 2am so forgive my crappy analogies but you don't decide to learn how to use a drill, if you want to hammer a nail... both languages have their advantages and disadvantages so it's not always a clear cut answer.

If you decided to learn a programming language in order to write an application which solves a problem you find interesting, then consider asking in the forums which choice would be better for that task. Right now, all things knowledgewise are pretty equal for you, so this would allow you to make an informed decision on how to start a specific task.

If you decided to learn a programming language to hopefully make a career out of it one day, then first, as a professional programmer I will applaud your decision! From the standpoint of building a profession, you may want to do some homework on what languages are in the most demand from companies as that may sway you.

Chances are whichever one you choose, you'll inevitably be forced to look at code originally written in another language. My career has taken me through C++ to Java/javascript/HTML/AJAX, to LUA, to ASP.NET, C# and C++/CLi over the course of around 9 years. Oddly enough, no Perl or Python. If you're learning to be a professional programmer you'll find that no matter the choice, design patterns are pretty common to all languages so they really end up differing on syntax... and that's pretty easy to pickup.

You really just need to decide on a project, realistic in scope, that you're passionate about seeing through to completion and run with it.

Share this post


Link to post
Share on other sites
Quote:
Original post by modmiddy
1. Does a visual IDE really save you that much time?


for c# the intelisense (visual studio) is absolutly fantastic and I that alone will easily save time.

I've only written soem very basic python (modifying simple games and blender export scripts) so my experience is very limited but it was a right pain not having everything right there on intelisense. Perhaps some python development tools do this though.

I would definatly suggest c#

Share this post


Link to post
Share on other sites
The interactive python console is pretty awesome, for learning programming and just for messing around. I wrote a couple python functions to help me with my math homework a while ago, stuff like listing function outputs and finding factors. It helped a lot. If I want to make a computer do some complex math for me, I go to Python, not Windows's dinky calculator program.

Also, I think it might be a good idea to at least have some experience IDE-less, at the command line, just to give you a flavor of what's going on underneath. That will be easier in python. Just cd your/script/directory, and python yourscript.py. It's also good not to be reliant on intellisense or code completion.

Just my $0.02.

Share this post


Link to post
Share on other sites
I've used both and they are both easy to use languages with an abundance of tools and online help.

At your level you are talking about the difference between a Honda Civic and a Toyota Camry. The most important thing for you will be to pick ONE language and stick with it until you can do something meaningful with it.

If I was you I would google C# beginner tutorial and Python beginner tutorial and see which one has tutorials that you understand more easily. Don't spend more than 10 minutes making a decision, it will be time better spent learning either.

Share this post


Link to post
Share on other sites
1 No yes maybe. It helps with code completion, it hinders with code completion just think as you are typing someone keeps stopping you and says did you mean X if you don't completely remember X it is a great boon but it also causes a break in concentration. Personally I turn off the auto pop up(note it is still available manually by Crtl-space.) You get similar results using tools that aren't quite as heavy for other languages(Tags and Ctrl-p in VIM)

2. Yes

3. Not really You can completely ignore any part of .Net That you aren't using at the time. Anything you did using .Net would require similar libs on the python side only the python side would be less integrated unless it was in the python standard lib.

4. I am a little partial to XNA. I would say C# might get you a little farther with a little less effort.

Share this post


Link to post
Share on other sites
Well we're on the topic of comparing C# and Python, would anyone care to explain to me the drawbacks of using C#? Python was my language of choice, so I'm aware of where it falls short. It seems Python isn't as fast as languages such as C++, but does the same apply to C#?

Share this post


Link to post
Share on other sites
PyDev is meant to be quite good, its basically a python plugin for eclipse.
I love autocomplete myself, if only for saving you time while learning a new library.
I remember when I was using/learning Ogre it was invaluable.

Share this post


Link to post
Share on other sites
Quote:
Original post by Jonathan5
Well we're on the topic of comparing C# and Python, would anyone care to explain to me the drawbacks of using C#? Python was my language of choice, so I'm aware of where it falls short. It seems Python isn't as fast as languages such as C++, but does the same apply to C#?


For a beginner, C# will probably take about 30 extra minutes of overhead to explain classes, main functions, etc. before being able to compile a hello world app. After that, the differences will be mostly a matter of personal preference.

As a beginner and/or a small time indie developer you will not hit the point where your programming language is the bottleneck of your program. If you do, you are probably doing something wrong.

IMO, Python has advantages with indentation and syntax. I like C# because I am addicted to Visual Studio and I think XNA is the best thing since sliced bread. But I am also biased because I came from a C/C++ background and DirectX.

Both are incredible tools compared to what was available even 5 years ago. Pygame or XNA can have you building a pong clone in under an hour with no prior experience in the language.

Share this post


Link to post
Share on other sites
Quote:
Original post by Jonathan5
It seems Python isn't as fast as languages such as C++, but does the same apply to C#?

In my experience naive C# is faster than naive C++, lightly optimized C# is about on par(but a little behind) with lightly optimized C++, and heavily optimized C# is slower than heavily optimized C++. Basically in the heavily optimized C++ case you hand write a number of things C# gives you for free like fast memory allocation, then you beat C# on run time overhead.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this