Re: type checking

From: Alex Martelli (aleaxit_at_yahoo.com)
Date: 10/12/03


Date: Sun, 12 Oct 2003 10:42:12 GMT

Donn Cave wrote:

> Quoth Stephen Horne <$$$$$$$$$$$$$$$$$@$$$$$$$$$$$$$$$$$$$$.co.uk>:
> ...
> | If you really do need static typing (as opposed to simply needing to
> | get used to the change), Python is simply the wrong choice of
> | language. Either Java, C# or Delphi may be a good option for you.
>
> Also consider functional languages with strong static typing and
> type inference - Haskell, Clean, ML, Objective CAML. Even if they
> eventually turn out to be unsuitable for the task at hand, they
> offer an interesting and rigorous abstraction of computer programming.

I'd like to second Donn's recommendation and express reservations
on Stephen's. Java &c just don't have a high enough semantic level
to give you the same productivity as Python. The languages Donn
lists *DO* (well, I haven't actually tried out Clean, but it looks to me
as if it does). O'CAML in particular is multi-paradigm, a bit rambling, and
perhaps not with the most elegant syntax -- sort of like C++ in these
respects -- but, also like C++ (and Python) takes a LOT of care to
practically FIT IN with your need for solution (e.g. SWIG supports it
to ease interfacing external C=coded libraries). And the base paradigm
of O'CAML is statically typed (even too strict maybe, if you still have to
write +. instead of just + when you're summing floats...) AND very high
level (functional). Haskell is even more mind-expanding and much more
elegant, though perhaps its practicality is (sigh) lesser. Standard ML may
be a bit in-between, perhaps (don't know it as well as the others).

In the end, if you're REALLY keen for static typing you owe it to yourself
to try the real thing, rather than the semi-strict Java &c approaches. If
you're looking to learn, Haskell is hard to beat; if to get practical
solutions to problems, O'CAML may be better. Python is IMHO wonderful
if you DON'T make a fetish of static typing (you might want to try Erlang
for pure functional programming without static typing, btw).

Many of us who used to revere static typing (e.g., Robert Martin, well
noted consultant and author, former editor of C++Report) are on record
as having acknowledged that dynamic typing in fact works better for us.
It just took us a few years to realize this, and vast experience with both
kinds of languages.

If your mind is shaped differently from ours, so that static typing DOES
work better for you even after you've thoroughly familiarized yourself with
a good dynamic-typing language, then moving to a good static-typing
language may indeed be the best strategy for you -- and today's wealth
of choices means no practical restrictions need stop you from doing that.

Alex



Relevant Pages

  • Re: Basic inheritance question
    ... used 'this' in C++ and Java. ... but in Python it doesn't. ... language, they would write a lot of ten liners that is changed a LOT ... Add three levels of inheritence and a couple globals and you'll find out ...
    (comp.lang.python)
  • Re: Python or Java or maybe PHP?
    ... Python or Java? ... Ruby (with Rails, of course, as the server-side framework), Python (many ... this cuts both ways (once you've decided on Java as the language you ...
    (comp.lang.python)
  • Re: The Industry choice
    ... but still Java is considered as a sure-job language. ... >After being a python programmer for long time, ... VERY substantial investments into any technology it "marries", ...
    (comp.lang.python)
  • Re: Basic inheritance question
    ... this in VB and Java. ... Python doesn't "enforce" explicit name of classes - IIRC, ... No it exists in any language, the way to avoid it is by good class ... Add three levels of inheritence and a couple globals and you'll find out ...
    (comp.lang.python)
  • Re: Does Python compete with Java?
    ... I am relatively new to Python. ... and will be the dominate language. ... > compete with Java, .NET, and any other commercially backed language. ... PHP has a considerable mindshare as "the language" to write ...
    (comp.lang.python)

Loading