Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python vs. C#

39 views
Skip to first unread message

Brandon J. Van Every

unread,
Aug 9, 2003, 6:59:05 PM8/9/03
to
What can I do with Python that I can't do with C#?

I'm currently going up a learning curve about C# and .NET. I've avoided
"Microsoft stuff" for a rather long time, but there's this reality that I
currently live in Seattle. I need gigs, so swallowing C# and .NET is
currently the way to go. While swallowing, I've been surprised to find out
that on paper, C# and .NET look like well implemented systems. C# could be
glossed as "C++ without the headaches." I certainly don't care for the
headaches of C++, I've just spent most of the last 11 years avoiding them,
that's how I've gotten by. Also C#, like Python, has higher level data
types built right in. No more memory management, no more implementing
linked lists over and over again .NET Framework could be glossed as "an
interoperability environment for programming languages." So long as your
language looks a lot like C#. ;-)

Some open source projects are trying to clone .NET and provide a C#
compiler. So, C# may not remain a "Windows thing," although it will remain
driven by Microsoft. We'll have the age-old question, can open source keep
up with Microsoft, enough to be usable and of interest to people? Don't
really know at this point. But I do know, from reading the Linux
newsgroups, that Linux people have failed to provide "an interoperability
enviornment for programming languages." That's why some people are looking
to clone .NET. Microsoft is leading in this area.

So again my question is, language-wise, what can I get done with Python that
I can't get done with C#? What is easy to express in Python, that is
tedious, difficult, or impossible to express in C#?


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

Terry Reedy

unread,
Aug 9, 2003, 8:50:23 PM8/9/03
to

"Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in message
news:3f357a9b@shknews01...

> What can I do with Python that I can't do with C#?

Given that all Turing complete languages are theoretically equivalent,
nothing, either way.

But...

> So again my question is, language-wise, what can I get done with
Python that
> I can't get done with C#?

Same question, same answer. but...

> What is easy to express in Python, that is
> tedious, difficult, [or impossible] to express in C#?

Different question, more realistic answer...

I don't believe there are many C# experts who post here, so I'll share
the teeny bit I know from other postings.

The smart people who investigated integrating Python as a full-fledged
.NET CLR language gave up because they found the [common intermediate
language] to be unsuitable for Python. I believe it had to do with
dynamic typing vs. C#, etc, static typing. So I speculate that
generic programming (writing functions that work with any behaviorally
compatible objects) is much easier in Python than C#.

Maybe someone more knowledgable will chime in.

Terry J. Reedy


Brian Quinlan

unread,
Aug 9, 2003, 10:30:45 PM8/9/03
to
> So again my question is, language-wise, what can I get done with
Python
> that I can't get done with C#?

Nothing, as both are Turing complete.

> What is easy to express in Python, that is tedious, difficult, or
> impossible to express in C#?

1. the .NET class library is fairly robust but a lot of powerful types
aren't available as literals in C# (or there literals have usage
restrictions e.g. array literals are only available during variable
initialization)
2. the entire reflection API in .NET is painful to use and mainly
provides
features that are automatic in Python
3. C# forces you to do a lot of type casting (for some reason it doesn't
even allow covariant return types)
4. forcing everything into a class is stupid e.g. does anyone really
like
writing Math.sin(x) over sin(x)?

Sorry, no time for more; dinner time.

Cheers,
Brian


Daniel Klein

unread,
Aug 9, 2003, 11:22:48 PM8/9/03
to
On Sat, 9 Aug 2003 15:59:05 -0700, "Brandon J. Van Every"
<vane...@3DProgrammer.com> wrote:

>What can I do with Python that I can't do with C#?

You can go home on time at the end of the day.

Dan

Brandon J. Van Every

unread,
Aug 10, 2003, 12:08:16 AM8/10/03
to
Brian Quinlan wrote:
> 4. forcing everything into a class is stupid e.g. does anyone really
> like writing Math.sin(x) over sin(x)?

Although tacky at first glance, it's not entirely stupid. I've written
many, many variations on sin(x) cos(x) because one often wants an efficient
approximation for some algorithmically specific purpose. They all end up
with slightly funny different names, so why not namespace 'em? And IIUC,
you could simply write

using Math

and be done with the issue, I think.

Can't respond to any of your other points, I haven't a clue, which is why I
posted. :-) Thanks for the input.

Brian Quinlan

unread,
Aug 10, 2003, 1:51:44 AM8/10/03
to
> 4. forcing everything into a class is stupid e.g. does anyone really
> > like writing Math.sin(x) over sin(x)?
>
> Although tacky at first glance, it's not entirely stupid. I've
written
> many, many variations on sin(x) cos(x) because one often wants an
> efficient approximation for some algorithmically specific purpose.
They
> all end up with slightly funny different names, so why not namespace
'em?

Sure, putting everything in a namespace makes sense and, in C#,
everything must be in a namespace (in .NET, Math is in the System
namespace). So why force two levels of namespacing? You could have:

System.sin() AND
TableTrig.sin() AND
CORDIC.sin()

That is unambiguous without adding the extra level of indirection
through a class name. The Python system is even more flexible:

import math
math.sin(1.0)

OR:

from math import sin
sin(1.0)

OR:

from math import sin as msin
from CORDIC import sin as csin
import TableTrig

msin(1.0)
csin(1.0)
TableTrig.sin(1.0)



> And IIUC, you could simply write
>
> using Math
>
> and be done with the issue, I think.

Nope. The using statement is for namespaces not classes.

Cheers,
Brian


Hannu Kankaanpää

unread,
Aug 10, 2003, 5:43:09 AM8/10/03
to
"Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in message news:<3f357a9b@shknews01>...

> So again my question is, language-wise, what can I get done with Python that
> I can't get done with C#? What is easy to express in Python, that is
> tedious, difficult, or impossible to express in C#?

There aren't many single cases where Python can express things
considerably better, but in general Python leads to about 50% of the code
that you'd end up with in C# (actually, I've only had this experience
when comparing to Java or C++, but C# is quite similar to Java).

First, I'll give some of the real examples that can't be expressed
in C#. I can make a memoize()-function in Python, that remembers
what arguments were passed to a function and what the return value
was, so calling again with the same arguments is but a simple
hash table look-up.

def fib(n):
return n < 2 and 1 or fib(n - 1) + fib(n - 2)

Everyone knows what kind of recursion nightmare that is. But
let me add this line:

fib = memoize(fib)

Now fib() calculates fibonacchi numbers in linear time and
for numbers that were already calculated, it's O(1) (average case,
mind you. hashes can be slow when unlucky). I'm not an expert
in C# but I still dare to say you can't make such a generic
function as "memoize".

Python has some other features not found in C# (AFAIK, once again)
that can lead to considerably cleaner and shorter code. At least
metaclasses and generators. With metaclasses you could e.g. make
fully automatic class registration, so that each subclass won't
need a piece of code to register itself. With generators you
can make itearion over some complex system very simple, such
as iterating through a directory and all it's subdirectories. In many
other languages, this has to be done with cumbersome callbacks.

Then there are the typical things that make Python code smaller,
like dynamic types (no need for interface classes at all, or explicit
declaration of types), list comprehensions, blocks indicated by
indentation and multiple return values. So your whole program ends up
being easy to express in Python, as compared to C#.

Michele Simionato

unread,
Aug 10, 2003, 10:16:26 AM8/10/03
to
Brian Quinlan <br...@sweetapp.com> wrote in message news:<mailman.1060482616...@python.org>...

> 4. forcing everything into a class is stupid e.g. does anyone really
> like
> writing Math.sin(x) over sin(x)?

I always have thought that putting everything in classes was stupid
from a boilerplate point of view; however, it is stupid even from an OOP
point of view. Having the possibility of defining functions outside
classes is quite useful, for instance in the implementation of multi-methods.
Thinking that OOP means "everything is in a class" is a pretty naive
point of view, IMHO. Also, I feel OOP in Java to be pretty weak as compared
to Python (I am referring to multiple inheritance, metaclasses, etc). Dunno
about C#, but I am assuming here that it is on the same foot as Java.
Anyway, even if C# was better than Python (which I strongly doubt; if
speed is a concern, notice that Python has Psyco, Pyrex, SWIG, Boost,
etc. etc.) I would not waste my time in learning something which could
disappear in few years (Microsoft's policy in supporting programming
languages is well know).

Just my $0.02,


Michel

Simon Bayling

unread,
Aug 10, 2003, 1:28:01 PM8/10/03
to
The interactive interpreter.
>>> for i in range(10):
print i, i**i

Allows for some very quick testing and exploring, even moreso when
combined with dir(object).

Tuples.
>>> def minmax(L):
return min(L), max(L)
>>>
>>> a, b = test([4,3,1,2])
>>> a, b
(1, 4)
>>> test("bca")
('a', 'c')

A quick way to return multiple values from a function without needing to
use 'out' or explicitly put everything into an arraylist and take it out
again.

Lowered finger-typing - minmax() works on lists, tuples, and strings
without needing to make:
minmax(string s)
minmax(list l)
minmax(tuple t)

overloads.

Mixed type collections.
>>> L = [] # make an empty list
>>> L.append("1")
>>> L.append(1)
>>> for item in L:
print type(item)

<type 'str'>
<type 'int'>

In C#, (I think), everything that goes into a collection is cast to
object, and when it comes out you have to know what type you are
expecting and cast it back.

Nothing amazing to beat C# with, just some nice points, like C# has very
good database interfacing and (x ? a:b) support...

Cheers,
Simon.

"Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in

news:3f357a9b@shknews01:

eltr...@juno.com

unread,
Aug 10, 2003, 3:38:46 PM8/10/03
to
On Sat, 9 Aug 2003 21:08:16 -0700 "Brandon J. Van Every"
<vane...@3DProgrammer.com> writes:
>
> Can't respond to any of your other points, I haven't a clue,

this reminds me of that phrase I wont attribute properly
nor remember exactly but,
"one definition of insanity is asking the same question and expecting
a different answer."
another definition is responding to the same poster and expecting them to
suddenly see the light, in spite of the relative ease and speed
improvements since v2.2 when we first entered this void.
bug fixes aside, the arguments then were convincing to use as much python
as humanly possible and reap the benefits in time saved.
even if you would then take the prototype and convert into
(c,c++,c#,lisp,*), which you will almost never have to do.
unless you first optimize then design then reject before profile.
normally one designs and tests, maybe profile to reveal slow parts.
easily calling a wrapped 3rd party lib or optomizing.

the google and ASPN c.l.p archive is a valuable resource for posters and
responders alike. if only they could be automatically consulted and a
summary appended to each email.
we would not be disappointed in this case to notice past attempts by some
of the c.l.p luminaries who are now avoiding this subject or have
killfiled early on the quite brite dare I say the word,
'3D troll'.

C hasn't changed that much and python is only getting tighter.
admit it, you now love python, psyco, pyrex & indentation.
and you lurk in the hope of convincing yourself of the facts.

apology to anyone truly wanting C# or .NET integration.
is it any surprize that it will be difficult or impossible?
huge gratitude to those working on the corner cases in antique languages
and environments to make python less constricting.

________________________________________________________________
The best thing to hit the internet in years - Juno SpeedBand!
Surf the web up to FIVE TIMES FASTER!
Only $14.95/ month - visit www.juno.com to sign up today!

Samuel Barber

unread,
Aug 10, 2003, 4:23:34 PM8/10/03
to
"Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in message news:<3f357a9b@shknews01>...
> C# could be glossed as "C++ without the headaches."

C# is derived from Java. "Java with pointers (and other stuff)" would
be one way of putting it.

> Also C#, like Python, has higher level data
> types built right in.

It does not. Hash tables, expandable arrays, etc. are provided by the
standard library.

Sam

Brandon J. Van Every

unread,
Aug 10, 2003, 4:55:30 PM8/10/03
to
Michele Simionato wrote:
> I would not waste my time in learning something which could
> disappear in few years (Microsoft's policy in supporting programming
> languages is well know).

Microsoft does almost all of its internal development in C# now. It is not
going away. C# is, essentially, the .NET Framework. The advantages of C#
as an enterprise language over C++ are quite obvious, and of course
Microsoft is going to use its homegrown, not Java.

I think what C# has got going for it, is it's much better than C++ to work
with, it's got mature tools support, and performance is claimed to be good
as long as you don't create garbage collection hell. Comparing C++ to
Python, Python has obvious higher level advantages. But comparing C# to
Python, Python isn't much higher level than C#. They've got "similar
stuff," with Python adding some exotic features. Python gets style points,
but tools maturity, ubiquity, and future count for more than style points.

I'm beginning to think that within 5 years, no new applications will be
written in C++. People will still be using legacy C++ libraries, but all
new development will be in higher level langauges. Java and C# are the
obvious languages that are not going away. Python? What industrial entity
is going to champion Python? It takes a Sun, a Microsoft, or overwhelming
utility to push a language. For instance, Perl has become popular because
it's overwhelmingly useful for sysadmin and web admin. But I am not seeing
Python's overwhelming utility compared to other languages. You can do apps,
you can do web admin, but most people are doing Java, C#, or Perl. And
unlike C++ they aren't bad languages, so Python is not offering an obvious
"slam dunk" remedy.

Brian Quinlan

unread,
Aug 10, 2003, 8:31:04 PM8/10/03
to
> Microsoft does almost all of its internal development in C# now.

Do you have any basis for this claim? I would imagine that most of
Microsoft's development effort goes into Office and Windows, and neither
of those products currently use the .NET framework.

> It is not going away.

I agree.

> C# is, essentially, the .NET Framework.

Nope. That statement is as meaningless as "C++ is, essentially, the
STL".

> But comparing C# to Python, Python isn't much higher level than C#.

Yes it is. I find it odd that you claim to have very little knowledge of
C# yet you make some very bold claims as to its characteristics
(actually, IIRC, you have only made one specific claim about the
semantics of the language and that was incorrect).

> They've got "similar stuff," with Python adding some exotic features.

No, they don't have "similar stuff". C# is missing a lot of features
with respect to Python. And Python has, at least for GUI programming, no
equivalent to the .NET framework.

> Python gets style points, but tools maturity, ubiquity, and future
> count for more than style points.

I wouldn't use the word "maturity" when discussing C# tools but the VS
.NET IDE is quite impressive when it works correctly.

I'm starting to think that you are trolling. Are you?

Cheers,
Brian


Simon Wittber (Maptek)

unread,
Aug 10, 2003, 9:38:57 PM8/10/03
to
>I'm starting to think that you are trolling. Are you?

Hi Brian,

You should never insinuate that Brandon is a troll, unless you are
prepared to have your address appended to the end of his 100MB killfile.

Indeed, I believe you have guessed correctly, Brandon is a very subtle
and clever troll. For a full history, try google.
http://groups.google.com/groups?q=brandon+every


Istvan Albert

unread,
Aug 10, 2003, 10:30:20 PM8/10/03
to
Brandon J. Van Every wrote:

> For instance, Perl has become popular because
> it's overwhelmingly useful for sysadmin and web admin. But I am not seeing
> Python's overwhelming utility compared to other languages. You can do apps,
> you can do web admin, but most people are doing Java, C#, or Perl. And
> unlike C++ they aren't bad languages, so Python is not offering an obvious
> "slam dunk" remedy.

As far as I'm concerned it does not have to be "slam dunk". Just a
little better is enough, that goes a long way and adds up quickly in
larger projects. That's why people use python, it is not a conspiracy
nor a brainwashing that made it popular. For many tasks it works better
than anything else out there.

> I'm beginning to think that within 5 years, no new applications
> will be written in C++.

Most people get paid for what they get done today. Not in five years.
So I wouldn't lose sleep yet.

C# was created to counteract Java. Unlike Python it would die quickly
if it weren't for the marketing muscle of Microsoft. So claiming as
the holy grail seems a bit of a joke.

Istvan.

Simon Wittber (Maptek)

unread,
Aug 11, 2003, 1:55:45 AM8/11/03
to
>-----Original Message-----
>From: Brandon J. Van Every [mailto:vane...@3DProgrammer.com]
>Subject: RE: Python vs. C#

>Your e-mails are *not* welcome. If you send me e-mail again, I will be
>contacting your ISP about account abuse.

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


You are going to contact my ISP about what exactly? Account abuse? How
exactly am I abusing my account? By expressing my opinion that you are a
troll?

If you do not like being thought of as a troll, I suggest you stop
making what appear to be deliberately inflammatory comments cunningly
hidden among rather innocuous questions.

I am certain, of course, that this advice falls on deaf ears. You have a
history of trolling. In fact, you are quite good at it! (154 posts on
this one)

http://groups.google.com/groups?threadm=3e36d04e_2%40news.vo.lu&rnum=1&p
rev=/groups%3Fq%3Dg:thl716342609d%26dq%3D%26hl%3Den%26lr%3D%26ie%3DUTF-8
%26oe%3DUTF-8%26safe%3Doff%26selm%3D3e36d04e_2%2540news.vo.lu

I will list two more troll posts. Finding more is an interesting
exercise for the bored reader.

http://groups.google.com/groups?selm=6oli0c%24qng%241%40guysmiley.blarg.
net

http://groups.google.com/groups?selm=ltC0a.2919%24tO2.327679%40newsread1
.prod.itd.earthlink.net

Others, too, have thought your posts are deliberately provoking.

http://groups.google.com/groups?selm=1998062601400000.VAA23852%40ladder0
1.news.aol.com

You often aggravate others, seemingly intentionally. Once, it even
escalated to the point of threats of physical violence.

http://groups.google.com/groups?q=brandon+van+every&hl=en&lr=&ie=UTF-8&o
e=UTF-8&safe=off&selm=7ui75g%24918%241%40panix3.panix.com&rnum=9


So please refrain from posting your troll-comments to the list, and stop
polluting it with your contentious remarks.


Cheers,
Simon.

PS.

Pythonistas: please don't feed this troll.


Simon Wittber (Maptek)

unread,
Aug 11, 2003, 2:01:22 AM8/11/03
to
>-----Original Message-----
>From: Brandon J. Van Every [mailto:vane...@3DProgrammer.com]
>Subject: RE: Python vs. C#

>Your e-mails are *not* welcome. If you send me e-mail again, I will be

>>contacting your ISP about account abuse.

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


You are going to contact my ISP about what exactly? Account abuse? How
exactly am I abusing my account? By expressing my opinion that you are a
troll?

If you do not like being thought of as a troll, I suggest you stop
making what appear to be deliberately inflammatory comments cunningly
hidden among rather innocuous questions.

I am certain, of course, that this advice falls on deaf ears. You have a
history of trolling. In fact, you are quite good at it! (154 posts on
this one)

<http://groups.google.com/groups?threadm=3e36d04e_2%40news.vo.lu&rnum=1&
prev=/groups%3Fq%3Dg:thl716342609d%26dq%3D%26hl%3Den%26lr%3D%26ie%3DUTF-
8%26oe%3DUTF-8%26safe%3Doff%26selm%3D3e36d04e_2%2540news.vo.lu>

I will list two more troll posts. Finding more is an interesting
exercise for the bored reader.

<http://groups.google.com/groups?selm=6oli0c%24qng%241%40guysmiley.blarg
.net>

<http://groups.google.com/groups?selm=ltC0a.2919%24tO2.327679%40newsread
1.prod.itd.earthlink.net>

Simon Wittber (Maptek)

unread,
Aug 11, 2003, 2:04:36 AM8/11/03
to
>-----Original Message-----
>From: Simon Wittber (Maptek)
>Sent: Monday, 11 August 2003 2:01 PM
>To: pytho...@python.org
>Subject: RE: Python vs. C#

Apologies for the mangled URLs!

Sw.

Max M

unread,
Aug 11, 2003, 3:14:41 AM8/11/03
to
Simon Wittber (Maptek) wrote:

> Apologies for the mangled URLs!


It is not you who should be apologising ;-)


regards Max M

Brandon J. Van Every

unread,
Aug 11, 2003, 1:24:39 AM8/11/03
to
Samuel Barber wrote:
> "Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in message
>
>> Also C#, like Python, has higher level data types built right in.
>
> It does not. Hash tables, expandable arrays, etc. are provided by the
> standard library.

Ok... does this make a big difference, or any difference, in practice? Is
there something ugly or bad about the C# standard library? I've avoided C++
STL for years....

David M. Cook

unread,
Aug 11, 2003, 4:18:07 AM8/11/03
to
In article <3f36af20@shknews01>, Brandon J. Van Every wrote:

> I'm beginning to think that within 5 years, no new applications will be
> written in C++. People will still be using legacy C++ libraries, but all
> new development will be in higher level langauges. Java and C# are the
> obvious languages that are not going away. Python? What industrial entity
> is going to champion Python? It takes a Sun, a Microsoft, or overwhelming

I read all the way to this point in the thread before wrinkling my nose and
looking at the From: line, and then chuckled when I saw the name. Van Every
does it again! What an obnoxious know-nothing twit! But the jokes on me
for wasting my time with his self-important blather.

Dave Cook

Duncan Booth

unread,
Aug 11, 2003, 4:58:28 AM8/11/03
to
"Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in
news:3f357a9b@shknews01:

> So again my question is, language-wise, what can I get done with
> Python that I can't get done with C#? What is easy to express in
> Python, that is tedious, difficult, or impossible to express in C#?
>

C# (or rather the CLR) has collection types that are superficially similar
to Python's list and dict types. A lot of C# programming becomes much
easier when you start using ArrayList et. al to do things in a Pythonic
manner, BUT with C# you cannot manipulate objects without casting them back
to a known type. This is a pain. If I have two objects and they are both
integers, then in C# I have to cast them to 'int' before adding them. Or if
they are strings I have to cast them to string before adding them. In
Python I know they are a suitable type, so I just add them without thinking
about it.

What this means is that you waste a lot of energy in the C# universe
defining type-safe subclasses of the collections just to avoid cluttering
your code with a lot of superfluous casts.

Python has a much more flexible syntax for function arguments. You can have
optional arguments, keyword arguments, you can even have functions where
you don't know the names of all the keyword arguments in advance. C# just
has overloading, so you need to define a new overload for every optional
argument and you can't call a function missing out some arguments from the
middle of the list.

Tuple unpacking. C# just has naff reference arguments. Need I say more?

Slicing of sequences.

Python lets you write lists and dictionaries inline where you need them,
much more convenient than in C#.

Functions are first class objects in Python. C# delegates have some neat
features (async calls and multicasts), but the effort of using a delegate
in most situations is just too much.

Don't get me wrong, C# is quite good, but it just has too much syntactic
clutter obscuring the code.

--
Duncan Booth dun...@rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?

Robin Becker

unread,
Aug 11, 2003, 6:40:39 AM8/11/03
to
In article <Xns93D4651C680...@127.0.0.1>, Duncan Booth
<dun...@NOSPAMrcp.co.uk> writes

>"Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in
>news:3f357a9b@shknews01:
>
>> So again my question is, language-wise, what can I get done with
>> Python that I can't get done with C#? What is easy to express in
>> Python, that is tedious, difficult, or impossible to express in C#?
>>
Eiffel.Net is alleged to have multiple inheritance, but I must admit I
wasn't entirely convinced by one of the explanations I saw. In fact at
the end of the piece it was stated that multiple inheritance was allowed
only for Eiffel classes. On the other hand there are a bunch of features
that will apparently arrive with later revisions of the CLR and multiple
inheritance is one of them.

I suspect it will be a long time before serious meta classes arrive.
--
Robin Becker

Bob Gailer

unread,
Aug 11, 2003, 7:30:28 AM8/11/03
to
What is "trolling"?

Bob Gailer
bga...@alum.rpi.edu
303 442 2625

Max M

unread,
Aug 11, 2003, 8:16:35 AM8/11/03
to Bob Gailer
Bob Gailer wrote:

> What is "trolling"?
>


http://www.urban75.com/Mag/troll.html


regards Max M

Michele Simionato

unread,
Aug 11, 2003, 8:33:38 AM8/11/03
to
"Brandon J. Van Every" <vane...@3DProgrammer.com> 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!

> Python? What industrial entity
> is going to champion Python? It takes a Sun, a Microsoft, or overwhelming
> utility to push a language.

You said it well: to "push" a language.
Python relies on his own strenght only. No help from anybody.
Nevertheless, it is still there after 13 years. You should
think about it.
And I don't see why it should not have a future longer than C#.

It is just a matter of patience: let us wait and see ;)


M.S.

Fredrik Lundh

unread,
Aug 11, 2003, 8:08:44 AM8/11/03
to

Fredrik Lundh

unread,
Aug 11, 2003, 8:22:39 AM8/11/03
to
> |this reminds me of that phrase I wont attribute properly
> | nor remember exactly but,
> |"one definition of insanity is asking the same question and expecting
> | a different answer."

that's the paxman principle, right?

</F>


Christopher Barber

unread,
Aug 11, 2003, 12:33:28 PM8/11/03
to
"Terry Reedy" <tjr...@udel.edu> writes:

> "Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in message

> news:3f357a9b@shknews01...
> > What can I do with Python that I can't do with C#?
>
> Given that all Turing complete languages are theoretically equivalent,
> nothing, either way.

Turing equivalence is probably the least interesting property of any
programming language and says absolutely nothing about its suitability for
real programming tasks.


Harry George

unread,
Aug 11, 2003, 3:07:56 PM8/11/03
to
Christopher Barber <cba...@curl.com> writes:

True, and that was probably why it was mentioned. Personally I make
the same point by saying "Sure we could do it in XYZ language, but
then we could also do it assembler. On the other hand, if you want it
done on time, with the available resources, and a hope of maintaining
it later, then look at Python."

>

--
harry.g...@boeing.com
6-6M31 Knowledge Management
Phone: (425) 342-5601

Brandon J. Van Every

unread,
Aug 11, 2003, 5:57:55 PM8/11/03
to
Istvan Albert wrote:
> Brandon J. Van Every wrote:
>
>> For instance, Perl has become popular because
>> it's overwhelmingly useful for sysadmin and web admin. But I am not
>> seeing Python's overwhelming utility compared to other languages.
>> You can do apps, you can do web admin, but most people are doing
>> Java, C#, or Perl. And unlike C++ they aren't bad languages, so
>> Python is not offering an obvious "slam dunk" remedy.
>
> As far as I'm concerned it does not have to be "slam dunk". Just a
> little better is enough, that goes a long way and adds up quickly in
> larger projects. That's why people use python, it is not a conspiracy
> nor a brainwashing that made it popular. For many tasks it works
> better than anything else out there.

Right, but what if C# is "a little better" for tools integration and extant
worker skills on the Windows platform? If it actually has its own class of
noticeable improvements in that domain, plus Microsoft's marketing muscle
behind it, then C# sweeps the table on Windows. Leaving Python to the UNIX
world. And there, it comes down to whether Python or Java is the better
tool for a particular job.

> C# was created to counteract Java. Unlike Python it would die quickly
> if it weren't for the marketing muscle of Microsoft.

I am not convinced. As the books tell it, C# was created to take the best
features of Java and some other languages. And as a dyed in the wool C++
programmer, most of what I've learned about C# so far certainly looks like
sanity. I am currently thinking of it as "C++ without the pain."

> So claiming as the holy grail seems a bit of a joke.

It's not a holy grail. It is probably a better real world language product
on the Windows platform. My question is about the strategic consequences of
that likely fact. What's Python's strategic plan? Why is there going to be
room for 4 "high level languages" in the future? Why are we going to need
Java, C#, Perl, *and* Python?

Brandon J. Van Every

unread,
Aug 11, 2003, 5:59:15 PM8/11/03
to
Michele Simionato wrote:
> "Brandon J. Van Every" <vane...@3DProgrammer.com> 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.

Brandon J. Van Every

unread,
Aug 11, 2003, 6:07:49 PM8/11/03
to
Duncan Booth wrote:
>
> Don't get me wrong, C# is quite good, but it just has too much
> syntactic clutter obscuring the code.

Ok, so Python is "more flexible" than C#. If I start doing problems that
require a lot of flexibility, I'll remember this about Python and consider
it. To date I've not been working on such problems, but that could change.
And C# might still prove to be "flexible enough."

Terry Reedy

unread,
Aug 11, 2003, 8:45:17 PM8/11/03
to

"Christopher Barber" <cba...@curl.com> wrote in message
news:pso8yq0...@bandit.curl.com...

Huh???
This is a paraphrase of what I said. So why did you silently clip the
remainder of my post where I went on to discuss practical suitability?

Terry J. Reedy


Jimmy Retzlaff

unread,
Aug 11, 2003, 8:42:15 PM8/11/03
to
Brandon J. Van Every (vane...@3DProgrammer.com) wrote:
>Ok, so Python is "more flexible" than C#. If I start doing problems
that
>require a lot of flexibility, I'll remember this about Python and
consider
>it. To date I've not been working on such problems, but that could
change.
>And C# might still prove to be "flexible enough."

You almost get it. While not many problems "require" Python's
flexibility, a large number of problems can be more effectively
addressed by leveraging that flexibility. Put another way, you can often
create better solutions in less time.

Not many of Python's individual features are unique among languages
available today, but there is an amazing synergy among Python's features
that is hard to comprehend until you've used them to solve some
non-trivial problems.

In the early days of the PC there was a similar debate over the use of
Assembly versus higher level languages like C and Pascal. Not many
problems "required" the features of those higher level languages, but
people came to understand the benefits in the vast majority of
applications (benefits like time/money, maintainability, and
reliability).

Jimmy

Brandon J. Van Every

unread,
Aug 11, 2003, 9:20:19 PM8/11/03
to
Jimmy Retzlaff wrote:
>
> In the early days of the PC there was a similar debate over the use of
> Assembly versus higher level languages like C and Pascal. Not many
> problems "required" the features of those higher level languages, but
> people came to understand the benefits in the vast majority of
> applications (benefits like time/money, maintainability, and
> reliability).

Well, I think mainstream commercial industry sees the writing on the wall
regarding garbage collection. But that's probably the current level of
consensus on "yes, we need a better solution for this." Python advocates
tend to pooh-pooh strong typing, and I'm wondering if in a large-scale
industrial context, if that's really a valid stance to take. At any rate, I
expect more years of evolution with languages such as Java and C# before
mainstream industry starts thinking that the more exotic things Python does
are "better solutions" for something that definitely needs fixing.

Heiko Wundram

unread,
Aug 11, 2003, 10:00:02 PM8/11/03
to
On Tue, 2003-08-12 at 03:20, Brandon J. Van Every wrote:
> Well, I think mainstream commercial industry sees the writing on the wall
> regarding garbage collection. But that's probably the current level of
> consensus on "yes, we need a better solution for this." Python advocates
> tend to pooh-pooh strong typing, and I'm wondering if in a large-scale
> industrial context, if that's really a valid stance to take.

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. :)

Where other people had written huge amounts of C++ code for a renderer,
which was incomprehensible even to the original programmer after about a
weeks time, my code remained "relatively" short and clean (I had to
write it in 72 hours), nicely structured into separate modules, and with
a well designed class inheritance scheme (which is pretty important for
a renderer, for the user to be able to integrate his/her own objects
later on).

Metaclass programming aided me a lot here. And, yeah, I love
doc-strings!

None of my competitors could offer this, whatever language they chose
(one chose Perl, all others C++...).

None of the professors even spoke about garbage collection, none spoke
about dynamic typing, they were all just amazed at the expressive powers
Python put in my hands, all with simple syntax and a without a huge STL
(such as C++s).

I was even asked to give a Python lecture later on (not in an official
course, but for the interested). :)

I don't think that "static typing" (Python is strongly typed btw., just
to correct your statement) is any concern for most people (even for most
executives, I guess my professors count as that too), just getting a
working solution for a problem quickly, smoothly and readably. And
that's what Python excels at.

> At any rate, I
> expect more years of evolution with languages such as Java and C# before
> mainstream industry starts thinking that the more exotic things Python does
> are "better solutions" for something that definitely needs fixing.

Yeah, I can agree here. But in my experience, if I can show the people
what power Python comes with ("batteries included"), after their
amazement stops, they'll all start asking which book to buy to start
learning. Even with the "power-play" Sun and Microsoft did to boost Java
and C#, Python still seems as a valid and interesting alternative to
most people I know (except those living in the "Microsoft-Universe", of
course, but I guess I'll never save them from that big black hole
anyway).

Just my 5 eurocents.

Heiko.


Terry Reedy

unread,
Aug 11, 2003, 11:15:32 PM8/11/03
to

"Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in message
news:bh9eri$vhr5i$1...@ID-203719.news.uni-berlin.de...

> Python advocates tend to pooh-pooh strong typing,

Disinformation nonsense. Python objects are more strongly typed than
C variables. Does C# have casts?

TJR


Brandon J. Van Every

unread,
Aug 12, 2003, 12:45:47 AM8/12/03
to
Heiko Wundram wrote:

>Brandon wrote:
>>
>> Python advocates tend to pooh-pooh strong typing, and I'm wondering
>> if in a large-scale industrial context, if that's really a valid
>> stance to take.
>
> Where other people had written huge amounts of C++ code for a
> renderer, which was incomprehensible even to the original programmer
> after about a weeks time, my code remained "relatively" short and
> clean (I had to
> write it in 72 hours), nicely structured into separate modules, and
> with
> a well designed class inheritance scheme (which is pretty important
> for
> a renderer, for the user to be able to integrate his/her own objects
> later on).

Yes your rendering code is nice looking. Is it fast? Were you working on a
problem where it needed to be fast? I haven't been using C++ out of love.
I've been using it for performance. And I don't think "what I can do in 72
hours" is a valid test for big industrial system architectures. Is your
code going to hold up in the face of dozens of programmers banging on it,
and hundreds or thousands of programmers using it? And still be fast?

> I don't think that "static typing" (Python is strongly typed btw.,
> just to correct your statement)

It is? Then I'm confused, because around here people keep talking about the
beauty of avoiding types.

> is any concern for most people (even for
> most executives, I guess my professors count as that too), just
> getting a
> working solution for a problem quickly, smoothly and readably. And
> that's what Python excels at.

What you are saying is Python excels at prototyping, where speed and
flexibility are paramount. You are not saying that Python excels as a big
system architecture language, where stability and safety are paramount.

> Yeah, I can agree here. But in my experience, if I can show the people
> what power Python comes with ("batteries included"), after their
> amazement stops, they'll all start asking which book to buy to start
> learning. Even with the "power-play" Sun and Microsoft did to boost
> Java
> and C#, Python still seems as a valid and interesting alternative to
> most people I know (except those living in the "Microsoft-Universe",
> of course, but I guess I'll never save them from that big black hole
> anyway).

That "except" is, like, 1/2 to 2/3 of industry. I think you Python guys
need to wake up that there's a much bigger, scarier, and more threatening
world out there than the UNIX world of "engineering done right." That world
is also not sitting still, it's on the move. For interoperability of
langauges, UNIX has nothing to offer like the .NET Framework. DirectX is
now ahead of OpenGL on vertex/pixel shader API capability and stability.
The black hole, if not taken seriously, will swallow you. Either that or
you're forced into "clone and conquer" in reverse.

Joe Cheng

unread,
Aug 12, 2003, 1:22:52 AM8/12/03
to
(Disclaimer: I'm a relative newbie to Python; I started learning it a few
months ago because of all the buzz on Artima.com about it and Ruby (also
worthy of consideration if you like Python). On the other hand, I've been
programming full-time in C# since January (before that I programmed almost
exclusively in Java for a few years).)

From a purely language point of view, I think the comparison can be boiled
down to two main points.

* Python is dynamic, C# is static. You've got a C++ background, so it
doesn't sound like you would consider C#'s static typing a liability, nor
would you likely fall in love with metaclasses and the like. So, most of
the arguments along the lines of "C# is too inflexible" will probably not be
relevant to you.

* Python has some _really_ convenient syntactic sugar. Being able to
declare lists, tuples, and hashes as literals can be nice. List
comprehensions would knock out half the for/foreach loops I have to write in
C#. I also consider the indents-instead-of-braces to be syntactic sugar--I
for one really like them (the indents, that is). You can simply write code
faster in Python; this is not really controversial. I'm a newbie in Python
but very familiar with C#, and still for a given programming task I'd likely
be able to do it almost as fast in Python.

* It's usually easier to read a given chunk of Python code than the
equivalent chunk of C# code--as long as it's clear what types you're dealing
with (a given in C#, not so in Python) and you're not doing any clever
dynamic stuff like the "memoize" function someone else talked about in this
thread. C# code is cluttered but simple; you could say Python code is
readable but potentially tricky.

And just to throw in some further real-world differences, that I'm not sure
have been covered yet in this thread:

* .NET has, as you'd expect, really strong Win32/COM interop stories. If
you're building, say, a consumer-quality desktop app, these are really
invaluable.

* .NET has a really nice remoting framework in .NET Remoting. It is not
only quite performant and flexible, but dead easy to use. Same for XML
handling, and (from what I hear--is anyone actually building any??) web
services.

* I (and most serious programmers I've talked to) don't see a great deal of
value in the multi-language support of .NET, unless perhaps you are a class
library vendor (and all the .NET libraries I've seen have been written in
C#).

* I don't really like VS.NET, but I have to admit, I haven't heard of
anything even close for Python. (On the other hand, in everything but GUI
builders, the best Java IDEs blow away VS.NET.)

* C#/.NET has to be one of the most mature "version 1.1" programming systems
in history. (I'm too young to be making definitive statements about
programming history, though...) You can tell by reading Chris Brumme's blog
the amount of sophistication they have already achieved. Frankly, it's a
little frightening how much MS can accomplish in just a couple of
years--when they want it bad enough.

* Math.sin(x) versus sin(x)? Really, who cares??

* The .NET community does not seem as clever and innovative, nor as
passionate, as the Python community. You sorta get the sense that everyone
who works with .NET is getting paid to do so, while Python hackers bang away
on their keyboards with glee. And it feels like 90% of the innovation in
the .NET realm comes from Microsoft itself (or perhaps, 60% from MS and 30%
from the Java open-source community--NAnt, NUnit, NLucene, etc.).

To summarize, I don't particularly like C#--I'd rather be programming in
Java with IntelliJ or Eclipse. There's nothing really fun and exciting
about programming in it day-to-day (well, maybe if you're coming from C++
you'll be excited about not having to worry about memory leaks or
segfaults). The libraries generally work as billed, the compiler gives
useful warnings, the debugger is well-integrated and easy to use, the
documentation is comprehensive if not particularly deep in places.

In contrast, I like Python very much (well, actually, Ruby is the one that I
really like--but close enough). Python is worth knowing, if for nothing
else, then at least for banging out one-off scripts or string processing
programs or command line utilities (even ones of significant complexity).
The syntax feels nice, the conciseness is very refreshing, the interactive
programming environment is addictive.

However, when it comes down to building the big, hairy, slightly nasty (just
admit it) software that brings home the bacon, sometimes it's just gotta be
C#. And if you live in Seattle, I'd say it's gotta be C# all the way.


Doug Tolton

unread,
Aug 12, 2003, 1:55:21 AM8/12/03
to
On 11 Aug 2003 05:33:38 -0700, mi...@pitt.edu (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!! :-P

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.

Joe Cheng

unread,
Aug 12, 2003, 2:03:21 AM8/12/03
to
> > I don't think that "static typing" (Python is strongly typed btw.,
> > just to correct your statement)
>
> It is? Then I'm confused, because around here people keep talking about
the
> beauty of avoiding types.

Python is "strongly" typed in the sense that every object has a type. It is
not "statically" typed in that references do not have types. Statically
typed languages generally require you to declare variable types (some
languages infer them) and in return you get compile-time warnings when you
try to call methods that do not exist or perform casts that are semantically
impossible.

I may be wrong but I believe C is an example of a language with static weak
typing... you have to declare variable types and some types of errors can be
caught at compile time, but you can perform unsafe casts and not only will
the compiler not stop you but at runtime you won't get an exception--just a
possibly corrupted value in memory.

Java and C# have static strong typing.

Python has dynamic strong typing. So, if you can keep the types of your
objects straight without the help of the compiler, you get the benefits of a
concise syntax while enjoying type safety at runtime.

Someone correct me if I've gotten it wrong...


Doug Tolton

unread,
Aug 12, 2003, 2:08:51 AM8/12/03
to
On Mon, 11 Aug 2003 14:57:55 -0700, "Brandon J. Van Every"
<vane...@3DProgrammer.com> wrote:

>I am not convinced. As the books tell it, C# was created to take the best
>features of Java and some other languages. And as a dyed in the wool C++
>programmer, most of what I've learned about C# so far certainly looks like
>sanity. I am currently thinking of it as "C++ without the pain."

It's amazing that you pass yourself off as an expert in C# when you
are just reading the propaganda still. Come back and have this
discussion when you have actual experience in C#.

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

From my experience I have found the following:
-C# is buggy and inconsistent.
-C# debugger is a piece of crap, the immediate window is worthless
-C# Garbage Collection algorithm is worthless, essentially it never
collects until it's way to late. By that time you are screwed.
-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.
-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.
-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)

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)

Overall Python is a language written by programmers for programmers.
You can feel it when you use it. When you need a function, and you go
looking for it, it's already been written and it works just like you'd
think it would. It's blazingly fast, and is a joy to program in.

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

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.

Doug Tolton

Doug Tolton

unread,
Aug 12, 2003, 2:23:08 AM8/12/03
to

Ugh...he got me.

Crap.

Doug Tolton

Erik Max Francis

unread,
Aug 12, 2003, 3:26:56 AM8/12/03
to
Doug Tolton wrote:

> It's amazing that you pass yourself off as an expert in C# when you
> are just reading the propaganda still. Come back and have this
> discussion when you have actual experience in C#.

By the way, in case it wasn't obvious, there's no evidence he knows
anything about Python, either. And with his continuing admissions that
he doesn't know Standard C++ -- and seems staunchly unwilling to learn
anything about it -- we arrive at the trifecta.

--
Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ I will always remember / This moment
\__/ Sade

John

unread,
Aug 12, 2003, 4:02:07 AM8/12/03
to
> 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 www.torry.net 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.

Duncan Booth

unread,
Aug 12, 2003, 4:38:56 AM8/12/03
to
"Joe Cheng" <co...@joecheng.com> wrote in
news:Jq%Za.8237$M6.6...@newsread1.prod.itd.earthlink.net:

> Java and C# have static strong typing.
>
> Python has dynamic strong typing. So, if you can keep the types of
> your objects straight without the help of the compiler, you get the
> benefits of a concise syntax while enjoying type safety at runtime.
>
> Someone correct me if I've gotten it wrong...
>

You have it about right. C# lets you define functions that take arguments
of any type by boxing them as objects. However, to perform almost any
operation on these values you have to cast them back to their original
type. So a function that takes two objects and adds them together can't
work unless you know the type you expected the objects to be. You cannot
just add two objects, even if they are of the same type, you have to cast
(unbox) them from object back to their real type (and you have to get that
type *exactly* right, you can't for example unbox a short as an int) and
then operate on them.

[A couple of operations work directly on objects, you can convert any
object to a string, and compare objects for equality directly].

Python on the other hand will let you do something like adding two objects
together, it will perform some permitted conversions automatically, e.g.
extending int to float, but it won't attempt to do weird things like parse
a string into a number, or for that matter automatically convert a number
to a string.

Both languages are strongly typed. The drawback with C# is mainly that you
have to keep telling the language things that both you and the compiler
already know. If I have an ArrayList filled with strings, and I want to
pass one of them to a function taking a string argument, I have to
explicitly cast the element of the ArrayList back to string. If the cast
fails at runtime I get an exception. Why can the compiler not put that cast
in silently and give me the same exception at runtime?

Brandon J. Van Every

unread,
Aug 12, 2003, 4:57:48 AM8/12/03
to
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?

Brandon J. Van Every

unread,
Aug 12, 2003, 5:02:08 AM8/12/03
to
Doug Tolton wrote:
> On Mon, 11 Aug 2003 14:16:35 +0200, Max M <ma...@mxm.dk> wrote:
>
>> Bob Gailer wrote:
>>
>>> What is "trolling"?
>
> Ugh...he got me.

If "he" means me, I am not a troll. A troll is someone who doesn't believe
what he writes, and writes it solely to provoke. I believe what I write,
and I'm not writing to provoke, but to discuss and to warn.

I have coined the words "trollhunt" and "trollhunter." Compare "witch hunt"
and "witch hunter." A trollhunter is a person who, faced with opinions
counter to his own, takes the intellectually lazy way out of calling the
opponent a troll. A trollhunt is many snivelling trollhunters banding
together to shut down dissenting viewpoints.

Brandon J. Van Every

unread,
Aug 12, 2003, 5:03:58 AM8/12/03
to
Joe Cheng wrote:
>
> Python has dynamic strong typing. So, if you can keep the types of
> your objects straight without the help of the compiler, you get the
> benefits of a concise syntax while enjoying type safety at runtime.

And how, in a large scale industrial systems context, are you supposed to
ensure that Joe Programmer doesn't in fact screw it up?

Theodor Rash

unread,
Aug 12, 2003, 5:03:32 AM8/12/03
to

--------------------------
/| /| | |
||__|| | Please don't |
/ O O\__ feed |
/ \ the trolls |
/ \ \ |
/ _ \ \ ----------------------
/ |\____\ \ ||
/ | | | |\____/ ||
/ \|_|_|/ | __||
/ / \ |____| ||
/ | | /| | --|
| | |// |____ --|
* _ | |_|_|_| | \-/
*-- _--\ _ \ // |
/ _ \\ _ // | /
* / \_ /- | - | |
* ___ c_c_c_C/ \C_c_c_c____________

Brandon J. Van Every

unread,
Aug 12, 2003, 5:27:26 AM8/12/03
to
Joe Cheng wrote:
>
> From a purely language point of view, I think the comparison can be
> boiled down to two main points.
>
> * Python is dynamic, C# is static. You've got a C++ background, so it
> doesn't sound like you would consider C#'s static typing a liability,
> nor would you likely fall in love with metaclasses and the like. So,
> most of the arguments along the lines of "C# is too inflexible" will
> probably not be relevant to you.

Yep, true of my thinking.

> * C#/.NET has to be one of the most mature "version 1.1" programming
> systems in history. (I'm too young to be making definitive
> statements about programming history, though...) You can tell by
> reading Chris Brumme's blog the amount of sophistication they have
> already achieved. Frankly, it's a little frightening how much MS can
> accomplish in just a couple of years--when they want it bad enough.

Good to hear that some people understand what it means when Microsoft puts
100% of the company behind something. Remember, last time around we got IE
and Netscape vanished.

> * Math.sin(x) versus sin(x)? Really, who cares??

Well, I care, but I'll be surprised if there's no way around it. And if
there isn't, it's not a dominant issue, just an annoyance.

> * The .NET community does not seem as clever and innovative, nor as
> passionate, as the Python community. You sorta get the sense that
> everyone who works with .NET is getting paid to do so, while Python
> hackers bang away on their keyboards with glee. And it feels like
> 90% of the innovation in the .NET realm comes from Microsoft itself
> (or perhaps, 60% from MS and 30% from the Java open-source
> community--NAnt, NUnit, NLucene, etc.).

Yes, and that's both a weakness and a strength. The strength of uncreative
bangers is they don't get idealistic about what market forces are going to
carry the day. In contrast, idealistic Python hackers are so busy enjoying
themselves that they don't feel they have to market in order to keep their
platform alive. They have bad self-defense instincts. The DEC Alpha CPU
was a joy to program for, it was the best and fastest CPU of 1998, and it's
dead. Let that be a warning to you.

> In contrast, I like Python very much (well, actually, Ruby is the one
> that I really like--but close enough).

Indeed, there are other wannabe langauges that would happily take Python's
place on the food chain. Python merely has a mature community and a track
record behind it. If other languages gain those things, and are even "more
interesting than Python" in various people's minds, then what will keep
Python on anyone's radar?

> However, when it comes down to building the big, hairy, slightly
> nasty (just admit it) software that brings home the bacon, sometimes
> it's just gotta be C#. And if you live in Seattle, I'd say it's
> gotta be C# all the way.

Yep. I started this trek out of necessity, not love. I was surprised to
discover the various positives of C# and .NET because I've been deliberately
avoiding them. I have all the traditional anti-Microsoft prejudices, and
frankly I'm opposed to them as a company. I'll never be their employee, but
I'm willing to contract for them. It might be interesting to some that I
cut teeth as a Linux hacker in 1993. By 1996 I had given it up, as at the
time, 3D graphics on Linux was going nowhere. Today it is... ok, but behind
Microsoft.

Andrew Bennetts

unread,
Aug 12, 2003, 5:41:56 AM8/12/03
to
On Tue, Aug 12, 2003 at 02:27:26AM -0700, Brandon J. Van Every wrote:
>
> Good to hear that some people understand what it means when Microsoft puts
> 100% of the company behind something. Remember, last time around we got IE
> and Netscape vanished.

When was that?

I'm happily running Mozilla as my web browser, and have been for well over a
year now. I'm hardly alone in this.

Sure, Netscape-the-company might be effectively dead, but I don't care about
that. Their software, on the other hand, is still alive, improving, and
gaining market-share (according to some reports, at least). And it's
software we're talking about here -- we're discussing programming languages,
after all. To point out that Microsoft effectively killed a particular
company while that company's software is thriving seems like a misleading
misdirection of the discussion, to me...

After all, if MS collapsed tomorrow, but C# looked to have a vibrant
community and industry support behind it keeping it developing, would ditch
it just because MS was dead?

-Andrew.


Andrew Bennetts

unread,
Aug 12, 2003, 5:21:36 AM8/12/03
to
On Tue, Aug 12, 2003 at 02:03:58AM -0700, Brandon J. Van Every wrote:
> Joe Cheng wrote:
> >
> > Python has dynamic strong typing. So, if you can keep the types of
> > your objects straight without the help of the compiler, you get the
> > benefits of a concise syntax while enjoying type safety at runtime.
>
> And how, in a large scale industrial systems context, are you supposed to
> ensure that Joe Programmer doesn't in fact screw it up?

By writing tests.

Just because C++, C# or Java code compiles cleanly doesn't mean it's
correct.
Just because Python code parses correctly and gives clean PyChecker output
doesn't mean it's correct, either.

In both cases, you need tests, preferably comprehensive, automated tests, to
verify that your code actually works correctly.

Python, by virtue of being easier to work with than statically-typed
languages, also makes writing tests easier. Running the tests frequently is
also easier when there's no lengthy compile step involved, although I've no
idea how good or bad C# is in this regard, but C++ is certainly painful.

Besides, if you don't trust the "Joe Programmer"s of your team to write code
competently, I suspect your project is doomed already. Requiring a liberal
sprinkling of type declarations throughout the code is hardly likely to
help that.

Regards,

-Andrew.


Peter Hansen

unread,
Aug 12, 2003, 7:34:05 AM8/12/03
to
"Brandon J. Van Every" wrote:
>
> 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?

Use either ctypes or the win32all stuff... works nicely.

Michele Simionato

unread,
Aug 12, 2003, 9:35:51 AM8/12/03
to
Doug Tolton <dto...@yahoo.com> wrote in message news:<070hjvou8s33gvmom...@4ax.com>...

> "Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in message
> news:<3f36af20@shknews01>...
>> I'm beginning to think that within 5 years, no new applications will
>> be
>> written in C++.

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

Joe Cheng

unread,
Aug 12, 2003, 10:16:33 AM8/12/03
to
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.


Aahz

unread,
Aug 12, 2003, 10:42:21 AM8/12/03
to
In article <070hjvou8s33gvmom...@4ax.com>,

Doug Tolton <dto...@yahoo.com> wrote:
>
>Hey, watch the Lisp cracks!! :-P
>
>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 (aa...@pythoncraft.com) <*> http://www.pythoncraft.com/

This is Python. We don't care much about theory, except where it intersects
with useful practice. --Aahz

Aahz

unread,
Aug 12, 2003, 10:44:40 AM8/12/03
to
In article <54nm01-...@newsgate.kjn.lan>,

ROTFL!

Now, if you wanna make one *really* funny, make it with a panda. ;-)

Let's see who gets this reference

Aahz

unread,
Aug 12, 2003, 10:47:33 AM8/12/03
to
In article <Jq%Za.8237$M6.6...@newsread1.prod.itd.earthlink.net>,

Joe Cheng <co...@joecheng.com> wrote:
>
>Python is "strongly" typed in the sense that every object has a type.
>It is not "statically" typed in that references do not have types.
>Statically typed languages generally require you to declare variable
>types (some languages infer them) and in return you get compile-time
>warnings when you try to call methods that do not exist or perform
>casts that are semantically impossible.
>
>I may be wrong but I believe C is an example of a language with static
>weak typing... you have to declare variable types and some types of
>errors can be caught at compile time, but you can perform unsafe casts
>and not only will the compiler not stop you but at runtime you won't
>get an exception--just a possibly corrupted value in memory.

http://www.artima.com/weblogs/viewpost.jsp?thread=7590

This is Python. We don't care much about theory, except where it intersects
with useful practice. --Aahz

Heiko Wundram

unread,
Aug 12, 2003, 12:17:55 PM8/12/03
to
On Tue, 2003-08-12 at 06:45, Brandon J. Van Every wrote:
> Yes your rendering code is nice looking. Is it fast? Were you working on a
> problem where it needed to be fast? I haven't been using C++ out of love.
> I've been using it for performance. And I don't think "what I can do in 72
> hours" is a valid test for big industrial system architectures. Is your
> code going to hold up in the face of dozens of programmers banging on it,
> and hundreds or thousands of programmers using it? And still be fast?

Yes, I was working on problems where the rendering code needed to be
fast. Doing an import psyco solved all my earlier fears about lagging
behind in performance terms against the people I had to compete with.
And, is having an interpreted language really such a major concern in
the age of computers operating at 2000+ Mhz? The final goal of the
project was designing a 3D-ego shooter with the engine we had written.
And it didn't run overly fast, but fast enough on the machine I tested
it on.

If I had had the time, I'd have worked most of the rendering code down
to C, which I would've wrapped with SWIG or the like, but I was
surprised how fast it even ran using plain Python with psyco. And I
don't really want to express game logic, such as computer player AI, or
the like, in C++. Do you?

(genetic algorithms are plain cool here...)

Just btw., my code help up to other programmers banging on it, and also
held up to larger usage. Just because you have static typing doesn't
mean that the code works together with an "evil programmer" (casting is
lots of fun...). And because my code was understandable, other
programmers who used it could read the code before using my library.
This is impossible to do with an overly complex C++ library, in my eyes.

> It is? Then I'm confused, because around here people keep talking about the
> beauty of avoiding types.

static typing = needing to declare types for all slots
(slots==variables).
dynamic typing = a slot can take up an object of any type (python's
slots only take up references, everything is a reference).

strong typing = types are checked on usage. If you don't use a correct
type (like with an expression (float*)&"1234" in C, which makes no sense
at all), you get an exception.
weak typing = types aren't checked on conversion, so things like
(float*)&"1234" work.

Python is certainly strongly typed, but unlike C, it is dynamically
typed. People also speak of static weak typing in C, as you can cast
anything into anything else (without checks), what you can't do in
Python. C++ is (was) the same, at least when I learnt it.

> What you are saying is Python excels at prototyping, where speed and
> flexibility are paramount. You are not saying that Python excels as a big
> system architecture language, where stability and safety are paramount.

Isn't a renderer and a game engine a big system architecture? I didn't
just prototype it in Python, I could offer a complete system, which was
very extensible. I could've never managed this in any other langauge
without the usual headaches.

> That "except" is, like, 1/2 to 2/3 of industry. I think you Python guys
> need to wake up that there's a much bigger, scarier, and more threatening
> world out there than the UNIX world of "engineering done right." That world
> is also not sitting still, it's on the move. For interoperability of
> langauges, UNIX has nothing to offer like the .NET Framework. DirectX is
> now ahead of OpenGL on vertex/pixel shader API capability and stability.
> The black hole, if not taken seriously, will swallow you. Either that or
> you're forced into "clone and conquer" in reverse.

I don't really know why you compare OpenGL to DirectX, they are just
plain API specifications. Maybe on your Windows Box DirectX is faster
than OpenGL (and offers support for more tasks), but this is a driver
vendor problem. Most graphics drivers on Windows are developed with
DirectX in mind, not with OpenGL. NVidia is IMHO an honorable exception,
as their OpenGL code (sometimes) works faster than DirectX.

And to a sidenote: Unix has always had a .NET Framework. The libraries
.NET tries to standardize have been available on Unix since a long time.
And I don't especially like the thought that I have to choose a single
Framework to do all I need, as this only makes me dependant on the
original implementor (Microsoft in this case). And if you need a
"portable" virtual machine, Python, Java, and Perl (just to name a few)
have offered this since ages. .NET isn't such a big innovation as it
claims to be...

Heiko.


Cliff Wells

unread,
Aug 12, 2003, 1:58:07 PM8/12/03
to
On Mon, 2003-08-11 at 14:59, Brandon J. Van Every wrote:

> Michele Simionato wrote:
> > "Brandon J. Van Every" <vane...@3DProgrammer.com> 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


Cliff Wells

unread,
Aug 12, 2003, 1:55:15 PM8/12/03
to
On Sun, 2003-08-10 at 13:55, Brandon J. Van Every wrote:
> Microsoft does almost all of its internal development in C# now. It is not
> going away.

Using QBasic to develop the POSIX layer for Windows NT didn't stop that
language from disappearing ;)

> I'm beginning to think that within 5 years, no new applications will be

> written in C++. People will still be using legacy C++ libraries, but all
> new development will be in higher level langauges.

As much as I'd like to see that, I'm choking on my coffee. You are
obviously painfully new to this industry.

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

> It takes a Sun, a Microsoft, or overwhelming utility to push a
> language. For instance, Perl has become popular because
> it's overwhelmingly useful for sysadmin and web admin.

So it takes marketing or usefulness for a language to be adopted?
Versus what? A mackerel and a tennis racket? Do you work for Gartner?
Most people look at things like past growth and market size to predict
future growth for a product. You're starting to sound like your
research was done on page 3 of PC Magazine.

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.

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

> You can do apps, you can do web admin, but most people are doing Java, C#, or Perl. And
> unlike C++ they aren't bad languages, so Python is not offering an obvious "slam dunk" remedy.

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


Regards,

Y2KYZFR1

unread,
Aug 12, 2003, 2:06:58 PM8/12/03
to
"Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in message news:<3f357a9b@shknews01>...
snip
>... C# could be glossed as "C++ without the headaches."

Actually nothing could be farther from the truth, if you really think
this you don't understand anything about C++! Just because the SYNTAX
is SIMILAR does not make the IMPLEMENTATION simlar!

> I've just spent most of the last 11 years avoiding them,
> that's how I've gotten by.

well guess that qualifies why you have the above misconception!

> Also C#, like Python, has higher level data
> types built right in. No more memory management, no more implementing
> linked lists over and over again .NET Framework could be glossed as "an
> interoperability environment for programming languages." So long as your
> language looks a lot like C#. ;-)

Actually this is completely wrong also, C# works much like VB
"objects" are COM objects. Nothing fancy at the langauge level there.
.Net Framework is Windows specific runtime environment that is very
similar to the Java standard libraries, nothing more nothing less.

> Some open source projects are trying to clone .NET and provide a C#
> compiler.

again with the misconseptions, not a compiler but a runtime
interpreter.

Brandon J. Van Every

unread,
Aug 12, 2003, 2:52:09 PM8/12/03
to
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.

Brandon J. Van Every

unread,
Aug 12, 2003, 2:56:07 PM8/12/03
to
Andrew Bennetts wrote:
> On Tue, Aug 12, 2003 at 02:03:58AM -0700, Brandon J. Van Every wrote:
>> Joe Cheng wrote:
>>>
>>> Python has dynamic strong typing. So, if you can keep the types of
>>> your objects straight without the help of the compiler, you get the
>>> benefits of a concise syntax while enjoying type safety at runtime.
>>
>> And how, in a large scale industrial systems context, are you
>> supposed to ensure that Joe Programmer doesn't in fact screw it up?
>
> By writing tests.

Compiler checking is a kind of test that is done for you all the time,
without you having to reimplement it over and over again. I agree that
people should write tests, but having written many, many of those for my own
project, it is equally true that writing test cases slows down development.
Anything that provides testing "for free" is a boon.

> Besides, if you don't trust the "Joe Programmer"s of your team to
> write code competently, I suspect your project is doomed already.

Big projects are filled with the bell curve. Not to mention stress under
deadlines, which ruins the code of even good programmers.

Brandon J. Van Every

unread,
Aug 12, 2003, 3:04:05 PM8/12/03
to
Heiko Wundram wrote:
> And, is having an interpreted language really such a major concern in
> the age of computers operating at 2000+ Mhz?

For those of us who are going to continue to increase our triangle counts,
yes it is a concern. But if we can find a way to do those parts of the code
in C++, and gracefully integrate them, the concern goes away.

> And I
> don't really want to express game logic, such as computer player AI,
> or the like, in C++. Do you?

C++ is appropriate for low-level AI, such as pathfinding and terrain
analysis. I would not want to do high level AI in C++, and probably game
logic would be better done in something else. The question is, what price
do you pay for integration?

> Isn't a renderer and a game engine a big system architecture? I didn't
> just prototype it in Python, I could offer a complete system, which
> was
> very extensible. I could've never managed this in any other langauge
> without the usual headaches.

Yes it is, but you didn't write a big system architecture in 72 hours.

> And to a sidenote: Unix has always had a .NET Framework. The libraries
> .NET tries to standardize have been available on Unix since a long
> time.

I"m talking about language interoperability because of the Intermediate
Language.

Brandon J. Van Every

unread,
Aug 12, 2003, 3:06:20 PM8/12/03
to
Andrew Bennetts wrote:
> On Tue, Aug 12, 2003 at 02:27:26AM -0700, Brandon J. Van Every wrote:
>>
>> Good to hear that some people understand what it means when
>> Microsoft puts 100% of the company behind something. Remember, last
>> time around we got IE and Netscape vanished.
>
> When was that?
>
> I'm happily running Mozilla as my web browser, and have been for well
> over a year now. I'm hardly alone in this.
>
> Sure, Netscape-the-company might be effectively dead,

Why do you bother to contradict me, if you're only going to make my point
for me?

> but I don't care about that.

I bet you don't care about the market share of that software either.
Basically, most c.l.p people would be happy if they held onto a 1% market
share as the rest of the world changes.

Brandon J. Van Every

unread,
Aug 12, 2003, 3:07:44 PM8/12/03
to
Y2KYZFR1 wrote:
> "Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in message
>
>> Some open source projects are trying to clone .NET and provide a C#
>> compiler.
>
> again with the misconseptions, not a compiler but a runtime
> interpreter.

Sounds like a pedantry battle to me. JIT compiler.

John

unread,
Aug 12, 2003, 2:59:15 PM8/12/03
to
> > Python advocates tend to pooh-pooh strong typing,
>
> Disinformation nonsense. Python objects are more strongly typed than
> C variables.

Agreed!

> Does C# have casts?

Yes! Explicit! About the same level as Java.

Patrick Useldinger

unread,
Aug 12, 2003, 5:21:04 PM8/12/03
to
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

Cliff Wells

unread,
Aug 12, 2003, 6:21:48 PM8/12/03
to
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>.

Cliff Wells

unread,
Aug 12, 2003, 6:29:40 PM8/12/03
to
On Sun, 2003-08-10 at 18:38, Simon Wittber (Maptek) wrote:
> >I'm starting to think that you are trolling. Are you?
>
> Hi Brian,
>
> You should never insinuate that Brandon is a troll, unless you are
> prepared to have your address appended to the end of his 100MB killfile.

Is that something to be feared? Does he actually kill any of those
people or is it more of a "they'll be sorry when I'm gone" sort of
thing?

Cliff Wells

unread,
Aug 12, 2003, 6:24:21 PM8/12/03
to

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>

Andrew Bennetts

unread,
Aug 12, 2003, 8:45:02 PM8/12/03
to
On Tue, Aug 12, 2003 at 11:56:07AM -0700, Brandon J. Van Every wrote:
> Andrew Bennetts wrote:
> > On Tue, Aug 12, 2003 at 02:03:58AM -0700, Brandon J. Van Every wrote:
> >>
> >> And how, in a large scale industrial systems context, are you
> >> supposed to ensure that Joe Programmer doesn't in fact screw it up?
> >
> > By writing tests.
>
> Compiler checking is a kind of test that is done for you all the time,
> without you having to reimplement it over and over again. I agree that
> people should write tests, but having written many, many of those for my own
> project, it is equally true that writing test cases slows down development.
> Anything that provides testing "for free" is a boon.

Static type checking, as implemented in C++, C# and Java, is laughably
minimal, seeing as it doesn't verify *logic* at all. Show me a compiler
than can say "your binary search has an off-by-one bug in it" as part of the
compilation process. Considering how much static typing hinders the
development process, I'd hardly consider that tradeoff to be "for free".

And I'll emphasis *again*, seeing as you snipped it, that Python is much
easier to write tests in, which speeds up development. You admit that you
still need tests in a statically typed language... so what exactly is your
compiler checking doing for you? Minimal correctness checking for something
you're testing anyway?

> > Besides, if you don't trust the "Joe Programmer"s of your team to
> > write code competently, I suspect your project is doomed already.
>
> Big projects are filled with the bell curve. Not to mention stress under
> deadlines, which ruins the code of even good programmers.

I doubt that trivial typos are the worst bug a stressed programmer would
introduce.

-Andrew.


Doug Tolton

unread,
Aug 12, 2003, 9:12:24 PM8/12/03
to
On 12 Aug 2003 10:42:21 -0400, aa...@pythoncraft.com (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>

Brian Quinlan

unread,
Aug 12, 2003, 9:02:02 PM8/12/03
to
> Compiler checking is a kind of test that is done for you all the time,
> without you having to reimplement it over and over again.

The design of the .NET framework minimizes the utility of static type
checking by using the object class all over the place. When you wish to
use an instance of class object you must cast it into an appropriate
type. The validity of the cast is determined at runtime. Almost all of
the collection classes, for example, deal in "object"s.

> I agree that people should write tests, but having written many, many
> of those for my own project, it is equally true that writing test
> cases slows down development.

I think that depends on how efficient you are at writing tests. Python
offers a great testing framework to help you.

> Anything that provides testing "for free" is a boon.

It is not free. You are accepting several limitations (e.g. object must
conform to a particular interface to be useable, all types must be
specified) to get a type of checking that is of questionable value.

> Big projects are filled with the bell curve. Not to mention stress
under
> deadlines, which ruins the code of even good programmers.

Cheers,
Brian


Andrew Bennetts

unread,
Aug 12, 2003, 9:14:03 PM8/12/03
to
On Tue, Aug 12, 2003 at 12:06:20PM -0700, Brandon J. Van Every wrote:
> Andrew Bennetts wrote:
> > On Tue, Aug 12, 2003 at 02:27:26AM -0700, Brandon J. Van Every wrote:
> >>
> >> Good to hear that some people understand what it means when
> >> Microsoft puts 100% of the company behind something. Remember, last
> >> time around we got IE and Netscape vanished.
> >
> > When was that?
> >
> > I'm happily running Mozilla as my web browser, and have been for well
> > over a year now. I'm hardly alone in this.
> >
> > Sure, Netscape-the-company might be effectively dead,
>
> Why do you bother to contradict me, if you're only going to make my point
> for me?

I forgot to trim the "When was that?" from my original draft of my reply.
The spirit of it remains correct, though -- Netscape Corp. might be dead (I
honestly don't know), but that's irrelevant to me.

> > but I don't care about that.
>
> I bet you don't care about the market share of that software either.
> Basically, most c.l.p people would be happy if they held onto a 1% market
> share as the rest of the world changes.

I do care, but not in "percentage of overall market share" terms.

I care that the open source software I'm using still has a sufficiently
active community supporting it and developing it that I know I can continue
to use it indefinitely, without needing to shop around for an alternative
while it stagnates. Mozilla (and Python, to drag this back on topic) both
look extremely healthy to me.

I don't particularly care much if other people use IE or C# (except to laugh
at them <wink>). I'm a happy Mozilla user, and I'm being paid to write
Python, which is my preferred programming language. The corporations that
are or aren't backing these choices really don't factor into it.

-Andrew.


Brandon J. Van Every

unread,
Aug 12, 2003, 10:23:45 PM8/12/03
to
I'm done with c.l.p for now, I've moved on to the marketing-python list.
This has been an interesting proving ground, and I've gotten the information
I came for, but productivity demands a move to a different venue. This post
was CC:'d to me so I want to address one point:

Brian Quinlan wrote:


> Brandon wrote:
>>
>> I agree that people should write tests, but having written many, many
>> of those for my own project, it is equally true that writing test
>> cases slows down development.
>
> I think that depends on how efficient you are at writing tests. Python
> offers a great testing framework to help you.

No, writing tests consumes time. I measure my productivity in units of 4
hours, i.e. a half day. My worst bugs last me 2 days. There is no language
written that will obviate the need to design a valid test case. Writing
test cases is simply a slow process when you measure functional results over
such small periods of time. I am 1 guy and don't have the luxury of armies
of coders in an industrial environment to work with. I'm very efficient,
and I know what fast and slow is. I do the tests when I know robustness is
going to save engineering time. I avoid them for their own sake, it is a
waste of time. Better to simply get working code exercised, and keep it all
down to 1 code path so that everything continues to be exercised.

>> Anything that provides testing "for free" is a boon.
>
> It is not free. You are accepting several limitations (e.g. object
> must conform to a particular interface to be useable, all types must
> be specified) to get a type of checking that is of questionable value.

C++ style compiler checking helps. I've never met anyone who thinks
otherwise. Pythonistas just habitually claim it doesn't have merit and
complain about burdens imposed. To us C++ guys, it is no big deal. It is,
frankly, the least of our troubles under C++.

Aahz

unread,
Aug 12, 2003, 11:01:02 PM8/12/03
to
In article <934jjvkd3ss4c2lbc...@4ax.com>,

Cool! There's one critical difference in the semantics of Python (lack
of macros), but that's precisely to enforce the simplicity and clarity
of Python's syntax.

Tom

unread,
Aug 12, 2003, 11:45:52 PM8/12/03
to
Patrick Useldinger <pu> wrote in message news:<3f395...@news.vo.lu>...


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.

Erik Max Francis

unread,
Aug 13, 2003, 12:03:47 AM8/13/03
to
Tom wrote:

> Sorry to be harsh, Mr. Van Avery.

Thing is, I doubt that Van Every is consciously trolling. He's just
behaving like he always behaves. It shouldn't be any surprise that he
has had similar exchanges in practically every newsgroup he's ever
visited. Though I don't think he's consciously trolling, it seems that
practically no one who encounters him randomly on Usenet doesn't
conclude that he's _not_ trolling. That this drama has repeated itself
over and over again on Usenet everytime he pokes his head into a new
newsgroup should at the very least have raised a red flag in his mind by
now. But it hasn't. I wonder why.

However, although I don't think that he would honestly considering
himself trolling, it hardly matters much. If most people you encounter
think that you're trolling, your protests to the contrary won't convince
them otherwise, and shouldn't. If it looks like a duck and quacks like
a duck, it starts not to matter if it's really a goose.

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

He's probably going to think you're talking about me, rather than Erik
Naggum :-).

--
Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ He who conceals his disease cannot expect to be cured.
\__/ (an Ethiopian proverb)

Brian Quinlan

unread,
Aug 13, 2003, 2:24:23 AM8/13/03
to
> > I think that depends on how efficient you are at writing tests.
> > Python offers a great testing framework to help you.
>
> No, writing tests consumes time.

Of course. The question is whether writing tests results in less net
development time (due to more rapid bug discovery and elimination). My
experience is that it usually does.

> C++ style compiler checking helps.

You are changing the subject of discussion; we were talking about C#
(and Python; see the subject of this thread). C++ has templates and STL
uses them to provide type-safe containers and algorithms. .NET languages
are not required to support templates (VB doesn't and neither did the
first release of C#) so the class libraries are not type safe. Having
written tens of thousands of lines of C# code I can tell you that the
compiler seldom saves me from making a type error.

> I've never met anyone who thinks
> otherwise. Pythonistas just habitually claim it doesn't have merit
and
> complain about burdens imposed. To us C++ guys, it is no big deal.

That is because C++ programmers naturally use C++ design patterns to
code in C++. Those design patterns preclude the use of any features not
found in the language. If, on the other hand, you were accustomed to a
different language, you would probably notice the "big deal" when your
favorite design patterns are rendered impossible by static typing.

BTW, notice that you are arguing for the inclusion of static typing,
which catches only a small fraction of bugs and greatly reduces design
flexibility and against type checking, which imposes no design
restrictions and can catch more classes of bugs.

Cheers,
Brian


Doug Tolton

unread,
Aug 13, 2003, 3:00:31 AM8/13/03
to
On 12 Aug 2003 20:45:52 -0700, nonotre...@yahoo.com (Tom) wrote:

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


Ack, we already have one troll on c.l.l. I don't think we need
another one. Although I think "Vain" Every is more of a troll than
Yaas.

c.l.l. seems to be lower volume that c.l.p., but those dudes are hella
smart. These are the only two groups I actively watch.

I honestly don't think "Vain" Every would ever be able to understand
Lisp, even if he read ten books. He can't even grasp the simple truth
behind open source. The beauty and power of Lisp are far beyond his
reach I suspect.

Doug Tolton

Max M

unread,
Aug 13, 2003, 3:16:21 AM8/13/03
to
Brian Quinlan wrote:

>>>I think that depends on how efficient you are at writing tests.
>>>Python offers a great testing framework to help you.
>>
>>No, writing tests consumes time.
>
> Of course. The question is whether writing tests results in less net
> development time (due to more rapid bug discovery and elimination). My
> experience is that it usually does.

Yeah. The main idea behind test is that they catch errors faster, and
ensures a better design for your code.

A rule of thumb says that a bug that is caught later one requires a lot
longer time to debug as a function the size of the codebase.

roughly:

debug_time = n_bugs * size_of_code

So there are *big* savings in catching bugs early. That is why tests
saves time. And a lot of time at that.

Also they help you catch bugs as you create them and the test suite
expose them.

Only thing is that the saving only shows up later in the project as less
delay ... ;-)


regards Max M

Chad Netzer

unread,
Aug 13, 2003, 3:50:08 AM8/13/03
to
On Wed, 2003-08-13 at 00:00, Doug Tolton wrote:

> I honestly don't think "Vain" Every would ever be able to understand
> Lisp, even if he read ten books.

Battle not with trolls, lest ye become a troll.

--
Chad Netzer


Fredrik Lundh

unread,
Aug 13, 2003, 4:26:10 AM8/13/03
to
Erik Max Francis wrote:

> He's probably going to think you're talking about me, rather than Erik
> Naggum :-).

is naggum still posting to the net?

</F>


Rune Braathen

unread,
Aug 13, 2003, 5:30:02 AM8/13/03
to
Brandon J. Van Every wrote:

( ... )

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

Aha, this explains why you have so much time for usenet; you are
rebuilding all the time.

--
runeb

Bernhard Herzog

unread,
Aug 13, 2003, 6:27:32 AM8/13/03
to
Brian Quinlan <br...@sweetapp.com> writes:

>> > I think that depends on how efficient you are at writing tests.
>> > Python offers a great testing framework to help you.
>>
>> No, writing tests consumes time.
>
> Of course. The question is whether writing tests results in less net
> development time (due to more rapid bug discovery and elimination). My
> experience is that it usually does.

And not only that.

If you don't have automated tests it means that you have to run at least
some tests manually every time you make a change. That costs time too
and requires attention. With an automated test suite, after you've
written the test it's only a key-stroke or button-click to lauch the
test suite and it only really requires attention when some tests fail.

Also, with a test suite it's easy to run all tests very often, with
manual tests run during developement you usually only test very few
things related to the changes you just made and may not notice some of
the bugs you just introduced.

Bernhard

--
Intevation GmbH http://intevation.de/
Sketch http://sketch.sourceforge.net/
Thuban http://thuban.intevation.org/

A.M. Kuchling

unread,
Aug 13, 2003, 8:24:11 AM8/13/03
to
On Wed, 13 Aug 2003 10:26:10 +0200,
Fredrik Lundh <fre...@pythonware.com> wrote:
> is naggum still posting to the net?

The most recent Google Groups posting for him is Jan. 13 2003.
comp.lang.lisp has since settled down into discussion that are <shock,
horror> mostly about Lisp, not about newsgroup etiquette, Scheme/Lisp
flamewars, and personal attacks.

--amk (www.amk.ca)
It serves the purpose of not serving a purpose, surely quite a valid one.
-- Peter Greenaway, in an interview in _Artforum_, Nov. 83

Tom

unread,
Aug 13, 2003, 1:05:42 PM8/13/03
to
"A.M. Kuchling" <a...@amk.ca> wrote in message news:<dZydnSpqtad...@speakeasy.net>...

> On Wed, 13 Aug 2003 10:26:10 +0200,
> Fredrik Lundh <fre...@pythonware.com> wrote:
> > is naggum still posting to the net?
>
> The most recent Google Groups posting for him is Jan. 13 2003.
> comp.lang.lisp has since settled down into discussion that are <shock,
> horror> mostly about Lisp, not about newsgroup etiquette, Scheme/Lisp
> flamewars, and personal attacks.

That's great news. I haven't checked c.l.l. for several months.
Didn't think such a complete turnaround was possible. Sounds like
this is no longer the best spot for Mr. Van Avery.

Christopher Barber

unread,
Aug 13, 2003, 6:34:42 PM8/13/03
to
"Terry Reedy" <tjr...@udel.edu> writes:

> "Christopher Barber" <cba...@curl.com> wrote in message
> news:pso8yq0...@bandit.curl.com...


> > "Terry Reedy" <tjr...@udel.edu> writes:
> >
> > > "Brandon J. Van Every" <vane...@3DProgrammer.com> wrote in
> message

> > > news:3f357a9b@shknews01...
> > > > What can I do with Python that I can't do with C#?
> > >
> > > Given that all Turing complete languages are theoretically
> equivalent,
> > > nothing, either way.
> >
> > Turing equivalence is probably the least interesting property of any
> > programming language and says absolutely nothing about its
> suitability for
> > real programming tasks.
>
> Huh???
> This is a paraphrase of what I said. So why did you silently clip the
> remainder of my post where I went on to discuss practical suitability?

I quoted you verbatim, there is no paraphrasing here, although I did clip the
rest of the article. I only meant to express the opinion that there is no
point in ever bringing up Turing equivalance when comparing languages (unless
of course they are not Turing equivalent!). Turing equivalence only addresses
what computations you may perform, not what programs you may write.

- Christopher

Christopher Barber

unread,
Aug 13, 2003, 6:40:12 PM8/13/03
to
Andrew Bennetts <andrew-p...@puzzling.org> writes:

> On Tue, Aug 12, 2003 at 02:03:58AM -0700, Brandon J. Van Every wrote:
> > Joe Cheng wrote:
> > And how, in a large scale industrial systems context, are you supposed to
> > ensure that Joe Programmer doesn't in fact screw it up?
>
> By writing tests.
>
> Just because C++, C# or Java code compiles cleanly doesn't mean it's
> correct.
> Just because Python code parses correctly and gives clean PyChecker output
> doesn't mean it's correct, either.
>
> In both cases, you need tests, preferably comprehensive, automated tests, to
> verify that your code actually works correctly.

I like the sentiment, but in practice there is no such thing as comprehensive
tests.


Delaney, Timothy C (Timothy)

unread,
Aug 13, 2003, 7:22:10 PM8/13/03
to
> From: Christopher Barber [mailto:cba...@curl.com]

>
> I like the sentiment, but in practice there is no such thing
> as comprehensive tests.

That is true, but you *can* write tests for all code paths if you use coverage analysis tools. Doing that is of course only viable for small units.

Note I'm not just talking about code coverage, but code *path* coverage.

The other important thing is to include any and all failing cases in the tests with the expected behaviour - and to not remove them because "well, we know that's fixed now so we don't have to test".

For example, just the other day I discovered a nasty little bug (purely by accident) where an encryption algorithm was producing nul characters. The output of the encryption was being placed into a std::string. I'm sure you can guess the result ...

I've now added two test cases (currently failing) - one which tests the specific case found (that encrypting the string "a", storing the result in a std::string, then decrypting the cyphertext results in the string "a") and one which tests that the cyphertext does not contain a nul character.

Tim Delaney

Peter Hansen

unread,
Aug 13, 2003, 10:17:24 PM8/13/03
to
Christopher Barber wrote:

>
> Andrew Bennetts <andrew-p...@puzzling.org> writes:
> > In both cases, you need tests, preferably comprehensive, automated tests, to
> > verify that your code actually works correctly.
>
> I like the sentiment, but in practice there is no such thing as comprehensive
> tests.

Without an agreed-upon definition of "comprehensive", this is arguable.

"1. Including much; comprising many things; having a wide
scope or a full view."

Surely you'd agree that comprehensive tests are possible in this case.

"2: including all or everything"

In this case, although I'm unclear on the distinction between "all" and
"everything", you're certainly correct, but it's an uninteresting point
as it's too obvious. Certainly Andrew doesn't think anyone has tests
which cover *everything*...

And is your objection based on personal experience only, or do you
consider others' situations. I would say that at my workplace we
certainly have *comprehensive* and fully automated tests for some of
our code. And those tests do verify quite well that the code works.

-Peter

0 new messages