pharo-smalltalk
pharo-smalltalk copied to clipboard
Introduce #printOn: early
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: