exercism / pharo-smalltalk

Exercism exercises in Pharo.
https://exercism.org/tracks/pharo-smalltalk
MIT License
34 stars 28 forks source link

Discussion: Pharo specific exercises that highlight language features #208

Open macta opened 5 years ago

macta commented 5 years ago

This is placeholder to put ideas for future Pharo specific exercises that hightlight its power/features:

  1. Moldability - create a scenario where users implement a #gtInspectorDetailsIn: method and see how useful it is to have custom inspector panes that also work in the debugger
  2. Refactoring is not magic - have an exercise where users create a simple refactoring rule, and learn about how code is an object too, and ast's are not scary
  3. The Debugger is an object - have an exercise where you make a simple change to the debugger (maybe a button to search the stack and jump to that execution point)
  4. Create your own syntax - exercise to add ifMaybe: or something that would not be possible in many languages
  5. Persisting live objects - something to show how to fuel out objects and bring them back
  6. Points 1@2 and areas? Something that highlights binary messaging
  7. Double dispatch
  8. Object oriented design based problem to really identify the objects
  9. Error handling via ifAbsent, ifNone (inverts error handling very usefully)
  10. class var vs. inst var. vs class inst var
samWson commented 5 years ago

Sounds like a great idea. Although the stuff you mention here is things I never though Smalltalk could do. I do recall there is an example of how to use Fuel in one of the free books from Pharo.org.

ghost commented 5 years ago

are these not exercises that could be in the hard section not in the easy one

macta commented 5 years ago

yes these would be more advanced (although not necessarily, there are simple things in the language as well - for example, something with points?)

ghost commented 5 years ago

maybe some exercises where I can practice double dispath and when I need to use that

ghost commented 5 years ago

or practice more with object and/or streams

bencoman commented 5 years ago

I added... #220 Custom exercises to introduce Reflection

Ducasse commented 5 years ago

In the roll die game I have a nice double dispatch exercise. check the pdf at https://github.com/SquareBracketAssociates/PatternsOfDesign

Stef

samWson commented 5 years ago

@Ducasse thanks for the link to the exercise. I'll definitely have a look at it.