Our ESP isn't working very well. Login and vote now.
By zoat
via mindview.net
Published: Nov 09 2006 / 08:38
By zoat
via mindview.net
Published: Nov 09 2006 / 08:38
Comments
fauigerzigerk replied ago:
I agree with him on the safety part - you need to test anyway. But where his argument completely falls down is readability. I wonder when was the last time Bruce Eckel had to maintain a code base of any significant size created by someone else. How do you find out what the latent type of an instance variable is? You have to read every single line of code in the entire class. That's how. The standard reply by advocates of dynamic typing is "why do you need to know what the latent type is? Just pass some object and you'll see whether it works or not". But that's not how you learn about the purpose of a code base you don't know.
ilazarte replied ago:
Classic Architects Syndrome. These days it doesn't seem that the "thought leaders" are actually even coding. "Ohh look, my high level conclusion looks great on paper!" A lot of authors and so-called "Agilists" fall into it this trap...
As someone who *has* maintained a > 100K scripted environment, I can say, comfortably please don't touch my Java code.
Ricky Clarkson replied ago:
Bruce has an irritating habit of selectively neglecting to mention things he knows about.
In the section called "Flexibility vs. (Perceived) Safety", he really should point out type inference. It's possible to have static typing without extra finger-typing, as Haskell shows.
Let's make a function that squares a number:
square x=x*x
Done. What is the function signature of that? Well, we don't need to write it, but it's inferred, and we can see it:
> :t square
square :: Num a => a -> a
This means that square is a function that takes one value and returns another of the same type, and that the type is some kind of Num.
Voters For This Link (13)
Voters Against This Link (0)