isLoop 2025 Program
Guided Exercises
- A first tutorial: Developing a simple counter
- Die: Crafting a simple embedded DSL with Pharo
- Rock Paper Scissors
- A little Saturn PathFinder + an extra part: Finding the North with Compass
- Country Flag
- A memory game: A simple tutorial with Bloc
- A little expression interpreter
- Understanding Visitors
Day 1: Introduction to Pharo and OOP
During this day, you will learn the survival kit to code in Pharo. You will learn the syntax and the main tools to code and publish code. After that day you will be able to code in Pharo. You will also learn the simple object model of Pharo, understand what are objects and classes, learn the difference between messages and methods, learn to create packages, classes and methods in System Browser.
1. Welcome
- Welcome words
- What is Pharo? [slides] [video EN] [video FR]
- Install Pharo [download]
- First look and Hello World in Pharo environment
- First look at the environment: Playground, Inspector, System Browser, Debugger
2. ProfStef Tutorial
Open the Playground and evaluate the following line: ProfStef go.
4. Objects and Classes
5. Exercise: Counter
[PDF] In this exercise you will learn how to create packages, classes, methods, instances, unit tests and more. This tutorial covers most of the important actions you will perform when developing in Pharo.
Recommended videos
Day 2: Inheritance, Method Lookup, and Dispatch
You will learn about inheritance and polymorphism - the key concepts in object-oriented programming. You will understand why sending a message is making a choice based on classes. You will also understand what is to send a message and how lookup works.
1. Exercise: Counter
Finish the exercise.
2. Kata: Rock-Paper-Scissors (if-else)
This exercise consists of implementing the rock paper scissor game. For this, you will need to have a class named RockPaperScissors. For playing the game, the user needs to use the class like this:
game := RockPaperScissors new.
result := game play: #paper against: #rock.
result "#paper"
3. Inheritance and Method Lookup
4. Kata: Rock-Paper-Scissors (double dispatch)
[PDF] In this exercise, you have to implement the Rock-Paper-Scissors game using a simple but powerful approach called double dispatch that consists of sending another message to the argument hence making two choices one after the other. This exercise will show you an important paradigmatic shift where you will go from asking questions (conditionals) to sending orders. It is a clear illustration of the "Don’t ask, Tell" design principle.
Recommended videos
- Essence of Dispatch: Let the receiver decide
- A double dispatch starter: Stone Paper Scissors
- Double dispatch: Does not have to be symmetrical
- Stone Paper Scissors: The case of results
- Double Dispatch: Adding numbers as a Kata
Day 3: Messages and Advanced Topics
1. Exercise: Rock-Paper-Scissors
Finish the exercise.
2. Messages
- Understanding messages [slides] [video EN] [video FR]
- Message composition and precedence [slides] [video EN] [video FR]
- Message sequence and cascade messages [slides] [video EN] [video FR]
3. Advanced Topics from Stéphane
- Searching for examples in Finder with regex
- Exploring bytecode and abstract syntax trees (AST)
- Extreme test-driven development: writing code in the debugger
- Test-Driven Development [slides] [video]
- Xtreme Test Driven Development: Getting a productivity boost [slides] [video]
- Deprecation rewriting [paper]
Open Playground write a method signature like this: Collection >> #do: and inspect it. Navigate through inspector tabs to see the bytecode or the AST.
Recommended videos
- Introduction to blocks
- Parenthesis Vs Square Brackets
- Blocks vs. Objects: Rethinking common abstractions
- Messages for Java programmers
Some Cool Projects
Here are some cool projects that you can explore to see the power of Pharo and live programming: