Python for large projects
Stefan Axelsson
crap1234 at hotmail.com
Wed Mar 24 14:32:50 EST 2004
Jacek Generowicz wrote:
I'm just going to answer these few points, since static vs dynamic
typing has been hashed to death before. Please also note that I'm by no
means trying to change your opinion on the matter, I see this more as a
panel style debate.
> Forgive me if I am wrong ... but typeful programming is more of a
> programming style rather than a property of a (static) type system, is
> it not? I realize that Haskell encourages typeful programming by its
> very nature, but that doesn't make typeful programming an property of
> the type system.
Yes, it's not really a requirement of the type system. In fact dynamic
typing can be simulated by a polymorphic static type system (I haven't
got the reference handy, follow up if you're interested), leading to the
argument that they're strictly more powerful (you can do one in the
other, but not the other way around) though of course not in a Turing sense.
So, it's a style, though i.e. the typeclasses in Haskell makes it a good
fit. The same is true of unittesting as you go, though, there's nothing
in dynamic typing to enforce it.
But the interesting point is whether static type systems somehow
magically makes good programmers from bad, and that's not true IMHO.
That's not to say that I prefer a bad programmer from having a static
type system, the more hurdles you place in the way of the truly bad
programmers of which industry is chock full (as a student of mine with
experience from industry once exclaimed: "But most programmers are
BAD!"). I'm talking about any type of static type system here, while I'd
say that the type system of 'C' isn't that much of hinderance to the
gifted, it decreases the productivity of the clods to managable
proportions (I'm talking about the programmers with negative
productivity here).
In this setting I'd say that Java is a win, though I wouldn't recommend
it in a setting where most people actually knew what they were doing.
For that setting I prefer a better static type system, one that helps. I
consider myself a fair programmer with quite a few years experience and
I still make silly mistakes all the time, mistakes that take longer to
find in Python, unit test or no unit test, than they would have in e.g.
O'Caml.
> (I am not sufficiently familiar with typeful programming or Haskell,
> in a real-life situation, so do correct me if you think I am wrong.)
Well, in truth I haven't been involved in a true multi person project
with Haskell so I don't have any data. A problem here is that I have yet
to see a Haskell programmer versed in typeful programming that couldn't
do well given just about any programming language. I'd fall in the old
"Well of course *they* succeeded they're geniouses".
> What I object to, is the
> suggestions that static type systems somehow provide some significant
> safety for free. What I object to even more, is the suggestion that
> static type systems are _necessary_ to prevent any development process
> from turning into an unmitigated disaster.
No magic bullet IMHO. That depends completely on the situation. Then
again I've found that any enforcement mechanism helps. The harder it
becomes to skirt the requirements of the process the more it will be
followed. A type system has an advantage here in that it *cannot* be
circumvented while it's trivial to write no or bad unit test so that you
can ship your code to the integration step.
If you have good, experienced people who are able to withstand the
pressure to deliver no matter what and are familiar with the problem
domain, then any project is on the way to succeess no matter what
technology was chosen in my experience. The choice of type system is way
down on the list.
We've had that argument within Ericsson time and time again with the
Erlang people at the AXD 301 project (who were the first adopters and
many of which helped develop the language and its tools and who were all
very experienced in the problem domain having been involved in the
failed AXEn project) tell us time and time again that dynamic typing is
no problem because "we just don't make those kinds of errors" and we'll
find it in testing, programming with a fail-fast mind set. We in the GSN
division (who were the second adopters, didn't have much input in the
language, didn't really choose Erlang as much as were forced into it and
are building a brand new product in a new domain) answer; "Well, we're
not so certain, that's not entirely our experience, we'd like a bit more
hand holding to be able to find the errors sooner".
It's interesting to note that Ericsson drew the conclusion that C++ was
to blaim for the failed billion dollar AXEn project. Of course the
choice of language had very little to do with that.
> Well, let's not get too
> excited ... what I object to are suggestions that Java is more
> suitable for programming projects _because_ it has a static type
> system.
No disagreement here. :-)
Stefan,
--
Stefan Axelsson (email at http://www.cs.chalmers.se/~sax)
More information about the Python-list
mailing list