[Squeakfoundation][Ann] Example group
Markus Gaelli
gaelli at emergent.de
Tue Jun 10 19:36:10 CEST 2003
Daniel Vainsencher wrote:
> (...)
> * Maybe make class comments mandatory, and implement some automated
> check for this, so I don't forget it.
>
> What do you think?
>
* Make more examples and assertions
Examples would help us to understand code and
and to write tests.
So in addition to the KernelCleaningProject (KCP) and the
MorphCleaningProject (MCP) I set up a wiki-page for an
Example group (Eg)
http://minnow.cc.gatech.edu/squeak/3248
--------------------------
Goals
Provide examples for most of the classes.
Vision
If we had examples everywhere, it would be much easier to
- test code
- understand code
- type check code
- compose new code in a test-driven style
Howto
Create a category on the class-side called *Eg-example-objects
Create your example, stored in a method exampleFoo
Send the changeset to the list as an enhancement [Enh]
Example
TextUrl class >> exampleSqueak
^self new url: 'http://www.squeak.org'
Text class >> exampleSqueakLink
^self string: 'Squeak!' attribute: TextURL exampleSqueak
TextMorph class >> exampleSqueakLink
"self exampleSqueakLink openInWorld"
^self new contents: Text exampleSqueakLink
And soon you also find out (manually though), that you are asked if
you want to open this link in a web-browser, but there is none anymore
:-/
So please, join us and let us code for making
the code more understandable and testable.
It's easy...
Cheers,
Markus
More information about the Squeakfoundation
mailing list