> > How do end user interfere with the programming language? If your user is a > developer than the statement "..does not require the use to understand > streams at all..." is somewhat strange because it is something very > fundamental a good developer should know. > > As I teach introductory OOP, the kids always want to print their object, and they don't yet know anything about streams. But I realize that it's fundamental for any programmer to know.
> Anyway, there is printString that produces a String and it uses printOn: to > print on a stream that is used to build the string. For the sole usage you > just need to know printString. If you start to print over a hierarchy of > objects you see it very well why you should use streams. > This is easy to explain from a java perspective. In Java a String is > immutable and we know that concatenating produces a string for every > combination of other strings. That is the reason why you need to use > StringBuffer/StringBuilder if you don't want to lose performance and memory. > And that is something other programming languages force you to know. > A stream is something you can write subsequently on no matter how many > objects write on it. You just hand the stream from on object to another and > only the last one needs to do the string conversion. As Object provides this > functionality you should implement printOn: on your objects. > > Norbert > > Completely makes sense now. Thanks guys. -- Alan Rodas Bonjour
