[Ilugc] RE: RE: Python and Ruby Frameworks vs Statically typed languages

  • From: prem@xxxxxxxxxxxxxxxx (Prem Kurian Philip)
  • Date: Mon Jul 17 18:35:58 2006

Hi Vamsee,

Also, if I were to use unit-tests to get around this problem, it is in
anycase just a work around to a problem with the platform. This problem is
perhaps more elegantly solved if Python / Ruby includes a run-time switch
which turns of dynamic typing (but this will require fairly extensive
changes in these platforms).


Sorry, I have to strongly disagree. Just because you have static typing,
it doesn't mean that you don't need unit testing at all. In that case,
you wouldn't have JUnit, and all those XP methodologies and tools to
make Java projects a little more manageable.

I didn't make the assertion that unit tests are not needed. What I said is
that using unit tests to find errors which could have been caught during a
normal compilation stage is kludgy. Unit tests are good and have their
place, but a compile time error listing is definitely a useful aid.

Well, this is where the subjectivity and religious wars come in -
purists want type safety at any cost; pragmatists don't care about it
until it hits them on their head - which it rarely does. I'm certainly
in the latter camp.

If your application is simple, and it is not mission critical, then it is
perhaps useful to go with the line of reasoning that you expound here -
that is to discount errors which "rarely" occur. A compile time warning or
error is definitely a wonderful mechanism to detect errors which might
otherwise be very difficult to detect.

I have written and architected some very large enterprise applications in
Python: if I am asked to do something similar now, I would definitely go
with a language like Java. The problem with java is not the language but
rather the overly complicated mess that is J2EE and this crazy fixation
with "descriptive programming" using a million XML files for even
describing application logic. J2EE looks like it was designed by a
committee and it most certainly was.

The time it takes to compile code is quite often overstated. The compile
process reveals errors which can then be fixed quite easily. In a
dynamically-typed system, you will have to deal with the same errors but
you will discover them (if at all) only at runtime - and so what you lose
in compile time (on statically typed languages) is more than exceeded in
time it takes to discover the errors while programming using a
dynamically-typed language.

Also, the performance penalty of dynamically-typed languages may not be
suitable for some applications.

I am no purist - I continue to use languages like Python and Ruby (and on
occassion, groovy), but not for the large scale applications where java /
.net is more suitable.

Thanks,
Prem




Other related posts: