in reply to Re^2: Static typing is mostly a waste of time
in thread Static typing is mostly a waste of time

And no I don't think Java's (or C#'s) type "system" should look like Perl's. But something closer to ML, Clean or Haskel would definitely make things much better. You'd get the same kind of compiletype checking, but without having to typecast all the time and without the runtime typing errors caused by errorneous typecasting.
But Haskell/ML don't magically coerece Ints to Strings for you. That just goes to show that the real problem here has nothing to do with static typing, and everything to do with poorly designed libraries and/or poor coding in general. If you have to jump through hoops to get your code to work, you're probably doing something sub-optimal. That's applicable whether you're using Perl, Java, Haskell, whatever.
  • Comment on Re^3: Static typing is mostly a waste of time

Replies are listed 'Best First'.
Re^4: Static typing is mostly a waste of time
by Jenda (Abbot) on Apr 17, 2005 at 17:13 UTC

    I don't want it to coerce Ints to Strings. Far from that. What I do want is to be able to implement a generic datastructure for objects of type 'a, where 'a is any type and then be able to write functions/methods that take this structure with any type of objects and another that only takes structures of Ints. I want to be able to write a function that takes a list of 'a, a function of type 'a -> 'b and returns a list of 'b.

    What I end up doing is either having to "reimplement" this very same function for each list type or implement one that takes a list of void pointers (sorry, objects), a function that accepts a void pointer and returns a void pointer and produce a list of void pointers. Which I will then typecast to whatever I think I've received. Either suffers the safety or the convenience. And why? Just because the excuse for a type system of Java/C# doesn't undestand the concept of type variables. Polymorphism? My foot, they don't even understand what does that mean!

    Jenda
    We'd like to help you learn to help yourself
    Look around you, all you see are sympathetic eyes
    Stroll around the grounds until you feel at home
       -- P. Simon in Mrs. Robinson