From: Sean O'Dell Date: 2003-11-20T10:48:01+09:00 Subject: Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) On Wednesday 19 November 2003 05:06 pm, Austin Ziegler wrote: > On Thu, 20 Nov 2003 08:19:08 +0900, Sean O'Dell wrote: > > > > The programmers who jump into Ruby, yes. Their managers, no. There > > are requirements in the real world that go beyond "what feels > > good" and some of it has a basis in reality. Being able to ask > > what interface an object implements does a lot to make up for bad > > documentation and crazy error messages. On large, multi-developer > > projects, and with poorly documented libraries, this gets proven > > every single day. Type checking, in whatever form it takes, helps > > a LOT. > > This is pointy-haired boss twaddle. Type checking does *not* help > either the developer or the project -- it helps the compiler. I've > worked on very large scale projects and type checking did nothing to > help. In fact, it is my professional experience that type checking > harms the project because it encourages the (improper) concept that > "if it compiles, it must be okay." Again: read the Eckels article. I really feel this is just personal experience talking now. I've shared code with developers on both typed and untyped code bases, and ALWAYS it's the typed code that they have less trouble with and ends up getting screwed up the least when they add code or make calls to my code. The untyped code ALWAYS went to crap and became an unusable tangled mess after a point, and was ALWAYS refactored several times or converted to typed code (C++). The typed code almost always stayed alive and was easy to merge and use. > Ruby is also in large scale production use in several places > (including Amazon), and doesn't use static typing. Amazon is large, but how large is their deployment of Ruby? > Managers *don't* know the upsides or downsides to static typing. > Most of them won't actually have a clue as to what the term means. > There are legitimate reasons to use C, C++, and Java. Static typing > isn't one of them, and I can't think of a single manager in my past > who would argue that it would be. Some developers, perhaps, but they > are also people who didn't have exposure to dynamically typed > object systems and languages. Managers are generally programmers who don't program as much as they look at code and try to help people design integration. They like typing because it helps them understand the code. Typing helps. Like it or not. I'm not saying Ruby sucks because it's untyped, I'm saying typing helps. > > I loath templates. But I know what you mean. > > I don't like C++ templates, but they're better than the alternatives > available to C++. Sometimes I felt forced to use templates, but I still loathed them. In fact, there's quite a bit about the C++ specification I am at odds with. > > I am not an advocate for strong static typing. I only advocate a > > reasonable assurance that an object implements a certain > > interface. > > As Matz has said, there's no clean way to do this in Ruby at this > point. Simply doing name checking (whether interfaces or > inheritance) doesn't ensure compliance, so it actually buys us > *absolutely* nothing more than assuming we have the right object to > begin with. I agree there's probably no efficient way to offer guarantees. I agree doing something like that would be way too off-the-path for Ruby. But I don't think that a half-promise is useless. > One of the things not mentioned there is that Ruby is also used in > the Amazon apparel store (see [ruby-talk:54605]). All of these have > been done *without* type checking. I have no idea how to refer to [ruby-talk:54605], but I'll assume that Amazon uses Ruby as the backend for their apparel store. That's good to hear, but it doesn't mean it can scale out to other things very easily. The larger it spreads out, the more typing is handy. > > I really think doing some form of intelligent, flexible interface > > checking will put Ruby a notch up in a lot of C++/Java developer's > > eyes. It won't be static type checking, but you can bill it as a > > suitable replacement, and I'm sure that'd be good enough for most > > water-cooler discussions. > > *shrug* I don't think that it's necessary. Most people I've talked > to have been convinced that Ruby's worth looking at because of the > deep object orientation. This is a baby-and-bathwater issue. I still HATE that I can't control when objects die and that there's no destructor. Yes, garbage collection is nifty. Yes, I use yield now for doing cleanup, and it serves as a replacement, but in the year or two I've been programming in Ruby, I still hate that objects just hang around until the collector gets them, and I hate that all I get is a finalizer. I LOVE Ruby, but I don't love that part, and probably never will. > >> Useless runtime processing. > > > > Listen. My thoughts on this were already written. I said it could > > be shut off at runtime. > > A NOOP still costs performance. Further, since most things can be > redefined at runtime (there are very few keywords in Ruby), it's not > exactly something that can be turned off. I think the performance issue is blown out of proportion. Code gets added with each release that adds more to the code base and does far less than what a type checking mechanism would. > >> I tend to open the code and look at it. > > > > That's you. Don't make the assumption that performing such a task > > is fine for everyone. That's not a language feature, that's a > > personal habit. > > It seems to be the nature of many Ruby developers. Which is a curious trait that I don't share. And since, save for my occassional ranting threads, there is little traffic in this newsgroup/list, I am wondering if perhaps I'm just not "getting it" here and should move on to something else. When did the Ruby community become so hostile? I remember the last couple of discussions I had, they were energetic but polite, and now it seems like a war zone. If you folks are dead-set in your ways and look unkindly upon people who suggest that Ruby change and grow out off the beaten path a little, just say the word. I'm a free soul here, I'm not signed up for anything in particular. I like Ruby, and I think a lot of it is smart, but because it's free and flexible, not because there's a hardened core of zealots who defend it from change at all costs. This seems silly. I got an anonymous comment on my RCR from someone calling my RCR "static typing." That's getting ludicrous. What is that about? Is this what the community is boiling down to? Lighten up folks. Take my RCR and comment on it until it works. > > Fact is, it doesn't seem like you like anything I say, so I think > > my thread with you is at an impasse. > > No, I don't like what you've proposed. Propose something that is > useful and I can see supporting it. So far, you've suggested > something that does not add value or hasn't been done by others > (namely Ryan Pavlik's metadata module). Is that the Metatags module he has in RAA? I thought that was more of a documentation thing that would be useful by parsers other than Ruby itself? I kind of remember something about that. It was a YAML thing, was it not? I don't think it's the same thing. I think it's also dependent on the developer keeping the code in sync with the metatags. I could be wrong. Also, I think you are just disagreeing with me to disagree. Not once have I heard a suggestion to alter my idea to make it work. It's not set in stone. It's yours, it's Matz's, it's everyone's idea now. Talk and make it work. Off my ass now, please. You understand me, the idea is written up as an RCR. Go comment on it constructively. Sean O'Dell