[Tutor] Sun says: Don't use Java, use Python!
Erik Price
eprice@ptc.com
Wed Feb 12 11:18:17 2003
alan.gauld@bt.com wrote:
> This kind of consistency error can and does happen and is very
> hard to detect if you don't have the original source files(in
> fact even if you do, because the modified B is in the source
> repository but the old B is in the JAR! If A B and C are all
> in one source file then this can't happen. Of course the file
> gets very big which is where tradeoff comes in.
I see your point about this. You're right. However, if you're using
ant, then the general practice is to do an "ant clean" (to remove the
current build altogether) and then do an "ant dist" (to rebuild the
build and then package it into a jar). This would ensure that all the
source files are up to date.
It is my understanding that ant is being used widely in Java
development, not just in J2EE webapp development (which is what I use
ant for).
> In C++ and some
> other languages(Modula etc) we can separate declaration from
> implementation and so keep the class declarations in one file
> and the implementations in separate ones - the best of both worlds.
[...]
> C++'s header, body approach requires more upfront work but
> provides a powerful error catching mechanism IMHO.
Yes, this is also how Objective-C does it. There is a file.h with the
declarations/prototypes and a file.m which implements the class. It is
not something I have used before (since I have never used C++) but I
kind of like it.
Erik