Could Python supplant Java?
The Ghost In The Machine
ewill at sirius.athghost7038suus.net
Thu Aug 22 18:00:33 CEST 2002
In comp.lang.java.advocacy, Dan Johnson
<danieljohnson at vzavenue.net>
on Wed, 21 Aug 2002 17:15:12 -0400
<um80n06kf34081 at news.supernews.com>:
> <lvirden at yahoo.com> wrote in message news:ak025t$p8q$2 at srv38.cas.org...
>> According to Tim Tyler <tim at tt1.org>:
>> :In comp.lang.java.advocacy d2002xx <d2002xx at myrealbox.com> wrote:
>> ::> I cannot imagine why anyone would use C unless it's necessary :-)
>> :: Hmmm... Because gcc is much faster than g++...
>> :Compilation time?
>> :If you're a developer - and this is a problem - you buy a faster
>> If you're a developer, in all likelihood you can't afford to buy a
>> faster computer.
> I suspect he meant an *employed* developer. :D
>> And many employers have decided that the next computer
>> they are going to buy is a Windows machine, which is certainly
>> enough to cause many a developer to consider a career change into
>> medicine, environmental recyling engineer (aka garbage pickup and
>> or perhaps kindergarten herder ...
> Serious question:
> What is so developer-hostile about Windows?
If you have a dual-boot system with a Windows C++ development kit
(an old version of Borland will do, or Visual Studio),
you might do the following. Bear in mind that I'm an
experienced programmer that reads code for breakfast... :-)
 Mount your VFAT or NTFS read-only on Linux. (That's easy
enough. Linux has *still* yet to reliably implement
writing on NTFS -- although I'm not sure if the problem is
Linux, or NTFS; NTFS is a weird beast, and it's the
usual moving target.)
 Study the various Win32 files: windows.h, windowsx.h,
winbase.h, winuser.h, etc. Are they comprehensible? Do
they give you what you want to know? Can you make use
of them, include them in the proper order, etc.?
 Now download (if you need to) X and some X developer
libraries (those usually come with) and look at files such
as /usr/X11R6/include/X11/X.h, Xlib.h, Xutil.h, Xresource.h,
etc. Are they comprehensible? Do they give you what you
want to know? Can you make use of them? etc.
 You can also try the manpages vs MSDN. Are they
comprehensible? Do they give you what you want to know?
 I'll admit to some curiosity if anyone's done this, but
presumably there's at least one metric that could be employed
to this purpose: which widgeting/windowing system is more
"complicated"? One can in principle add up the number of
parameters, number of structures of fields, and number of
flags, for example, and present an average. Of course this
means that fork() will have a complexity of about 2, whereas
CreateProcess() will have a complexity of 20 or so, if
not more. :-)
Then apply the same procedure to Java (this is, after all,
clja). I'll admit I have no idea how to do all this cleanly,
admittedly -- Java is a far larger soup bowl, and it would be
hard to scoop out just the windowing code, for example. It's
probably not meaningful to try to compare Java's java.io.File
class or javax.swing.JEditorPane to C++ classes -- oops, C++
doesn't really have any; they're all implemented in a library,
but one might use things such as std::ifstream or FILE *, Gtk's
list structure (Gtk is implemented in C with some quasi-C++
inheritance structures implemented in C macros, for portability),
or other such gunk.
Of course, MIT Athena (now part of X) has some interesting issues
of its own: the Xresource.h database -- which isn't really a
database so much as a convenient method by which one can represent
wildcard property names and associate values with them.
For example, '*Command.background: green' makes all
one's Command widgets (Athena's idea of a click button) green,
or one can change the strings displayed with individual Label
widgets, buttons, or toggles (an Athena toggle is a
check button with an ugly face :-) ).
Windows has RDO -- sorry, ADO -- and ATL (I'm *still* trying
to figure out how the ATL wizards work together, never mind
actually getting the code to do something!) and DDE -- sorry,
OLE -- sorry, COM -- oh, wait, that's something else -- um,
what exactly *was* ActiveX, again?
And then there's the issue with the compiler options in
a standard X project. In X, it can be as complicated as
one wants, but it can also be extremely simple (although
"hello world" is probably *too* simple):
gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o hello hello.c -lX11
The -I controls where gcc looks for include files, the -L
conrols where gcc (actually, the linker) looks for
library files, the -o redirects output (the default is
'a.out' for historical reasons), and the -lX11 is
a shorthand for "look for libX11.a or libX11.so somewhere
in the current search path, which can be defined by both
-L and the operating system".
If one fires up a widget and then looks at the compiler command
line for a Win32 "hello-world" type app, one finds that
the command line has far more options. (Fortunately, VC++
will display them for you in its Project Settings window.
But there sure are a lot of them.) To be fair, I have gotten
a VC++ makefile/console app to compile with only one option,
and that only because the compiler complained and told me that
option. However, I forget precisely what that option is,
although it was something like '/-GX'.
How all this gets included in a complexity metric is not clear.
And then there's C#, the wild card in all this. I've heard
some interesting things about properties in C#: somehow,
Microsoft has managed to make a simple expression
x.a = y.b
get even more complicated than C++'s assignment operator,
which is bad enough. I wouldn't have thought it possible. :-)
Of course, the flip side is that this complexity might simplify
maintenance -- I don't know. Certainly it's far easier to
change one routine 'setA()' than to search for all assignments
to a field named 'a' -- although it could get interesting if
there are multiple implementations of setA() scattered everywhere
throughout the project (and in other projects, as well).
But that general problem transcends this little syntactic
piece of admittedly very sticky sugar.
> Are you sure it isn't really Microsoft you find.. hostile? :D
Microsoft is probably beyond the scope of this newsgroup, although
it is the father of C#, which is a Java competitor.
#191, ewill3 at earthlink.net
It's still legal to go .sigless.
More information about the Python-list