Bruce Eckel
Posts: 866
Nickname: beckel
Registered: Jun, 2003
|
|
Re: Generics "Considered Harmful"
|
Posted: Jul 9, 2005 1:13 PM
|
|
It's not quite as simple as that. The part you have right, I think, is that there are two camps of people, but I would classify them as "those who think it is as simple as that" and "those who don't." Or, from Gerald Weinberg's analysis, "Linear thinkers" and "Systems thinkers." Weinberg makes, in "Becoming a Technical Leader" (and other places, I'm sure), the very important observation that both approaches work at different times, which is why we can't simply make the decision that one approach is right and move on. I think the most difficult thing for someone schooled in linear thinking (as I was) is to acquire systems thinking in addition to linear thinking, because linear thinking doesn't want to allow any competitors -- it says "you can always control variables and change a single factor and deterministically establish the results." Systems thinking says that, in reality you can't ever just change one thing. Everything affects everything else.
An example often comes up in discussions about Java. There's a significant camp that says that "Java is a statically typed language." But if you really look at it, while Java has static typing, it also has a very significant dynamic aspect. Some kinds of type checking simply don't happen until runtime. And you can go further and use reflection to do some very dynamic things. For people who are convinced that Java should only be considered a statically typed language, anything that isn't checked until runtime is simply branded "bad" and "you should never do this." But that closes a great many doors on the possibilities of the language, and delegates it to be, in effect, "A better C++."
This is a very difficult discussion, and although I've been thinking about it for years, it's only been in the past couple of weeks (primarily from reading Weinberg) that I began to realize why it is so complex: it's not "either or," it's "sometimes one, sometimes the other." In more concrete terms, you can't simply say that static type checking is good or bad. You have to look at the context, which includes the system you're trying to build and the people that are building it. When I was working with college interns, Java's static type checking was grossly lacking -- the interns needed to be put into an iron maiden of type checking in order to be productive. With mature programmers working on certain types of projects, static checking is an impediment, and they can be vastly more productive with a language like Python. (On the other hand, I think the teaching of statically typed languages warps the minds of young programmers into thinking that all they have to do is argue with the compiler until they reach agreement, then the program is done. In effect, all they have to do is "pass the test," then they deserve an 'A').
This comment needs to become an essay on its own, but these are some of the starting ideas.
|
|