Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: Python vs. C#

Reply
Thread Tools

RE: Python vs. C#

 
 
Brandon J. Van Every
Guest
Posts: n/a
 
      08-12-2003
Doug Tolton wrote:
>
> I've used C# full time for over two years. Finally I got disgusted
> with it and swtiched my entire company over to Python.
>
> Python:
> -Internally consistent, cleanly designed, to the point of being
> beautiful
> -Dynamic typing is amazing
> -First class functions (try mimicking that in C# - ha)
> -Tuple unpacking is a god send
> -List types are the cats meow
> -Dictionaries are blazingly fast
> -using metaclasses and the magic methods gives you amazing power and
> flexibility
> (this is just the beginning of a long list)


In your "Python pros" list, you didn't name any kind of Windows system
interface component at all. What kind of Python development on Windows are
you actually doing?

--
Cheers, www.3DProgrammer.com
Brandon Van Every Seattle, WA

20% of the world is real.
80% is gobbledygook we make up inside our own heads.

 
Reply With Quote
 
 
 
 
Michele Simionato
Guest
Posts: n/a
 
      08-12-2003
Doug Tolton <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>. ..
> "Brandon J. Van Every" <(E-Mail Removed)> wrote in message
> news:<3f36af20@shknews01>...
>> I'm beginning to think that within 5 years, no new applications will
>> be
>> written in C++.

> On 11 Aug 2003 05:33:38 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (Michele Simionato)
> wrote:
>
> >?? Are you joking or what ?? Did you learn anything from Fortran lesson?
> >Or from Lisp? Programming languages *never* die!

>
> Hey, watch the Lisp cracks!!
>
> Seriously Lisp is the Mother of all programming languages. So much of
> the features that are being implemented today come from Lisp it's not
> even funny. If you want to see what they are, take a gander at Paul
> Graham's website:
> www.paulgraham.com
>
> Lisp seriously is my favorite language. It's still got quite a few
> features that other lesser languages are working on implementing.


I cited Fortran and Lisp because they are the oldest programming
languages and they are still used. Of course, not by everybody.
Only be the "hobbyists and cranks" according to Brandon van Every's
terminology. Strangely enough, the "hobbyists and cranks" category
includes most of the academical world.
Fortran is still *very* hard to beat in its domain of application,
number crunching, and its library support is simply incredible. It will
never die (even if I see a definite trend in converting Fortran
applications to C++, at least in my domain of expertise, High Energy
Physics). About Lisp, it is simply the most powerful language ever
invented for abstract thinking. It will never die, too.
Nevertheless, I would use Scheme, not Lisp, if I had to choose. But
I don't have to choose, since Python does already everything I
want


Michele
 
Reply With Quote
 
 
 
 
Joe Cheng
Guest
Posts: n/a
 
      08-12-2003
Hi Doug,

I have no particular love for C#, but your criticism seems a little too
harsh...

> I've used C# full time for over two years. Finally I got disgusted
> with it and swtiched my entire company over to Python.


That must include plenty of time with the beta, then? Is that where most of
your bad experiences with C# were encountered?

> From my experience I have found the following:
> -C# is buggy and inconsistent.

I haven't seen this...

> -C# debugger is a piece of crap, the immediate window is worthless

I've found the debugger (VS.NET, VS.NET 2003) to be easy to use, and work as
expected. You can easily hook into existing processes, so you can for
example debug client and server pieces from the same window. The main
complaint you might have is a lack of "Edit & Continue" support. Is there
something as good for Python? (an honest question)

> -C# Garbage Collection algorithm is worthless, essentially it never
> collects until it's way to late. By that time you are screwed.

Can you elaborate? My understanding is that the CLR's GC is a quite
sophisticated, performant, generational garbage collector. And if I'm not
mistaken, interacts with the OS memory manager to vary its parameters
depending on how much free memory is available system-wide.

> -C# static typing is a major pain in the ass, it causes far more bugs
> and errors than having loose types like C ever did.

I've heard the argument that static typing slows down development, but
actually *causing* bugs?? Over C-style typing!? I'd like to hear more.

> -The .net widgets are slow and *really* buggy. Events get lost, they
> choke are large volumes of text, and the drawing.dll just pukes on
> load randomly.

OK, some of the widgets are slow and buggy... but I believe most of the few
bugs I've encountered have been due to problems in the underlying native
Win32 widgets. But I agree, this is an area where they could stand some
improvement.

> -The lack of a multi-line string drives me bananas. Try building up a
> big HTML form using a string builder sometime.
> (this is just the beginning of a long list)

I believe if you prepend the string with @, then multi-line strings are
accepted. (However, you still need to \escape any literal double quotes.)
They really need to add multi-line strings to Java... long SQL statements
are also pretty annoying to concatenate, grrrr.

> Python:
> -Internally consistent, cleanly designed, to the point of being
> beautiful

It is pretty nice.

> -Dynamic typing is amazing

Sure, if that's what you're into...

> -First class functions (try mimicking that in C# - ha)

Delegates get you a lot of what you need in C#. They are less convenient
than fcfs in the same way that C# collections or arrays are less convenient
than Python's (from a static/dynamic typing point of view). And C# will get
anonymous delegates in the next version, which will be nice--a little bit
like Ruby blocks.

> -Tuple unpacking is a god send
> -List types are the cats meow
> -Dictionaries are blazingly fast
> -using metaclasses and the magic methods gives you amazing power and
> flexibility

Agreed, agreed, agreed, agreed. Working with collections in Python is a
joy, and metaclasses and magic methods are things you simply can't get in
C#. (Well, there are dynamic proxies... but it's definitely not the same)

> Overal C# is a buggy, slow, half implementation of Java. It's written
> by committe for people dumber than themselves. If you need to perform
> some function that pushes the limits of the language, it will either
> choke, or throw an error saying it was explicitly disallowed. It's
> painful attempting to write real world apps in C#.


I've encountered more bugs in Java than C# (ok, I've worked a lot longer
with Java...) and certainly would not call C# slow compared to Java. And
it's *certainly* faster than Python, by 5-10x if I remember correctly
(unless you count C... but then you could pull the same trick with C#).
C#'s startup time compared to Java is nil, and the benchmarks between the
two for sustained performance have been inconclusive from what I've seen.

Certainly the designers of C# were designing for people dumber than
themselves--that includes almost everyone else in the world. But I
disagree with the lowest-common-denominator argument you're making. The
same has been said of Java since its inception, yet Gosling insists at every
turn that he designed the language so *he* could work faster and better. If
anything, C# gives you more rope to hang yourself with than Java.

> When you can come back with some real world experience using some of
> these languages you are bashing then your opinion might mean
> something. Right now you are just spewing Microsoft hyperbole and
> propaganda.


On the flip side, I think Python can stand on its own merits without needing
its advocates to exaggerate the shortcomings of its competition--assuming
that is what you're doing. If not, and you encountered the behavior you
described above with a release version of .NET, I (and a whole legion of
rabid Java coders on TheServerSide.com) would love to hear about it...

Please take this post in the spirit in which it was intended--I want only to
balance your unrestrained criticism of C# from the perspective of one who
has had a pretty OK experience with it, not take anything away from Python.
And again, C# is not my favorite language--not even over Java.




 
Reply With Quote
 
Aahz
Guest
Posts: n/a
 
      08-12-2003
In article <(E-Mail Removed)>,
Doug Tolton <(E-Mail Removed)> wrote:
>
>Hey, watch the Lisp cracks!!
>
>Seriously Lisp is the Mother of all programming languages. So much of
>the features that are being implemented today come from Lisp it's not
>even funny. If you want to see what they are, take a gander at Paul
>Graham's website:
>www.paulgraham.com


Paul Graham was the keynote speak for PyCon DC 2003.
--
Aahz ((E-Mail Removed)) <*> http://www.pythoncraft.com/

This is Python. We don't care much about theory, except where it intersects
with useful practice. --Aahz
 
Reply With Quote
 
Cliff Wells
Guest
Posts: n/a
 
      08-12-2003
On Mon, 2003-08-11 at 14:59, Brandon J. Van Every wrote:
> Michele Simionato wrote:
> > "Brandon J. Van Every" <(E-Mail Removed)> wrote in message
> > news:<3f36af20@shknews01>...
> >> I'm beginning to think that within 5 years, no new applications will
> >> be
> >> written in C++.

> >
> > ?? Are you joking or what ?? Did you learn anything from Fortran
> > lesson? Or from Lisp? Programming languages *never* die!

>
> Ok, "no" new applications may be a bit strong. There will always be
> hobbyists and cranks.


And which group do you fall under?

> 20% of the world is real.
> 80% is gobbledygook we make up inside our own heads.


Living up to your sig'ly yrs,

--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 (800) 735-0555


 
Reply With Quote
 
Brandon J. Van Every
Guest
Posts: n/a
 
      08-12-2003
Cliff Wells wrote:
> On Sun, 2003-08-10 at 13:55, Brandon J. Van Every wrote:
>
>> Java and C# are the obvious languages that are not going away.
>> Python? What industrial entity is going to champion Python?

>
> Perhaps people who think for themselves and simply choose the best
> tool
> don't need shiny brochures and a pat on the back from a salesman to
> feel they've made a good choice.


If I had coffee, I'd be the one choking on it.

> You're starting to sound like your
> research was done on page 3 of PC Magazine.


And how many corporate managers do you think do exactly that?

> If you think it takes major marketing to push a language, let me ask
> you
> this: what are you doing on this list? No, really. You couldn't
> possibly have discovered Python without a major corporate advertising
> campaign, so how did you find your way here? It seems almost...
> contradictory.


Python is known in the game industry. There's a steady trickle of
programmers who extol its virtues. Unlike certain advocates in c.l.p, they
give both sides of the story. A GDC 2002 speaker will not irresponsibly
sell you on merits, without commenting on integration issues with C++ and
the debugger environment. Humongous Entertainment, for instance, "solved"
problems of this sort by writing an open source debugger. Also, the
companies using Python seem to be writing 2D adventure games (low
performance app) and scripts for Massively Multiplayer Online Games (stuff
is gonna get scripted in something). Not 3D engines.

In my case, I thought I needed a scripting language for user AI extensions
in my game. I had absolutely no interest in inventing a scripting language,
so I surveyed all available scripting languages for their merits and
demerits. Python emerged as the one with the best features, the simplest
syntax, and most importantly the best community support. The downside
appeared to be performance. But overall, it looked like the best fit to the
problem.

As it turned out, the problem went away. Looking closer and closer at the
AI problems, I had serious reservations that any casual hobby programmer
could handle low level AI problems without serious brainpower and hard work.
There was no point in providing the service if few to no people would use it
in practice. I decided that I should do the low level AI stuff in whatever
langauge was appropriate, probably C++. Once I had a more stable, high
level API for what I was doing, then worry about user AI. So now I had no
immediate reason to use Python.

Looking for reasons why I might still use Python, I examined 2D + 3D GUI
problems. Could I get cross-platform widgets that could be skinned for game
development and would run on any platform? Would they integrate well with
my 3D code? I found at least one project along those lines, but as a
sideshow project without a lot of industrial testing, I wasn't willing to
make a big learning curve committment just over that. It didn't look "prime
time" and the whole point of switching to Python is to save work, not create
it. So I put that idea on the backburner.

More recently I've realized what a chore C++ is, and how it limits my
development. I hate the look of STL, I"ve always avoided it, and I could
really use lists, collections, dictionaries, etc. for some problems. I've
never done much memory management, but even the tiny amount that I have done
tends to be tedious. So recently I started considering the advantages of
higher level languages.

Available were: Python, Java, C#. They can all do the "higher level
language" job, but C# currently has slam dunk advantages on the Windows
platform. It's pretty much a no-brainer for a Windows developer who's been
doing lotsa C++ but is tired of it.

>> But I am not seeing Python's overwhelming utility compared to other
>> languages.

>
> Then perhaps you should spend less time trolling the newsgroups and
> more time programming.


Perhaps you should spend more time programming on Windows.

> Perl isn't a bad language? Perl is a terrific tool but a terrible
> language. I could go on, but I think your own statements sum up your
> abilities to make any sort of qualitative judgement regarding
> programming languages. No wonder you chose C++.


Please notice my e-mail address as to what kinds of tasks have been
historically most important to me. If you don't see why C++ is a better fit
to low-level 3D graphics problems than Python, well....

--
Cheers, www.3DProgrammer.com
Brandon Van Every Seattle, WA

20% of the world is real.
80% is gobbledygook we make up inside our own heads.

 
Reply With Quote
 
Cliff Wells
Guest
Posts: n/a
 
      08-12-2003
On Tue, 2003-08-12 at 11:52, Brandon J. Van Every wrote:
> Cliff Wells wrote:
> > On Sun, 2003-08-10 at 13:55, Brandon J. Van Every wrote:
> >
> >> Java and C# are the obvious languages that are not going away.
> >> Python? What industrial entity is going to champion Python?

> >
> > Perhaps people who think for themselves and simply choose the best
> > tool
> > don't need shiny brochures and a pat on the back from a salesman to
> > feel they've made a good choice.

>
> If I had coffee, I'd be the one choking on it.


Would it stop you from typing if you were?

> > You're starting to sound like your
> > research was done on page 3 of PC Magazine.

>
> And how many corporate managers do you think do exactly that?


What difference does that make to me (or you)? If a corporate manager
tells you to develop your 3D renderer in Python, does that make it a
good choice? Would you go ahead and do it, knowing that failure is
practically guaranteed, or would you instead try to change their mind
based upon the actual merits of the respective tools and maybe try to
find another job if you couldn't?

> > If you think it takes major marketing to push a language, let me ask
> > you
> > this: what are you doing on this list? No, really. You couldn't
> > possibly have discovered Python without a major corporate advertising
> > campaign, so how did you find your way here? It seems almost...
> > contradictory.

>
> Python is known in the game industry. There's a steady trickle of
> programmers who extol its virtues. Unlike certain advocates in c.l.p, they
> give both sides of the story.


And this would mean a lot more to me than some corporation telling me
their latest product will solve all my programming problems on every
platform. I would think the Java hype would have taught everyone a
lesson about this. I'm not sure what the other side of the story is, in
this case. Obviously Python is not well-suited for all problems. It's
probably better suited than C# for most things. If I were going to use
C#, I'd use C instead. To me, C# combines all the faults of an
interpreted language with all the faults of a compiled language. There
is always a balance to be made between sacrificing one feature to gain
others. Python sacrifices speed for flexibility, ease of use and true
cross-platform functionality. C sacrifices those things for speed and
being close to the metal. If Python were weaker in one of those areas,
then the tradeoff might not be worth it. C# is the biblical lukewarm
spew. It's neither as fast as C nor as flexible as Python.

> A GDC 2002 speaker will not irresponsibly
> sell you on merits, without commenting on integration issues with C++ and
> the debugger environment. Humongous Entertainment, for instance, "solved"
> problems of this sort by writing an open source debugger.


Why is "solved" in quotes? Isn't this the nature of open source
development? If something you need doesn't exist, you write it. What's
the problem?

> Also, the
> companies using Python seem to be writing 2D adventure games (low
> performance app) and scripts for Massively Multiplayer Online Games (stuff
> is gonna get scripted in something). Not 3D engines.


<Gasp> So you would recommend C# or Perl instead?

> In my case, I thought I needed a scripting language for user AI extensions
> in my game. I had absolutely no interest in inventing a scripting language,
> so I surveyed all available scripting languages for their merits and
> demerits. Python emerged as the one with the best features, the simplest
> syntax, and most importantly the best community support. The downside
> appeared to be performance. But overall, it looked like the best fit to the
> problem.


Then what's the problem?

> As it turned out, the problem went away. Looking closer and closer at the
> AI problems, I had serious reservations that any casual hobby programmer
> could handle low level AI problems without serious brainpower and hard work.


Again I'm stunned <wink>

> There was no point in providing the service if few to no people would use it
> in practice. I decided that I should do the low level AI stuff in whatever
> langauge was appropriate, probably C++. Once I had a more stable, high
> level API for what I was doing, then worry about user AI. So now I had no
> immediate reason to use Python.


Seems fair.

> Looking for reasons why I might still use Python, I examined 2D + 3D GUI
> problems.


Perhaps this is the crux of the problem. Looking for a problem so you
can use a particular tool. Doesn't that seems a bit, um... backwards
to you?

> Could I get cross-platform widgets that could be skinned for game
> development and would run on any platform? Would they integrate well with
> my 3D code? I found at least one project along those lines, but as a
> sideshow project without a lot of industrial testing, I wasn't willing to
> make a big learning curve committment just over that. It didn't look "prime
> time" and the whole point of switching to Python is to save work, not create
> it. So I put that idea on the backburner.
>
> More recently I've realized what a chore C++ is, and how it limits my
> development. I hate the look of STL, I"ve always avoided it, and I could
> really use lists, collections, dictionaries, etc. for some problems. I've
> never done much memory management, but even the tiny amount that I have done
> tends to be tedious. So recently I started considering the advantages of
> higher level languages.


As do most people, at one point or another.

> Available were: Python, Java, C#. They can all do the "higher level
> language" job, but C# currently has slam dunk advantages on the Windows
> platform. It's pretty much a no-brainer for a Windows developer who's been
> doing lotsa C++ but is tired of it.


Sort of like Visual Basic was a few years ago. I'll leave it open to
speculation whether C# has "slam-dunk" advantages anywhere, but you've
raised another question: Why, two paragraphs ago, were you looking for
"cross-platform" tools, and now it's all about Windows? Are you even
sure what your goal is? Do you want cross-platform? Then C# probably
won't be the answer. Yes, I'm aware of Mono. I'm also aware of how MS
strives to create incompatibilities in cross-platform tools. That makes
it a probable slam-dunk right in the toilet as far as I'm concerned.

> >> But I am not seeing Python's overwhelming utility compared to other
> >> languages.

> >
> > Then perhaps you should spend less time trolling the newsgroups and
> > more time programming.

>
> Perhaps you should spend more time programming on Windows.


And perhaps you should procreate with a lawnmower You see, this is
probably what differentiates us right here. I enjoy programming and
don't see any reason to torture myself with subpar tools. Besides, I
don't see what programming on Windows has to do with Python's utility as
a programming language. If you're referring to the ability to interact
with the Win32 API then there is Mark Hammond's win32all package which
seems to do the job quite well.

> > Perl isn't a bad language? Perl is a terrific tool but a terrible
> > language. I could go on, but I think your own statements sum up your
> > abilities to make any sort of qualitative judgement regarding
> > programming languages. No wonder you chose C++.

>
> Please notice my e-mail address as to what kinds of tasks have been
> historically most important to me. If you don't see why C++ is a better fit
> to low-level 3D graphics problems than Python, well....


Again, I'm stunned. A static compiled language is better than a dynamic
interpreted one for CPU-intensive tasks? Anyway, that was more of a
poke at your apparent fondness for screwed-up languages.

The reason you've raised my ire is that you clearly aren't too familiar
with either Python or C# yet seem to want to argue about the merits of
both with people who are clearly more knowledgeable about them than you
are. That to me is just plain silly. If you want to know which tool is
best for the job, it's fine to ask somebody who knows. If you don't
believe them, try it yourself. But please don't *argue* with them.

You also made some clearly speculative statements yet forwarded them as
if they were foregone conclusions (we should all just throw in our hats
and do C# on Windows, apparently). People like you were telling me that
Linux was a "hacker's OS" in '94 and would never make it in production
environments. I obviously should have listened <wink>.


Regards,

--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 (800) 735-0555


 
Reply With Quote
 
Cliff Wells
Guest
Posts: n/a
 
      08-12-2003
On Tue, 2003-08-12 at 14:21, Patrick Useldinger wrote:
> Brandon J. Van Every wrote:
>
> > [...]

>
> Some time ago, you started a similar discussion on C++ vs. Python. You
> pretended to be just as objective, and you turned out to be just as
> decided as you are now (funny, isn't it ?).
>
> So what the heck is the purpose? I cannot help but think that you are
> just bored. Maybe 3D-programming isn't that interesting after all ...


Apparently, it's just a way to establish some platform of credibility
with which to launch ridiculous tirades from.

Ooh. That might be an idea for a new 3D shooter <wink>

--
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 (800) 735-0555


 
Reply With Quote
 
Doug Tolton
Guest
Posts: n/a
 
      08-13-2003
On 12 Aug 2003 10:42:21 -0400, (E-Mail Removed) (Aahz) wrote:

>Paul Graham was the keynote speak for PyCon DC 2003.


This statement on Paul Graham's web site is what got me using Python:


<excerpt from the Lisp FAQ at: http://paulgraham.com/lispfaq1.html>
I like Lisp but my company won't let me use it. What should I do?

Try to get them to let you use Python. Often when your employer won't
let you use Lisp it's because (whatever the official reason) the guy
in charge of your department is afraid of the way Lisp source code
looks. Python looks like an ordinary dumb language, but semantically
it has a lot in common with Lisp, and has been getting closer to Lisp
over time.
</excerpt>

 
Reply With Quote
 
Tom
Guest
Posts: n/a
 
      08-13-2003
Patrick Useldinger <pu> wrote in message news:<(E-Mail Removed)>...
> Brandon J. Van Every wrote:
>
> > [...]

>
> Some time ago, you started a similar discussion on C++ vs. Python. You
> pretended to be just as objective, and you turned out to be just as
> decided as you are now (funny, isn't it ?).
>
> So what the heck is the purpose? I cannot help but think that you are
> just bored. Maybe 3D-programming isn't that interesting after all ...
>
> -Patrick



Quite right, Patrick. For anyone who hasn't seen the old C++ threads
and might still think that Mr. Van Avery is a non-Troll, please do a
search, read his old C++ stuff and make your own judgement. I think
it's a 'slam-dunk'.

The only reason I have bothered posting about this is that I think
valuable c.l.p. cycles are being wasted and the generosity and
open-mindedness of the c.l.p. community are being taken advantage of
by someone who appears to be, as Patrick noted, "just bored".

Sorry to be harsh, Mr. Van Avery. I have a suggestion, though. I
think you've chosen the wrong group to play in. I think you should
read a book about Lisp (maybe even two) and then share your thoughts
with the comp.lang.lisp folks. Lisp is a really neat language (not
sure but maybe there's a Lisp.NET to explore!!!) and the c.l.l. folks
will be really interested in your insights. I think you and Erik will
hit it off big time.

End of rant. Don't feed trolls.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [Python-Dev] [python-committers] [RELEASED] Python 3.2 rc 1 R. David Murray Python 0 01-17-2011 02:23 PM
Re: [Python-Dev] [python-committers] [RELEASED] Python 3.2 rc 1 Senthil Kumaran Python 0 01-17-2011 10:31 AM
Re: [Python-Dev] [Python-3000] RELEASED Python 2.6a1 and 3.0a3 Martin v. L÷wis Python 0 03-01-2008 10:51 PM
Re: [Python-Dev] [Python-3000] RELEASED Python 2.6a1 and 3.0a3 Paul Moore Python 0 03-01-2008 10:39 PM
Searching comp.lang.python/python-list@python.org (was: UTF-8) skip@pobox.com Python 0 03-10-2007 02:50 PM



Advertisments