Python vs C#

转载 2006年06月04日 12:05:00
> I've used Python for most of my university projects so far (at least
> where I could choose what to use), and I've had professors look at me > asking why I chose "an outsider" like Python over languages (considered
> to be "stronger") such as C++ and SML (whatever...).

> They only asked until they had a look at the code I had produced. :)

Likewise. And I actually succeeded in getting several people
interested. I love Python. But I love C# just as much and it is hard
to say which one I love better.

No too long ago, I had to create a tool for an information retrieval
project. I needed RegEx, GUI, Containers and Database features. And I
needed to make this fast. First I looked at Delphi. It had by far the
BEST GUI framework. Nothing else even comes close for GUI RAD. In most
cases, I just need to go a web site like and simply pick
from a choice of open source components. BUT it did not have RegEx.
Sure there was a lib or 2 out there but nothing standard. Same story
with containers.

Then I started with Python. Python had everything I needed. But my app
was GUI rich and it was taking too long to layout the interface. Even
with Boa Contructor, it still was taking a while. I had already
finished writing most of the classes for the app.

I switched to C#. Surprise. It took me hardly any time to port the
Python code to it. For everything I needed from Python, I had direct
analogues in C# (at least in the context of my app). And I finally
wrapped everything up quite quickly. I enjoyed C# as much I enjoyed
Python. Of course, the user was quite dismayed when I told him about
the 28 MB of dependencies. But the software did exactly what it was
expected to.

As for static typing, that never slows me down. What makes C++ slower
to program in not declaring types. It's the memory details to watch,
complex developmental cycles (not just compile time), lack of quick
libraries (batteries included) that we get with languages like Perl
and Python etc.

What enhanced my C# experience has a lot to do with mature tools than
with the language per se. The VS2003 IDE is far more complete than
PythonWin and Boa. Code Completion, Help integration for example is
far more mature and often means I rarely have to refer to the docs.

The standard library is fantastic as well. MS finally made a
developmental tool that is hard to point fingers at.

Personally I would like to see Python in a .NET environment. Not some
silly IDE add-in like Visual Python. One comment in this thread was
that Python's dynamic typing makes it difficult to port it to .NET.
But Perl is dynamically typed too. And ActiveState has a feasible .NET
language with Perl. What gives for Python? I don't know much about the
language internals but I believe true integration of Python into VS
will do it a world of good.

Adding onto "what C# can do that Python can't?", I am now developing
an app for the PocketPC with the Compact Framework in C#. The app is
every bit as professional as an experienced programmer might have
developed with eVC. And I was able to do it in a fraction of time of
it might have taken with C++ and MFC and this is my FIRST PocketPC
app. Python cannot do that at this point of time.

Similarly ASP.NET like development experience is hard to get from
Python at this point. Yes! There are several webapp frameworks for
Python and then there is Zope. But ASP.NET is something else and suits
certain kind of web apps quite well (Though Zope is way to go for
CMS). I am sure Python community will catch up eventually to this
paradigm but for now it doesn't.

从C#到Python —— 1 变量和数据类型

从C#到Python —— 1 变量和数据类型 Posted on 2010-02-27 11:41 闫小勇 阅读(4790) 评论(7) 编辑 收藏  “一切数据是对象,一切命名是引用”...
  • jfkidear
  • jfkidear
  • 2012年12月19日 19:44
  • 1213


python 文件处理的打开方式有很多种, os.mknod("test.txt") 创建空文件 fp = open("test.txt",w) 直接打开一个文件,如果文件不存在则创建文件 open ...
  • longshenlmj
  • longshenlmj
  • 2013年08月12日 12:54
  • 11269


  • u013176681
  • u013176681
  • 2014年01月15日 21:09
  • 2127

VS2010 下C#调用与整合python函数

1.下载IronPython2.7( 2.安装IronPython2.7 3.VS2010创建Console程式,参考引用C...
  • goldworm2012
  • goldworm2012
  • 2012年05月31日 18:13
  • 2010


VS2017详情 作为50G吊炸天IDE,VS2017对于python的支持也是很给力...
  • sm9sun
  • sm9sun
  • 2017年07月18日 17:33
  • 7695


最近在做在.NET平台调用python文件。 使用的工具为IronPython,VS2017 使用的语言为C#,python(2.7) 怎么使用请看这里 这篇文章主要是说下遇到的处理中文字符时...
  • qq_33363973
  • qq_33363973
  • 2018年01月12日 13:18
  • 174

Python调用C# Com dll组件实战

类似于这种C# 能实现的功能而在Python下实现不了的,搜集资料有两种解决方案,第一种方式,使用IronPython 直接调用C# dll文件,教程网上很多,不在赘述了,这种方式有个缺点,用的是ir...
  • qqaiqqaiww
  • qqaiqqaiww
  • 2017年10月11日 13:21
  • 2300

Python vs C#, Dynamic vs Managed Compiled

Python vs C#, Dynamic vs Managed Compiled Python is a dynamic language, and C# is a managed compiled...
  • r_mosaic
  • r_mosaic
  • 2008年01月24日 12:36
  • 915


  • fmxfmx2011
  • fmxfmx2011
  • 2014年06月14日 13:33
  • 1403


  • Catalyst_ZX
  • Catalyst_ZX
  • 2015年08月07日 09:13
  • 1173
您举报文章:Python vs C#