Java or C++?

Michael Torrie torriem at gmail.com
Tue Apr 15 13:19:31 EDT 2008


egbert wrote:
> What is the role or position of C# in this context ?
> If I remember well, some people have said that C# is an improved
> C++ or Java.
> e

I think C# is in a great position, and might be recommended.  C# has the
added advantage of being able to very easily work with IronPython.  Thus
if you want to develop with .NET you can easily wield the beauty of
python with C# for speed or library routines.

Of course Jython does the same for Java, although it's way behind in
development these days.

Slick python integration is one area where C# and Java would beat out
C++.  Sure there's Boost::Python, but the learning curve is kind of
steep.  Installation, even, is difficult.  Python's C API is very simple
and C-like, so if one chooses to use primarily a C/Python combination
(typically what I do these days), it works well, but not quite as easy
as IronPython and C#.

Diving into the debate, I personally think all programmers, and
especially computer science people, should be proficient in C.  You
should be able to write thousands of lines of C code, use dynamic memory
allocation, data structures, etc, and have very few resource leaks if
you choose your tools wisely (glib for C ought to be standard!).  This
is to give you a background and low-level understanding.  However you're
not likely to program in C professionally unless you are into systems
programming, or are affiliated with core, low-level things like library
development, or embedded systems.

As for C++ and Java, I've found that good C++ programmers can *easily*
move to Java when they want/need to.  The reverse is *not typically
true*.  Java lends itself to too many bad habits that kill would-be C++
programmers, particular in regards to resource management and things
like destruction after scope.  I think that is a critical thing that
people forget sometimes.  Similarly people proficient in Unix and Linux
computers, both use and development on, can much more easily move to
Windows than the other way around.

A good programmer should be able to pick up new languages and paradigms
fairly easily, and become fluent in just a few weeks.  For me it's
typically one week, although learning frameworks and toolkits is more
difficult (Java frameworks).  A good exercise might be to pick up one
new language per year and do something major with it (say 4000-10000
loc).  Choose a new genre like web programming to explore.  Whatever.
Next time a little pet project comes up, try a new language or a new
toolkit.  Try some shell-scripting in scsh using scheme.



More information about the Python-list mailing list