[vwnc] [Fwd: Self-Documenting Code Contest]

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

[vwnc] [Fwd: Self-Documenting Code Contest]

Reinout Heeck
 From c.l.s:

> FYI
> This might be a good case for Smalltalk,
>
>   http://selfexplanatorycode.blogspot.com/
>
> It is my belief that ST should do quite well.
> In any case, an interesting challenge.
>
>
> -Panu Viljamaa
>
> P.S.
> I'm not affiliated with this website
> or contest in any way, as far as I know.


I found this to be a great kata -- even if you don't
enter into the contest it is instructive and fun to spend some time on
this challenge.


R
-
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] [Fwd: Self-Documenting Code Contest]

Andres Valloud-3
Nice!  Perhaps I'll take out the (very few) comments out of Assessments
and send that in.

Andres.


Reinout Heeck wrote:

>  From c.l.s:
>  
>> FYI
>> This might be a good case for Smalltalk,
>>
>>   http://selfexplanatorycode.blogspot.com/
>>
>> It is my belief that ST should do quite well.
>> In any case, an interesting challenge.
>>
>>
>> -Panu Viljamaa
>>
>> P.S.
>> I'm not affiliated with this website
>> or contest in any way, as far as I know.
>>    
>
>
> I found this to be a great kata -- even if you don't
> enter into the contest it is instructive and fun to spend some time on
> this challenge.
>
>
> R
> -
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>  

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] [Fwd: Self-Documenting Code Contest]

Andres Valloud-3
Awww... they don't take arbitrary programs...

"Write a program that generates all two-word anagrams of the string
"documenting". Here's a word list you might want to use:
http://pragdave.pragprog.com/data/wordlist.txt."

Andres.


Andres Valloud wrote:

> Nice!  Perhaps I'll take out the (very few) comments out of
> Assessments and send that in.
>
> Andres.
>
>
> Reinout Heeck wrote:
>>  From c.l.s:
>>  
>>> FYI
>>> This might be a good case for Smalltalk,
>>>
>>>   http://selfexplanatorycode.blogspot.com/
>>>
>>> It is my belief that ST should do quite well.
>>> In any case, an interesting challenge.
>>>
>>>
>>> -Panu Viljamaa
>>>
>>> P.S.
>>> I'm not affiliated with this website
>>> or contest in any way, as far as I know.    
>>
>>
>> I found this to be a great kata -- even if you don't
>> enter into the contest it is instructive and fun to spend some time
>> on this challenge.
>>
>>
>> R
>> -
>> _______________________________________________
>> vwnc mailing list
>> [hidden email]
>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>>
>>  
>
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] [Fwd: Self-Documenting Code Contest]

Reinout Heeck
Andres Valloud wrote:
> Awww... they don't take arbitrary programs...
>
> "Write a program that generates all two-word anagrams of the string
> "documenting". Here's a word list you might want to use:
> http://pragdave.pragprog.com/data/wordlist.txt."

But that makes it so much more fun :-)

I spent almost three hours on this kata -- hardly any of that time was
used for choosing the algorithm, most of it was used to refactor for
readability for non-Smalltalkers. (You can find my entry on c.l.s. if
you are curious)


I find these exercises so rewarding because they force you to throw out
ingrained conventions.

I had this same experience a while ago when implementing the
ForceFinalization package. There I also spent quite some time to
refactor the code for readability. IIRC I ended up with four methods on
ObjectMemory that violate a couple of our 'rules' (implementaion hiding
and DRY) but this led to code that I found very beautiful and
self-explanatory.


Cheers,

Reinout
-------


>
> Andres.
>
>
> Andres Valloud wrote:
>> Nice!  Perhaps I'll take out the (very few) comments out of
>> Assessments and send that in.
>>
>> Andres.
>>
>>
>> Reinout Heeck wrote:
>>>  From c.l.s:
>>>  
>>>> FYI
>>>> This might be a good case for Smalltalk,
>>>>
>>>>   http://selfexplanatorycode.blogspot.com/
>>>>
>>>> It is my belief that ST should do quite well.
>>>> In any case, an interesting challenge.
>>>>
>>>>
>>>> -Panu Viljamaa
>>>>
>>>> P.S.
>>>> I'm not affiliated with this website
>>>> or contest in any way, as far as I know.    
>>>
>>> I found this to be a great kata -- even if you don't
>>> enter into the contest it is instructive and fun to spend some time
>>> on this challenge.
>>>
>>>
>>> R
>>> -
>>> _______________________________________________
>>> vwnc mailing list
>>> [hidden email]
>>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>>>
>>>  
>>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] [Fwd: Self-Documenting Code Contest]

Alan Knight-2
That's lovely, Reinout. I took a quick stab at it, but reflexively went and wrote a class. Yours is a lot more readable.

Of course that raises interesting questions about how self-documenting code scales up to larger programs, as well as choosing the audience that you're documenting for.

At 05:54 AM 8/6/2008, Reinout Heeck wrote:
Andres Valloud wrote:
> Awww... they don't take arbitrary programs...
>
> "Write a program that generates all two-word anagrams of the string
> "documenting". Here's a word list you might want to use:
> http://pragdave.pragprog.com/data/wordlist.txt."

But that makes it so much more fun :-)

I spent almost three hours on this kata -- hardly any of that time was
used for choosing the algorithm, most of it was used to refactor for
readability for non-Smalltalkers. (You can find my entry on c.l.s. if
you are curious)


I find these exercises so rewarding because they force you to throw out
ingrained conventions.

I had this same experience a while ago when implementing the
ForceFinalization package. There I also spent quite some time to
refactor the code for readability. IIRC I ended up with four methods on
ObjectMemory that violate a couple of our 'rules' (implementaion hiding
and DRY) but this led to code that I found very beautiful and
self-explanatory.


Cheers,

Reinout
-------


>
> Andres.
>
>
> Andres Valloud wrote:
>> Nice!  Perhaps I'll take out the (very few) comments out of
>> Assessments and send that in.
>>
>> Andres.
>>
>>
>> Reinout Heeck wrote:
>>>  From c.l.s:
>>> 
>>>> FYI
>>>> This might be a good case for Smalltalk,
>>>>
>>>>   http://selfexplanatorycode.blogspot.com/
>>>>
>>>> It is my belief that ST should do quite well.
>>>> In any case, an interesting challenge.
>>>>
>>>>
>>>> -Panu Viljamaa
>>>>
>>>> P.S.
>>>> I'm not affiliated with this website
>>>> or contest in any way, as far as I know.    
>>>
>>> I found this to be a great kata -- even if you don't
>>> enter into the contest it is instructive and fun to spend some time
>>> on this challenge.
>>>
>>>
>>> R
>>> -
>>> _______________________________________________
>>> vwnc mailing list
>>> [hidden email]
>>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>>>
>>>  
>>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

--
Alan Knight [|], Engineering Manager, Cincom Smalltalk

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] [Fwd: Self-Documenting Code Contest]

Reinout Heeck-2

The results are in, my entry ended up in fifth place.

It seems I totally failed at making it readable for non-programmers, the
one non-programmer on the jury wrote in no uncertain terms: 'I can
barely read this at all'...


http://selfexplanatorycode.blogspot.com/2008/09/results.html



R
-

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc