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

Actually my complaint is that "it's supposed to catch all kinds of potential errors", but first all, those "potential errors" don't seem to happen much in reality; second it often seems I'm helping the compiler, rather than the other way arounrd. For example:
List list = getList(); // from somewhere, say a list of Person Iterator it = list.iterator(); while(it.hasNext()){ // the following line makes perfect sense to me, // but it causes a compiler error, I'm supposed to write: // Person p = (Person)it.next(); // my question: Is the compiler helping me or I'm helping the com +piler? Person p = it.next(); // now call some method on p. }
Furthermore, as others have pointed out, the fact that I can cast anyway I want to get by the compiler means the compiler won't really catch serious bugs. It's like the compiler is saying: if you claim you really know what you're doing, I'll let you; but if you don't, I'll try to help by asking you to type a little more.

Replies are listed 'Best First'.
Re^3: Static typing is mostly a waste of time
by Mabooka-Mabooka (Sexton) on Apr 17, 2005 at 23:58 UTC
    // the following line makes perfect sense to me, // but it causes a compiler error, I'm supposed to write: // Person p = (Person)it.next();


    -- which says it all about the myph of "Java is more safe than C++, because... it doesn't have pointers"...:-))).