On 11 July 2018 at 22:43, Tim Mackinnon <tim@testit.works> wrote:
Hi - Iâm trying to help Sam kickstart Pharo working Ian the exercism platform. For those less familiar, exercism is a platform with a series of exercises that users/students âcheckoutâ and then run a test to guide them through completing the code to then progress to the next challenge. There is also the ability to comment on each otherâs progress and see examples of otherâs solutions. Most languages are more traditional file based examples, so it would be nice to have Smalltalk as something a bit different. Although we think Tonel 2 will be an excellent vehicle for participating alongside other languages as it helps us fit in a little easier (nice how all our initiatives are coming together to make this easy).
As you can imagine, exercises start out very simple and then increase in complexity. My question however, is about the early exercise like HelloWorld, LeapYear etc.
These tend to be single method problems of just a few lines, requiring no instance variables (this all comes later).
Iâm wondering about peopleâs thoughts on whether we should introduce early Smalltalk examples as just class methods and later introduce instance methods and âclass constructor methods â? Or is this more confusing for students? Essentially we are battling with the familiarity of the C âmainâ method - and looking at python and ruby solutions, they initially start with no objects and just main style methods.
E.g. hello world can be simply: HelloWorld sayHello. vs HelloWorld new sayHello.
I can see proâs/conâs either way - but wondering what others think.
I've installed Sam's PR and my main thought is that the System Browser defaults to the instance side, so its easier for fresh students to misplace code when it ends up on the class side, when they close a browser and open a new one. The unit test the students run takes care the of needing to send #new to get an object, so I think its simpler to keep implementations on the instance-side. One downside is that the Quality Assistant indicates that utility methods (having no reference to instance variables) should belong on the class side. It might be good that this warning is disabled globally when the Exercism tool is installed. I think using a Manifest to do this would look complicated to newcomers. Later on some specific Factory Pattern exercises might be useful to introduce students to using class-side methods. cheers -ben