Extending FileList with CrLf

Colin Putney cputney at wiresong.ca
Sun Aug 3 04:40:43 UTC 2003


On Saturday, August 2, 2003, at 06:47  PM, Andreas Raab wrote:

> I don't really think you mean what you're saying ;-) Noone is arguing
> against the abstraction, what what we are discussing is what the 
> defaults
> for that abstraction should be. And here, it seems to me (looking at 
> MCFile
> for example) that you do in fact prefer a smart, auto-translating,
> default-to-platform handling approach over a dumb, 
> make-line-ends-garbage,
> default-to-CR approach ;-)

There's an old saying, "I may not mean what I say, but I always say 
what I mean," which is the same thing, you know. I mean, if I don't 
mean what I say, then I could say anything and it means nothing, or 
nothing meaningful I'd say. See what I mean?

That said, here's what I mean:

Yes, I do want Monticello to handle line-ends gracefully, to be smart 
about deciding which line ends to use and translate as needed, 
transparently to the user. That doesn't mean I want StandardFileStream 
to handle all that for me.

MCFile *implements* a smart, auto-detecting, default-to-platform 
line-end policy, it doesn't rely on one. That policy is specific to 
applications that deal with CVS-managed text files on a variety of 
platforms and with a variety of CVS clients. I wouldn't want or expect 
that policy to be implemented by a general-purpose FileStream.

Daniel's argument hinges on the distinction between applications and 
libraries. In the days of yore, that wasn't particularly meaningful. 
But as the package removals progress, we must begin to think about the 
base image as a common set of libraries used by many applications.

In a monolithic system, it makes sense to put "smarts" into the stream 
classes. After all, you've got all the users of those classes handy, 
and cmd-n will tell you everything that needs to be accommodated by the 
policy.

But a library shouldn't try to be smarter than the application that 
uses it. And yes, I know that the smarts can be turned off. But I agree 
with Daniel that the errors caused by inappropriate cleverness are 
worse than those caused by lack of cleverness. Cleverness adds 
complexity, and when something goes wrong it's that much more difficult 
to figure out what it was. Therefore, I believe the default should be 
simple behaviour (dumb), rather than complex behaviour (smart).

That's all I have to say.

Colin



More information about the Squeak-dev mailing list