You're right. I forgot between the lesson and the exercise. My bad. -----Original Message----- From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of Stephane Ducasse Sent: July 22, 2017 9:56 To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Subject: Re: [Pharo-users] Pharo MOOC: Difference between class methods and instance methods Hello michel I checked and we introduced them (without explaining them) in W1S6 On Sat, Jul 22, 2017 at 3:50 PM, Stephane Ducasse <stepharo.self@gmail.com> wrote:
Ok I see. We were struggling with order and may be we should remove the class methods in the exercise.
On Sat, Jul 22, 2017 at 3:48 PM, Michel Marinier <mobimich@gmail.com> wrote:
Not yet. I'll start on week 3 today.
The lessons you mentioned are in week 3 and week 5 I believe (the W3 and W5 in the PDF file names). However, the exercises I am referring to are in week 1 and week 2, possibly before the concept has been explained?
(for example: http://rmod-pharo-mooc.lille.inria.fr/MOOC/Exercises/Exo-W2-TinyBlog- ModelExtensionTests-FR.pdf )
-----Original Message----- From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of Stephane Ducasse Sent: July 22, 2017 7:30 To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Subject: Re: [Pharo-users] Pharo MOOC: Difference between class methods and instance methods
Hello Michel
did you have a look at the mooc videos?
C019-W3S06-BasicClassMethods.pdf and W5S02-UnderstandingClassMethods.pdf
In Pharo there is only one method lookup. a method is looked up in the class of the receiver and if not found up in superclass hierarchy.
This exactly the same for class methods:
On Fri, Jul 21, 2017 at 10:38 PM, Michel Marinier <mobimich@gmail.com> wrote:
I am an absolute beginner at Pharo and Iâm working my way through Pharo by Example as well as the MOOC online. While coding the TinyBlog example in the MOOC, I got stuck until I kind of âguessedâ the difference between âTBPost
methodNameâ and âTBPost class >> methodNameâ. I didnât know I had to click on the Class button to access the class methods and coded all the methods as instance methods. As a result, the system complained when the code tried create a new instance from a method such as âtitle: text:â.
I suppose I might have missed the place where this was explained in the MOOC, although Iâm not sure it was emphasized early on in the lessons. However, a suggestion would be that if you ever update the exercises that a notice be added warning students of the difference, at least in the first few exercises where there is so much to learn and remember. Iâm doing it in French, so it might look like this:
â
Nâoubliez pas la différence entre âTBPost >>â et âTBPost class >>â. Le premier indique quâil sâagit dâune méthode dâinstance. Le second indique quâil sâagit dâune méthode de classe. Vous devez cliquer le bouton âClassâ pour accéder à la section correspondante. Dans la section pour lâinstance, la définition débute par âObject subclass: #TBPostâ alors que dans la section pour la classe, la définition débute par âTBPost classâ.
â
By the way, congrats on the great work providing those resources. I love the advice to poke around the system with the Browser and the Finder to find out stuff. Thanks.