On Mar 13, 2008, at 10:51 AM, Krzysztof Kosiński wrote:

I failed to notice that comment somehow, . I was also a bit puzzled that

there are "OutputStreams" and "Writers" instead of "stringbufs" and

"streams". I'll look into that a bit more once I'm done with the clipboard.


I think most of that comes from Java successfully addressing such issues (using the reasearch form Taligent), while C++ did not.

Just to go on naming, "stringbuf" sounds like it should be a buffer for a string. Perhaps some "writers" might write to those, but they might write to something else.


http://java.sun.com/docs/books/tutorial/essential/io/streams.html
http://java.sun.com/docs/books/tutorial/essential/io/bytestreams.html
http://java.sun.com/docs/books/tutorial/essential/io/charstreams.html
http://java.sun.com/j2se/1.5.0/docs/api/java/io/package-summary.html

For the naming Java uses, "Streams" deal with transport of *bytes* and "Writers" deal with sending of *characters*.

Also in C there is no 'byte' only 'char' that means a byte but often is used for characters, and 'strings' are just arrays of 8-bit units that happen to have a zero value in one of their members. On the other hand Java has a 'byte' type for 8-bit data, a 'char' type for character data, and 'String' that is actually a class. in fact, all instances of string literals in Java programs are really instances of java.lang.String and you can do things like 
if ( "magic".equals(myVar) ) {
}

Anyway, much of the reason to use terminology that sounds more like Java's than it sounds like C/C++ is that C/C++ terminology is very mismatched and ambiguous compared to Java's.