[geeks] Misuse of Java
Greg A. Woods
woods at weird.com
Wed Nov 6 13:51:42 CST 2002
[ On Wednesday, November 6, 2002 at 11:26:16 (-0500), Dave McGuire wrote: ]
> Subject: Re: [geeks] Misuse of Java
>
> I'm starting to develop a theory here. Ease of learning of a
> programming language may be a detriment to new programmers, because one
> can reach the point of productivity and start writing "production" code
> before actually learning a base of good (language-independent)
> programming skills.
>
> Two examples to illustrate the extremes:
>
> Java is VERY easy to learn...a new programmer can become productive
> in almost no time, building huge user interfaces and big functionality
> in weeks that would take years to build in, for example, C. There's
> not much sweat involved...and while the new programmer *is* learning,
> they're learning the Java language...not learning good programming
> practice.
>
> C, on the other end of the spectrum, is generally considered to be
> very difficult to learn, in spite of its smallness and nearly
> ridiculous simplicity. (but then, there are a lot of misconceptions
> about C; some school types even teach their students that C is a
> high-level language...morons!)
That's an interesting theory.
I would add that C really is very easy to learn if the way you learned
to program computers started with the bare hardware. Once upon a time
(when I first learned C) I thought that was applicable just to me, but
come second-year university where our core programming classes were
taught machine code and then assembler and finally C, I observed the
same easy progression in many of my colleagues. Meanwhile Pascal, the
supposed king of teaching languages at the time, baffled many of us who
had learned the hardware first. I really wish I had deeply learned
Smalltalk thoroughly first, but of course back then that was simply
impossible.
On the other hand it was Pascal that really did teach me many of the
good programming practices necessary with Algol-like procedural
languages (I was already a pretty good lisp programmer by then). I
suppose even if the language itself is still a bit hard to learn, the
reason it's a good teaching language is that it does force some of those
good practices on the student.
I still think Smalltalk would have taught me all those things and more
in a much more effective, persistent, and efficient way.
> To wit, I don't see anywhere near as much, percentage-wise, truly bad
> C code as I do truly bad Java code...and I'm not even a highly
> experienced Java programmer, so I'm likely recognizing only the most
> egregious examples of bad code.
I think it depends on what you consider to be "bad C code". I see
enormous great jiggling gooey gobs of bad C code everywhere I look.
Just the other day as I was putting the polishing touches on some
massive improvements to NetBSD's inetd that I've been working on, I took
a gander at FreeBSD's version and was appalled to find that not only had
they failed to fix many problems with error checking of critical system
calls and such, they had also implemented an absolutely attrocious and
unnecessary scheme to try and handle signals asynchronously. I suppose
you could argue that this latter complaint is an example of poor use of
the system interface and that it's not really bad C code per se.
However from my point of view since I work mostly with systems level C
code, those are the kinds of issues I see most often and I think I could
argue that they are in good part due to the language itself.
Further many of the things I consider "bad" in common C code would
probably be harder to do quite so badly in Java (though I don't have
enough experience with Java to know if that's true or not, and of course
no matter how good the language it can't easily repair a fundamentally
poor system interface after the fact).
--
Greg A. Woods
+1 416 218-0098; <g.a.woods at ieee.org>; <woods at robohack.ca>
Planix, Inc. <woods at planix.com>; VE3TCP; Secrets of the Weird <woods at weird.com>
More information about the geeks
mailing list