exercism / pharo-smalltalk

Exercism exercises in Pharo.
https://exercism.org/tracks/pharo-smalltalk
MIT License
34 stars 28 forks source link

concepts for this track #513

Open ghost opened 2 years ago

ghost commented 2 years ago

Hello,

I think for the concepts track we can borrow the list from c# like this one : https://exercism.org/tracks/csharp/concepts

What do you both think @Bajger @gypsydave5

gypsydave5 commented 2 years ago

Good to start this one off

First off, @samWson kicked has already done some thinking around this: https://github.com/exercism/pharo-smalltalk/issues/444, and has specced out a basics concept: https://github.com/exercism/pharo-smalltalk/issues/439. Both these issues are worth a read as he also links to the definitions of concept exercises for Exercism.

His ideas of using the Ruby track concepts seems good, although it seems weird that they haven't stuck blocks down as a key Ruby concept. Really?

I really wouldn't borrow the C# list - the concepts are going to be too different as the languages are too different.

@samWson basics looks sound and echoes what's in Pharo By Example: programming in Pharo is about sending messages to objects and that's it. So that's definitely where we need to start. I also like his idea of providing supporting material from PBE and the rest of the Pharo books.

We can do this slowly, and incrementally. So what would come after objects and message passing? We could cover:


Just a note to finish: think we'd have to explain blocks before we explain conditionals in Pharo! Isn't this an amazing language?

gypsydave5 commented 2 years ago

Another thought: Pharo as a community is full of people who spend a lot of time thinking about how to teach Pharo.

gypsydave5 commented 2 years ago

Final thought: we could just rip out examples from Pharo By Example and go with them.

gypsydave5 commented 2 years ago

Whatever we do we'll need to introduce new tooling into the dev environment to create a concept exercise.

ghost commented 2 years ago

There is already a list of concepts and challenges which can be used. See here : https://github.com/exercism/v3/blob/main/reference/README.md

Bajger commented 2 years ago

Hi guys! My 2 cents here:

I agree with Dave, we don't need to create very comprehensive list of concept exercises, but start from very little things expading to more advanced details. Pharo (as direct successor of Smalltalk-80) have special unique features that might be diminished, if we will use traditional terminology used along other languages. One more note (3rd cent): Smaller content is more readable (5-10mins read), so #439 is good but already too dense (I would break down to concepts mentioned in my 2nd bullet).

ghost commented 2 years ago

can be, but that is the way the exercism maintainers want that concepts exercises looked like. Small concepts and a story which leads to a certain solution or methods.

But that is not what the users see. the users see this : https://github.com/exercism/csharp/blob/main/exercises/concept/lucians-luscious-lasagna/.docs/instructions.md

that document on #439 is too document our steps so the next maintainers or contributers know what they may change or not but we have to make such a document for every concept that we want to introduce.

Bajger commented 2 years ago

I don't understand much of your first 2 sentences. And I didn't propose any story telling. But anyway: I don't think there is any strict guideline/prescription how to prepare concepts by Exercism maintainers. It is up to us and I believe most of "Small Pharo-specific concepts" can hit one or more items in the terminology mentioned in the reference document.

ghost commented 2 years ago

What I mean is that the exercism maintainers has written guides how a concept challenge must look like. And yes, that is a list where can be chosen out from.

gypsydave5 commented 2 years ago

I think I see the tension here. @Bajger is correct; we should try to make the concepts as atomic as possible.

However, we still need them to be "big" enough to hang an exercise off. I'm not sure we could do that with something as small as sending a message - you need objects to send messages to!

Needs some thought...

SleeplessByte commented 2 years ago

@gypsydave5 we can help out with that if you want

ghost commented 2 years ago

The tension is that I think we need to use the concepts and challenges already present in exercism and David finds we have to make all the concepts and challenges ourselves. @SleeplessByte @gypsydave5 @Bajger

SleeplessByte commented 2 years ago

You don't need to use concepts already present :)

ghost commented 2 years ago

yes, but why think of something and making it when it's already present

gypsydave5 commented 2 years ago

yes, but why think of something and making it when it's already present

I think the point would be that the list of Exercism concepts and exercises are a starting point, not an exhaustive list for all languages. Take a look at the Common Lisp :heart: track; quite happy to define their own very CL specific concepts (cons cells, lambda lists) outside of the concepts suggested.

Sure, there'll be some crossover, and we can reuse some exercises. But we shouldn't feel constrained. Let's think about Pharo concepts! Then think about more general concepts, then think about some exercises - hopefully using some of the prior art in the other tracks.

ghost commented 2 years ago

I can live with that but I think concepts like learning the pharo ide is not good. One real pharo concept which I want to add is for example streams. I know no other languages which have that like Pharo have,

But if someone have a sort of list im happy to respond

gypsydave5 commented 2 years ago

I think concepts like learning the pharo ide is not good.

I agree, if only because it's hard to write an exercise around that!

Bajger commented 2 years ago

Hi guys! First of all, I don't think there is any 'tension' :) It's good to have correct discussion about how can be concept exercises approached. As explained before and from what I understood, we can have concepts tailored to Pharo (similar to Lisp) and are special in Smalltalk world. To be honest, it would be quite boring to explain "loops" "if statements" in regular way. Just an example: "Messsage sending" is key concept, where difference between "calling a function" (in mainstream OO languages) would be explained and why this important. What is Difference between Message and Method and what types of messages are implemented in Pharo, what is precedence, what is selector, etc. Such exercise can be mapped to "Duck typing" concept that is listed Exercism concepts.

However, we still need them to be "big" enough to hang an exercise off. I'm not sure we could do that with something as small as sending a message - you need objects to send messages to!

@gypsydave5 Yes - definetely Objects needs to be preceding the Message sending. (MessageSend, Message instances are objects too ;) )

ghost commented 2 years ago

of course, we have to have concepts expecially for Pharo. As far as I understand , if someone has done all the concept , he/she should be fluent in Pharo.

Maybe time to make a list of 5 concepts which a real beginner should learn.

IM thinking of

basics one where someone learned that calculations go from left to right so 2 +3 5 will be 6 5 = 30 instead of 2 + 15 = 17

message sending

string manupulation

blocks

if then. to learn that we use ifTrue and ifFalse but then the user schould first learn blocks

ghost commented 2 years ago

@gypsydave5 @Bajger no feedback ?

gypsydave5 commented 2 years ago

@gypsydave5 @Bajger no feedback ?

I'd say ...

basics one where someone learned that calculations go from left to right so 2 + 3 5 will be 6 5 = 30 instead of 2 + 15 = 17

doesn't really sound basic to me. Basic for me would be implementing a unary method that returns a constant object, which would cover message sending (and unary messages), and methods, and objects. Hey, if we can cover this as a class and an instance, we'd be covering what the blue book calls "the vocabulary with which Smalltalk is discussed":

Five words - object, message, class, instance, and method - make up the vocabulary with which Smalltalk is discussed.

Maybe that's a good measure of "basics"?


Then I'd try to cover all the flavours of message:

Then I'd introduce arithmetic as an example of binary messages, noting the evaluation order.

Then keyword messages.

And on from there to blocks (then conditionals), and another thing for strings, and then for the collections API...


"Everything is an object" is actually a quite advanced concept when you think about it... 😄

ghost commented 2 years ago

I know for solving the lasanga challenge. You need to use the message with 1 argument and the message with zero arguments.

but if you know a challenge about all kinds of messaging without the order Im happy to implement it

Bajger commented 2 years ago

"Everything is an object" is actually a quite advanced concept when you think about it... 😄

When you go to detail, then it is, however purpose of this is not to show every detail of complete Pharo/Smalltalk object model (with metaclasses), but to express main difference compared to other languages (like that there aren't any primitive types and even usual syntactic elements (like control flow) are implemented via objects and messages). Pharo MOOC goes by similar way.

If you want, I can try to prepare .md file (via PR) with initial set of basic concepts with rough description what's inside (including code snippets to be done). It is better than to discuss particular items via issue comments. You can then do review of concepts on .md file. Such .md could serve as initial source for each concept exercise.

ghost commented 2 years ago

Oke, I would say go ahead. Maybe then will be more specific.

I know most of the tracks uses a format like done in the basics challenge https://github.com/exercism/pharo-smalltalk/issues/439 and that is also the way the exercism maintainers want it

ghost commented 2 years ago

No respons. Then I think this project is dead