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. |
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 <[hidden email]> 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. |
- class methods are sent to class
- the corresponding method is lookup in the class of the receiver for example Date now now is looked up in the class of Date => Date class Stef On Sat, Jul 22, 2017 at 1:29 PM, Stephane Ducasse <[hidden email]> wrote: > 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 <[hidden email]> 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. |
In reply to this post by Stephane Ducasse-3
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:[hidden email]] On Behalf Of Stephane Ducasse Sent: July 22, 2017 7:30 To: Any question about pharo is welcome <[hidden email]> 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 <[hidden email]> 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. |
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 <[hidden email]> 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:[hidden email]] On Behalf Of Stephane Ducasse > Sent: July 22, 2017 7:30 > To: Any question about pharo is welcome <[hidden email]> > 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 <[hidden email]> 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. > > > |
Hello michel
I checked and we introduced them (without explaining them) in W1S6 On Sat, Jul 22, 2017 at 3:50 PM, Stephane Ducasse <[hidden email]> 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 <[hidden email]> 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:[hidden email]] On Behalf Of Stephane Ducasse >> Sent: July 22, 2017 7:30 >> To: Any question about pharo is welcome <[hidden email]> >> 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 <[hidden email]> 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. >> >> >> |
In reply to this post by Stephane Ducasse-3
The TinyBlog example would still be very useful without. In TBPost, you have class methods only as shortcuts to create instances with data (TBPost class >> title: text: for instance). In TBBlog, you implemented the notion of 'single instance' in week2, which required the class methods. You could just push that later, after the appropriate lessons. Everything else is excellent without the class methods.
Oh, and in passing, I'd like to say how much I appreciate the fact that testing is shown to be an integral part of the process (TDD). The MOOC shows us how we can write tests before the actual methods being tested and how we can then use the debugger's Create button to create the wished-for method. I love that. -----Original Message----- From: Pharo-users [mailto:[hidden email]] On Behalf Of Stephane Ducasse Sent: July 22, 2017 9:51 To: Any question about pharo is welcome <[hidden email]> Subject: Re: [Pharo-users] Pharo MOOC: Difference between class methods and instance methods 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 <[hidden email]> 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-M > odelExtensionTests-FR.pdf ) > > > -----Original Message----- > From: Pharo-users [mailto:[hidden email]] On > Behalf Of Stephane Ducasse > Sent: July 22, 2017 7:30 > To: Any question about pharo is welcome <[hidden email]> > 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 <[hidden email]> 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. > > > |
In reply to this post by Stephane Ducasse-3
You're right. I forgot between the lesson and the exercise. My bad.
-----Original Message----- From: Pharo-users [mailto:[hidden email]] On Behalf Of Stephane Ducasse Sent: July 22, 2017 9:56 To: Any question about pharo is welcome <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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:[hidden email]] On >> Behalf Of Stephane Ducasse >> Sent: July 22, 2017 7:30 >> To: Any question about pharo is welcome <[hidden email]> >> 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 <[hidden email]> 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. >> >> >> |
Thanks
I love so much test first and creating everything automatically from there. We should continue to build on that. I'm working on - a new version of the mooc and may be I will change this. - a new book on Object-Oriented Programming with TDD if you want to read it I will restart to work on it as soon as I finish the lecture slides. Stef On Sat, Jul 22, 2017 at 4:37 PM, Michel Marinier <[hidden email]> wrote: > You're right. I forgot between the lesson and the exercise. My bad. > > -----Original Message----- > From: Pharo-users [mailto:[hidden email]] On Behalf Of Stephane Ducasse > Sent: July 22, 2017 9:56 > To: Any question about pharo is welcome <[hidden email]> > 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 <[hidden email]> 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 <[hidden email]> 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:[hidden email]] On >>> Behalf Of Stephane Ducasse >>> Sent: July 22, 2017 7:30 >>> To: Any question about pharo is welcome <[hidden email]> >>> 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 <[hidden email]> 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. >>> >>> >>> > > > |
Free forum by Nabble | Edit this page |