Re: Question for Java Gurus

From: Chris Smith (cdsmith_at_twu.net)
Date: 05/19/04


Date: Wed, 19 May 2004 08:24:05 -0600

Ryan Stewart wrote:
> Others have made some good replies, so I'll be short.

That's okay. I much prefer your reply to the insulting rhetoric coming
from Galen.

> I wasn't talking about
> people running into classpath issues while doing command line work. I'm
> talking about the multitude that have classpath issues and don't even know
> what the word "classpath" means because their IDE has been shielding them
> from it.

Okay, in which case it's clear that their environment is impeding their
success at learning Java. At that point, it's necessary to either teach
how to use it or choose a different tool. Of course, I'm not advocating
switching tools; that has an inherent cost so that it's best to probably
plow ahead and teach the student how to locate their third-party classes
in whatever environment has been chosen. And I'm all for choosing an
environment that's conducive to learning and understanding; and that's
more likely to be the command line than it is to be Eclipse, for
example.

But I don't think it *has* to be the command line. BlueJ is very
promising in terms of making things work without dealing with classpath
issues.

> Whatever your opinions otherwise, you must acknowledge that the
> Java classpath is at the very core of how Java works, that it must be set
> properly in one way or another for *any* Java-based application to work, and
> that a programmer that knows about it is better able to diagnose
> NoClassDefFoundErrors than one that doesn't.

You see, I don't acknowledge that. The classpath falls into the realm
of "making your tools work". In the context of teaching computer
programming, that's a negligible space of education. The classpath is a
fundamental concept of neither programming in general nor the Java
programming language. The JVM spec, for example, suggests the classpath
as one possible implementation of locating Java classes, but in no way
requires its use. The only reason it seems any more sensible to call
CLASSPATH a core part of Java than, for example, calling some specific
method of location C's angle-bracket includes a core part of C, is that
Java virtual machines happen to implement it a little more consistently.

On top of that, in practice few Java developers need to deal with
classpath issues in their regular line of work. Probably the vast
majority of Java code is written in a servlet or EJB environment, in
which there are other ways of providing references to third-party
libraries (e.g., WEB-INF/lib), and use of the classpath in the invoking
JVM is terribly poor form and non-portable. Applets can't reasonably
use the classpath. The majority of application code, which is the major
remaining bit, ought to be deployed as executable JAR images or Java
WebStart applications, in which case the standard mechanisms for setting
classpath are ignored entirely.

IMHO, the only possible justification for teaching the classpath to
programming students is that they might need to deal with it in order to
see the immediate results of their work in simple test code. If they
can see the results of their work otherwise without incurring other
negative consequences, then why bother?

-- 
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation


Relevant Pages

  • Re: Question for Java Gurus
    ... >> people running into classpath issues while doing command line work. ... > success at learning Java. ... > in whatever environment has been chosen. ... > programming, that's a negligible space of education. ...
    (comp.lang.java.programmer)
  • Re: Question for Java Gurus
    ... >> people running into classpath issues while doing command line work. ... > success at learning Java. ... > in whatever environment has been chosen. ... > programming, that's a negligible space of education. ...
    (comp.lang.java.help)
  • Re: Question for Java Gurus
    ... >> people running into classpath issues while doing command line work. ... > success at learning Java. ... > in whatever environment has been chosen. ... > programming, that's a negligible space of education. ...
    (comp.lang.java.softwaretools)
  • RE: NoClassDefFoundError after upgrade to FC3
    ... it's a lot harder to figure out what is missing. ... Check the script that starts the IDE and see if it is setting a classpath. ... Sometimes the CP is set using a command line option of the java command ... NoClassDefFoundError after upgrade to FC3 ...
    (Fedora)
  • Re: Question for Java Gurus
    ... > people running into classpath issues while doing command line work. ... in which case it's clear that their environment is impeding their ... success at learning Java. ... programming, that's a negligible space of education. ...
    (comp.lang.java.softwaretools)