Best friend for those new contributors in Pharo
There is a great motivation to use open source projects. However, I think we can be more than just users and we can contribute as developers. It’s not necessary to have great knowledge to start doing so with Pharo. For example: there are some issues tagged as “good first issue” and “easy”, that consist in adding commentaries, renaming classes/methods and some others that are self explanatory that consists in only copying and pasting a line of code using Finder tool, just like in the following example issue #5271.
Pharo is a pure object-oriented programming language in the tradition of Smalltalk. It offers a unique developing experience that is in constant interaction with live objects. Listing some of the advantages that I’ve found so far(and of course there are many more):
- It is impossible that what we are programming does not fit in a postcard since most code is pretty small.
- The community is very active and kind. They are always willing to help each other. Invitation here.
- The documentation is in the comments section. This is so because in Pharo a convention is used in that every class contains in itself comments, tests and the UML. In this way, new developers can read these comments and test every method/message to fully understand what it is about.
- Videos, books and proposed exercises and it’s solutions at MOOC.
In this opportunity, I am going to introduce you a step by step on how to use Pharo’s Finder tool because despite how intuitive the code is, the active community that is attentive to solve your doubts and the lectures at MOOC, the first time you review an issue and its description one can end up a little scared. At least that’s what happened to me.
The Finder tool is used to look for references into different groups such as: selectors, class, source code, patterns through the system, or through a specified environment.
Step 0: Welcome to Pharo
Before everything, don’t forget to install pharo. Once you have installed it, just create a new virtual machine:
Once done, you’ll end up with an image which we will work with:
Select the created image and click on the launch button at the top of the window:
Step 1: Open Finder
After doing a right click on the workspace, select the browser option and click on Finder:
Step 2: Select the keywords to search within a group
For this example let’s review an issue that my friend Sebastian solved in 2019. The Issue #5271, tagged= “easy”, the issue can be found here.
The issue tittle conveys that an improvement has to be made in the executable comments of isAllAlphaNumerics, but we are yet to find out what isAllAlphaNumerics is; We can deduce it’s a function so it can be searched as “source”.
We just copy and paste on the search box at the top left corner of the Finder window and then select in the dropdown menu the “Source” group:
Step 3: Check within the results found for what is being looked for
Now within the results, what we have to look for is what the issue description asks for; Second result for this case.
In order to make some changes, double click on the result to display a new window with the location of that reference, named System Browser. In this example we see that it’s a test that belongs to the package Collections-String and is part of the String Class. Image 9 can help you to understand this, more info here.
Step 4: Modify as desired
Once we see that there is something that resembles what we are looking for, in this case we see something similar to “‘a’’b’ isAllAlphaNumerics >>> false”, which is what the issue mentions, we realise that the only thing that we were being asked to do was improving the method/message adding the new example as a comment. Just like Sebastian did once his changes were uploaded; About how to fork the repository, create a new branch, make a pull request and others more info: here.
I hope that with this example you will now feel prepared to solve many issues. If you don’t understand what it is at first sight, Don’t worry! Finder tool is your best friend to start contributing with Pharo.
It’s a pleasure to be part of the team GSoC 2021 with Pharo Consortium and I would love to motivate my friends and others to be active open source contributors with Pharo ❤. As a result, the objective of this post is to be helpful to anyone that is willing to learn and help the Pharo community, any comment or suggestion is welcome.