Novel Thoughts on Scripting and Languages

James Huang judoscript at hotmail.com
Fri Jan 10 01:11:06 EST 2003


Andrew Dalke <adalke at mindspring.com> wrote in message news:<avj741$r77$1 at slb3.atl.mindspring.net>...
> James Huang:
> > As I said, "I guess"-ed. Weakly-typed-ness, are variables required to
> > be declared with types before use, and do not change for most
> > situations? I know VB has a strict mode that enforces this.
> 
> That's static typing.  C is statically typed, but weakly typed.
> For example, in C you can add a pointer, and integer, and a character,
> but the types are all declared.

Without static typing, what good does strongly-typedness do?

> 
> Python is strongly typed and dynamically typed.  There are no pointers,
> and integers and strings cannot be added.
> 

See below.

> Perl is weakly typed and dynamically typed.
> 
> Java is strongly typed and statically typed.  (Though normally
> I would use Eiffel as an example.)
> 
>  > Java and Python are so
> > similar to each other in terms of programming models, conceptually it
> > is hard for me to see which has a clear advantage. We have big Java
> > software products like Weblogic, WebSphere, etc. (funny Sun has none,
> > or, none that is successful.)
> 
> Similar?  Hmm ... How so?

See below.

> 
> I've seen Java programmers who start writing Python code.  Their
> code is distinctively not Pythonic.
> 
> Python is dynamically typed, strongly typed, supports multiple
> inheritance, allows user-classed to redefine how they work with
> operators like +, -, *, [], etc., allows a mixed OO and
> declarative programming style, has a highly dynamic runtime
> where I can even change an object's class on the fly, and

If you can change the class on the fly, does this break the
strong-typedness? It's sort like (void*). JudoScript does the same
thing, because an object, after all, is a map with a list of
associated methods/functions; unless, of course, it is a Java object
or ActiveX.

Python seems to have quite a few dangerous features that lack in Java
but do exist in C++. Java was born so many years after C++ and Python,
so there must be some reasons, I am afraid. Otherwise, with good
discipline, C++ can be just as good (except for garbage collection).

... see below.

> lets me work interactively, so I can query objects while I'm
> experimenting with them.

Cool, great usage feature for prototyping (I'm serious).

> 
> Java is statically typed, strongly typed, only allows single
> inheritance, doesn't allow operator redefinition (making for
> horrible constructs like myString1.concat(myString2) instead
> of myString1 + myString2), only allows OO programming (but
> fakes functions by using a static method - blech!) and  ...
> well, I know very little about Java's runtime but I suspect
> you can't easily change classes around.  And it has a
> separate compile-run environment which makes it hard to work
> with your objects directly.

It's the statical typing that make strong-typedness a big help for
boosting software quality -- the compiler! And that's what makes me
wonder people implement big software without the help of compilers.

> 
> OTOH, compared to APL or Prolog, Java and Python are busom
> buddies.

Actually you are right; nobody compares Python and Prolog because they
*are* different. People compare C++, Python, Java, ... because they
are similar.

To me, Python and Java are similar because they both support class and
inheritance, and garbage collection. I wouldn't say C++ and Python are
similar. Of course, variable declaration or not, blah blah ...

> 
> James Huang:
>  >>>Even so, Java is still unbeatable.
> 
> Dave Brueck:
> >>I feel the same way about the color 'forest green'. Surely on that basis
> >>alone people will come around to my way of thinking, right?
> 
> James Huang:
> > Not so sure what you mean but that's ok.
> 
> I'm rather partial to a dark green color myself.  Doesn't
> mean everyone else will join us in that prejudice.  Nor
> should they.  My girlfriend like brown, and those two colors
> complement each other well.
> 
> It's your belief that Java is unbeatable.  I and others have
> different opinions, and they we aren't going to change
> any time soon.

Sure, sure.

> 
> 					Andrew
> 					dalke at dalkescientific.com




More information about the Python-list mailing list