pharo-smalltalk icon indicating copy to clipboard operation
pharo-smalltalk copied to clipboard

Introduce #printOn: early

Open bencoman opened this issue 5 years ago • 1 comments

Just a thought from reading a thread by roelof in Discord #learning-help channel.

raydeejay: don't reach inside an object to read properties and print them on a stream raydeejay: tell the object to print itself on a stream raydeejay: in other words, implement printOn: roelof: oke, and how do I call it

The operation of #printString and #printOn: is useful convention perhaps taken for granted. Maybe in the tutorial @macta mentioned was the "first real need for classes", or maybe even prior to that in an exercise of its own, have a test that checks an object's #printString and get student to implement #printOn:

bencoman avatar Mar 29 '19 09:03 bencoman