pharo-smalltalk icon indicating copy to clipboard operation
pharo-smalltalk copied to clipboard

Exercise to focus on constructors

Open bencoman opened this issue 5 years ago • 2 comments

Saw this comment from a newcomer on Discord...

Delphi did have constructors more similar to Smalltalk than Java. Didn't have a silly special "new" keyword.. it was a method on the class itself.

I see a few people respond with "just use a class-side method", but I think newcomers often miss the distinction and such comments fly by without sticking. It might be good to have an exercise focused specifically on analogies to "constructors" as people understand them in other languages.

Could it be said that the "instance creation" class-side protocol is equivalent to "constructors" ?

Possible reference cases:

Rectangle
Delay
Month
Color

bencoman avatar Jun 21 '19 02:06 bencoman