[ANN] TextFiles published on SqueakMap

Andreas Raab andreas.raab at gmx.de
Wed Aug 6 10:00:47 UTC 2003


> I second SmartTextStream over TextFile.
> 
> Names are important.

I agree, so let me briefly give you the reasoning why I chose TextFile. My
assumption was that  most people will want to use the encoding/crlf
conversion when they deal with external files. So I would guess that the
most likely question to which the answer is "TextFile" would look like: What
should I use to read/write TEXT from/to a FILE?

That text file is able to deal with internal streams (which I think is most
of the argument for the more generic "stream" term) is a bit of a side
effect here which I didn't really intend when I started (it just turned out
that testing is a lot easier on internal streams ;-) and I don't think it'll
be the primary use and so I think that the term file may be easier to
associate than stream.

BTW, I _would_ be happy with TextStream as a more general name, but I
heavily oppose that "Smart" prefix. First of all, "Smart" doesn't tell you
anything about where the smartness is and it often leaves people with the
impression of some bit of software trying to be "overly smart". Given that
TextFile does only a bit of encoding and crlf translation (which boils down
to straight text replacement) there is absolutely nothing "smart" about it.
It's just what a modern text stream _has_ to do these days unless you really
want to ignore 80% of the world.

All in all I think that unless we merge TextStream with TextFile I'm happy
with the name as it is. Merging is something that I actually thought about
quite a bit (but I haven't done anything yet) as it would be Really Nice
(tm) if we were able to do something like this:
	myFile := TextFile newFileNamed: 'workspace.html'.
	myFile encoding: #html.
	myFile nextPutAll: workspace contents. "formatted text"
etc.

Cheers,
  - Andreas



More information about the Squeak-dev mailing list