Python vs. C#

Andrew Bennetts andrew-pythonlist at puzzling.org
Tue Aug 12 05:21:36 EDT 2003


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.






More information about the Python-list mailing list