Starting to add class comment and test on BlElements

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Starting to add class comment and test on BlElements

stepharo
Hi blockers and alek in particular,

the code is cool and I like that each method is commented.
I'm starting to write a real class comment that we will be able to use
in a documentation. But I cannot run the example
so this is difficult to write tests.
So Alek how do you know that you make progress?
Where should I start? I thought BlElement was the starting point.

Side note:
Now I wonder if we want to have all the assert:
May be yes and we should have an opal plugin to turn them off after.


allChildrenDo: aBlock
     "Evaluate aBlock for all my children gathered recursively
(excluding the receiver).
     aBlock must not be nil.
     aBlock must accept exactly one argument"

     self assert: aBlock isNotNil.
     self assert: aBlock argumentCount = 1.
     self
         childrenDo:
             [ :child |
             aBlock value: child.
             child allChildrenDo: aBlock ]

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Starting to add class comment and test on BlElements

Glenn Cavarlé
Hi Stef,

Yes, BlElement is the starting point, i think so.
All examples in BlElement run for me, do you have some errors ?
On my side, i'm starting to write examples using layouts.

We can talk about the performances issue later (if asserts really have an impact on) , when the first stable version will be released.
But for now, i think using asserts is a good choice to make things clear and to help the understanding and the documentation (same for the <return> pragma).

Glenn.
Glenn Cavarlé
Reply | Threaded
Open this post in threaded view
|

Re: Starting to add class comment and test on BlElements

stepharo
Oh excellent
I think that I forgot to jump into a bloc world.
So this means that I can now turn some examples into tests.



Le 24/2/16 10:21, Glenn Cavarlé a écrit :

> Hi Stef,
>
> Yes, BlElement is the starting point, i think so.
> All examples in BlElement run for me, do you have some errors ?
> On my side, i'm starting to write examples using layouts.
>
> We can talk about the performances issue later (if asserts really have an
> impact on) , when the first stable version will be released.
> But for now, i think using asserts is a good choice to make things clear and
> to help the understanding and the documentation (same for the <return>
> pragma).

Yes this is my feeling too.

>
> Glenn.
>
>
>
> -----
> Glenn Cavarlé
> --
> View this message in context: http://forum.world.st/Starting-to-add-class-comment-and-test-on-BlElements-tp4879800p4880193.html
> Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Starting to add class comment and test on BlElements

Sean P. DeNigris
Administrator
In reply to this post by Glenn Cavarlé
IMHO if we keep the asserts, we should at least remove the duplication of repeating them in the comments. This will be a maintenance headache with little to no value added.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Starting to add class comment and test on BlElements

Aliaksei Syrel
Documentation != checking of contract.
All assertions can be removed from code easily with simple script when bloc will be released (or another solution will be found). Assertions really slowdown everything.
Until version 1.0 bloc will have assertion and duplication in documentation.

Cheers,
Alex
Reply | Threaded
Open this post in threaded view
|

Re: Starting to add class comment and test on BlElements

stepharo
+1

Stef

Le 5/3/16 18:59, Aliaksei Syrel a écrit :
> Documentation != checking of contract.
> All assertions can be removed from code easily with simple script when
> bloc will be released (or another solution will be found). Assertions
> really slowdown everything.
> Until version 1.0 bloc will have assertion and duplication in
> documentation.
>
> Cheers,
> Alex


Reply | Threaded
Open this post in threaded view
|

Re: Starting to add class comment and test on BlElements

EstebanLM
+1

> On 06 Mar 2016, at 09:09, stepharo <[hidden email]> wrote:
>
> +1
>
> Stef
>
> Le 5/3/16 18:59, Aliaksei Syrel a écrit :
>> Documentation != checking of contract.
>> All assertions can be removed from code easily with simple script when bloc will be released (or another solution will be found). Assertions really slowdown everything.
>> Until version 1.0 bloc will have assertion and duplication in documentation.
>>
>> Cheers,
>> Alex
>
>