Re: [Pharo-users] Pharo Quality Rules for Beginners
On Wed, 15 Jan 2020 at 17:41, ESTEBAN VILLALOBOS DIAZ via Pharo-users <pharo-users@lists.pharo.org> wrote:
Hello everyone!
My name is Esteban and I will be working on the Pharo Quality Rules for the next few months. The goal is to create different profiles for the rules according to the programming experience of the user. For example, for the beginner profile we would like to check for common mistakes made by people who are just starting with Pharo like:
Sending self as a message (probably because they forgot a . ) Using False instead of false etc..
I would appreciate it if you could share with me other common mistakes that you have seen beginners do, or maybe tell me a bit of your own experience when you started using Pharo :)
- Getting confused between instance-side and class-side, mixing up which side methods are on. When getting a DNU maybe check if that message is known on the class-side. - leaving out the end of statement trailing dot. An error message like "Blah doesn't understand self" is a bit complex for a beginner to decipher. cheers -ben
On 16 January 2020 at 14.20.03, Ben Coman (btc@openinworld.com) wrote: An error message like "Blah doesn't understand self" is a bit complex for a beginner to decipher. I would like to second this one! If you want to have *beginners mode*, I think you need to include run-time aspects as well as Ben mentions. It should be possible to put the general doesNotUnderstand in a beginners mode, which checks for these cases - messages send to nil, explaining what is the likely cause(s). - the case mentioned by Ben - check if the message is understood by the class or object (several have mentioned the class/object side issue). - check which classes implements the method which was sent, and perhaps even suggest to open the implementers browser Good luck with the project! Best, Kasper
Hello Esteban Some of the most common mistakes I made as a beginner and from seeing other beginners are (in no particular order): 1. Not learning to use the collections properly. In other words, not knowing the appropriate ones (OrderedCollection vs Array vs Dictionary vs String etc) and the messages that they understand. 2. Not using or not using the collections iterators properly (#select:/#reject:, #collect:, #inject:into:, #detect:, #do:, etc). 3. Not using or not using streams properly. 4. Concatenating strings where one or more substrings has a "'" (single quote) in it. 5. Adding things to a collection in a loop but forgetting to add a #yourself at the end (e.g., aCollection do: [ :each | anotherCollection add: each ]). 6. Writing large methods. 7. Abuse of inheritance. When teaching other people Smalltalk, I always recommend they look at Kent Beck's "Smalltalk Best Practise Patterns" and Klimas et als "Smalltalk with Style". Vince -----Original Message----- From: Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] On Behalf Of Ben Coman Sent: Thursday, 16 January 2020 11:19 PM To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Cc: Pharo Development List <pharo-dev@lists.pharo.org> Subject: Re: [Pharo-users] Pharo Quality Rules for Beginners EXTERNAL: Do not click links or open attachments if you do not recognize the sender. On Wed, 15 Jan 2020 at 17:41, ESTEBAN VILLALOBOS DIAZ via Pharo-users <pharo-users@lists.pharo.org> wrote:
Hello everyone!
My name is Esteban and I will be working on the Pharo Quality Rules for the next few months. The goal is to create different profiles for the rules according to the programming experience of the user. For example, for the beginner profile we would like to check for common mistakes made by people who are just starting with Pharo like:
Sending self as a message (probably because they forgot a . ) Using False instead of false etc..
I would appreciate it if you could share with me other common mistakes that you have seen beginners do, or maybe tell me a bit of your own experience when you started using Pharo :)
- Getting confused between instance-side and class-side, mixing up which side methods are on. When getting a DNU maybe check if that message is known on the class-side. - leaving out the end of statement trailing dot. An error message like "Blah doesn't understand self" is a bit complex for a beginner to decipher. cheers -ben
participants (3)
-
Ben Coman -
Kasper Ãsterbye -
Vince Refiti