[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

perl and the culture of libraries

Martin DeMello

8/5/2008 12:56:00 PM

http://blog.jrock.us/articles/You%20are%20missing%20the%20point%20of%...

Great article on perl and cpan. I was all ready to say "yeah, ruby has
libraries too - maybe not the tens of thousands cpan has, but i can
usually find what i want" until I read this paragraph:

The important thing about Perl is that we have a culture of writing
good libraries. No Perl programmer would write a few lines of code,
post it to a blog, and call it a "library". Everyone feels obligated
to create a CPAN distribution, with documentation (sometimes a bit on
the minimal side, but not everyone is a writer), a test suite, a
Makefile, etc. I'm not sure why, but this always happens. I think it's
because there is a strong convention, and tools that make following
the convention easy.

He's right - there really is nothing in the ruby culture/toolset that
encourages everything shared to be *properly* shared. Hoe and friends
[http://nubyonrails.com/articles/tutorial-publishing-rubygem...]
are a great step forward, but their use doesn't seem to be widespread
yet. At the very least, an interesting thing to ponder.

Some ideas I had:

1. rubyforge should encourage an ecosystem of scripts that works with
it; right now I can't even *find* such scripts other than via "gem
search" (I've filed a suggestion with rubyforge about this).
2. a majority of the projects on rubyforge (mine included, i admit)
have no documentation. on the other hand, the *landing page* of a cpan
project is the documentation. rubyforge's default landing page seems
to contain a lot of information that seems more suited to a sidebar.
3. perhaps rubygems could support commands like "gem readme", "gem
changelog", "gem todo" and "gem examples" to encourage people to fill
in such documentation where appropriate

martin

58 Answers

Peter Fitzgibbons

8/5/2008 1:04:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

I'm on board.
Where do we start ?

Re-face RubyForge to apply the changes you suggest? Who's maintainer for
RubyForge ?

Peter Fitzgibbons
(847) 687-7646
Email: peter.fitzgibbons@gmail.com
IM GTalk: peter.fitzgibbons
IM Yahoo: pjfitzgibbons
IM MSN: pjfitzgibbons@hotmail.com
IM AOL: peter.fitzgibbons@gmail.com


On Tue, Aug 5, 2008 at 7:56 AM, Martin DeMello <martindemello@gmail.com>wrote:

>
> http://blog.jrock.us/articles/You%20are%20missing%20the%20point%20of%...
>
> Great article on perl and cpan. I was all ready to say "yeah, ruby has
> libraries too - maybe not the tens of thousands cpan has, but i can
> usually find what i want" until I read this paragraph:
>
> The important thing about Perl is that we have a culture of writing
> good libraries. No Perl programmer would write a few lines of code,
> post it to a blog, and call it a "library". Everyone feels obligated
> to create a CPAN distribution, with documentation (sometimes a bit on
> the minimal side, but not everyone is a writer), a test suite, a
> Makefile, etc. I'm not sure why, but this always happens. I think it's
> because there is a strong convention, and tools that make following
> the convention easy.
>
> He's right - there really is nothing in the ruby culture/toolset that
> encourages everything shared to be *properly* shared. Hoe and friends
> [http://nubyonrails.com/articles/tutorial-publishing-rubygem...]
> are a great step forward, but their use doesn't seem to be widespread
> yet. At the very least, an interesting thing to ponder.
>
> Some ideas I had:
>
> 1. rubyforge should encourage an ecosystem of scripts that works with
> it; right now I can't even *find* such scripts other than via "gem
> search" (I've filed a suggestion with rubyforge about this).
> 2. a majority of the projects on rubyforge (mine included, i admit)
> have no documentation. on the other hand, the *landing page* of a cpan
> project is the documentation. rubyforge's default landing page seems
> to contain a lot of information that seems more suited to a sidebar.
> 3. perhaps rubygems could support commands like "gem readme", "gem
> changelog", "gem todo" and "gem examples" to encourage people to fill
> in such documentation where appropriate
>
> martin
>
>

Martin DeMello

8/5/2008 1:23:00 PM

0

On Tue, Aug 5, 2008 at 6:04 AM, Peter Fitzgibbons
<peter.fitzgibbons@gmail.com> wrote:
> I'm on board.
> Where do we start ?

I think a minimally invasive beginning would be a documentation
skeleton generator. Rdoc is wonderful for what it does, but it doesn't
provide much "convention-over-configuration" support for
non-source-code-based documentation, and if Rails has done anything,
it has proven the value of a good set of conventions.

martin

Peter Fitzgibbons

8/5/2008 1:32:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

Sounds like some changes to rubygems and it's toolset.

Peter Fitzgibbons
(847) 687-7646
Email: peter.fitzgibbons@gmail.com
IM GTalk: peter.fitzgibbons
IM Yahoo: pjfitzgibbons
IM MSN: pjfitzgibbons@hotmail.com
IM AOL: peter.fitzgibbons@gmail.com


On Tue, Aug 5, 2008 at 8:23 AM, Martin DeMello <martindemello@gmail.com>wrote:

> On Tue, Aug 5, 2008 at 6:04 AM, Peter Fitzgibbons
> <peter.fitzgibbons@gmail.com> wrote:
> > I'm on board.
> > Where do we start ?
>
> I think a minimally invasive beginning would be a documentation
> skeleton generator. Rdoc is wonderful for what it does, but it doesn't
> provide much "convention-over-configuration" support for
> non-source-code-based documentation, and if Rails has done anything,
> it has proven the value of a good set of conventions.
>
> martin
>
>

Martin DeMello

8/5/2008 1:52:00 PM

0

On Tue, Aug 5, 2008 at 6:31 AM, Peter Fitzgibbons
<peter.fitzgibbons@gmail.com> wrote:
> Sounds like some changes to rubygems and it's toolset.

Not really. For instance, if I had a small program, doc_init.rb, that
simply spat out a file project-doc.txt that had the following
----------------------------------------------
Project Name:

Authors:

Short Description:

Long Description:

Usage:

Notes:

----------------------------------------------

it would (a) kickstart the documentation process and (b) give other
tools a standard set of headings to look for (c) give authors a
psychological incentive to include those sections in their
documentation (all of which are useful). Once this achieves a critical
mass, we can ask the rubyforge maintainers to consider looking for a
project-doc.txt in projects and make that the landing page. That in
turn will make sure people who submit to rubyforge include such a
file. It just requires a bit of initial buy-in.

martin

Peter Fitzgibbons

8/5/2008 2:05:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

Isn't it true, though, that rubygems are the defacto distribution model for
projects in RubyForge ?
If so, then, like packaging a CPAN .tgz that includes the ./t, ./doc, ./lib
and Makefile.pl,
the "default" gem hierarchy created/expected by the gem tools should also
have ./test, ./doc, and ./lib directories

Also, I seem to recall that although many (most?) projects on CPAN include
the usual-suspect titles in the documentation
(Name, Synopsis, Description...), those titles really are purely cultural,
there is nothing in POD spec that declares what the
title should be... just "convention"

A lot of this has to do with the 25yrs of history w/ Perl vs the 12yrs
history w/ Ruby. 12 years is a long time... but seems to me
a short time in social-cultural development.

Your thoughts ?

Peter Fitzgibbons
(847) 687-7646
Email: peter.fitzgibbons@gmail.com
IM GTalk: peter.fitzgibbons
IM Yahoo: pjfitzgibbons
IM MSN: pjfitzgibbons@hotmail.com
IM AOL: peter.fitzgibbons@gmail.com


On Tue, Aug 5, 2008 at 8:52 AM, Martin DeMello <martindemello@gmail.com>wrote:

> On Tue, Aug 5, 2008 at 6:31 AM, Peter Fitzgibbons
> <peter.fitzgibbons@gmail.com> wrote:
> > Sounds like some changes to rubygems and it's toolset.
>
> Not really. For instance, if I had a small program, doc_init.rb, that
> simply spat out a file project-doc.txt that had the following
> ----------------------------------------------
> Project Name:
>
> Authors:
>
> Short Description:
>
> Long Description:
>
> Usage:
>
> Notes:
>
> ----------------------------------------------
>
> it would (a) kickstart the documentation process and (b) give other
> tools a standard set of headings to look for (c) give authors a
> psychological incentive to include those sections in their
> documentation (all of which are useful). Once this achieves a critical
> mass, we can ask the rubyforge maintainers to consider looking for a
> project-doc.txt in projects and make that the landing page. That in
> turn will make sure people who submit to rubyforge include such a
> file. It just requires a bit of initial buy-in.
>
> martin
>
>

Martin DeMello

8/5/2008 2:15:00 PM

0

On Tue, Aug 5, 2008 at 7:05 AM, Peter Fitzgibbons
<peter.fitzgibbons@gmail.com> wrote:
> Isn't it true, though, that rubygems are the defacto distribution model for
> projects in RubyForge ?
> If so, then, like packaging a CPAN .tgz that includes the ./t, ./doc, ./lib
> and Makefile.pl,
> the "default" gem hierarchy created/expected by the gem tools should also
> have ./test, ./doc, and ./lib directories

Yeah, but *expecting* it is a pretty disruptive change. it's hard to
do it incrementally. having hoe create a structure like that wouldn't
be a bad idea, though.

> Also, I seem to recall that although many (most?) projects on CPAN include
> the usual-suspect titles in the documentation
> (Name, Synopsis, Description...), those titles really are purely cultural,
> there is nothing in POD spec that declares what the
> title should be... just "convention"

However, since Perl has settled on said usual-suspect titles, we might
as well take advantage of their experience and adopt them wholesale :)
Again, it wouldn't be something that, say, the gemspec enforces - all
I want to do is provide a tool to make adding those sections the path
of least resistance.

> A lot of this has to do with the 25yrs of history w/ Perl vs the 12yrs
> history w/ Ruby. 12 years is a long time... but seems to me
> a short time in social-cultural development.

Very true. Nothing says we can't stand on the shoulders of the perl
giants, though :)

martin

Shadowfirebird

8/5/2008 2:44:00 PM

0

I don't wish to be critical (I really don't! That's not just a way of
opening a sentence!) but in my experience there's very little
documentation in Ruby at all. And I'm not convinced that having a
little form with each gem giving the name of the author and a brief
description of what it does is going to help that much. Authors that
want to include that are already finding ways of including it in the
rdoc, usually in some sort of 'readme' entry.

To forestall criticism of my comment:

1) Yes, I'm aware that there are any number of excellent books to buy,
but a FOSS language needs good FOSS documentation.

2) Yes, I'm aware of the pickaxe, obviously. It's a first-class (pun
intended) introduction to the language. And the poignant guide. But
apart from that, where are the websites with tutorials in the
medium-to-advanced level? Where's the wiki that takes you through all
the gotchas and special features of Ruby?* Other languages have them.

3) Yes, I'm aware of rdoc. But I'm sorry, that's not really
documentation. It's just a way of reading the comments without having
to wade through the code. For some people, it's all that is needed.
But for others it's just confusing.

4) Yes, I'm aware I'm feeling very cranky today. Sorry.

I'm really not trying to pick holes in Ruby. I'm just saying that if
you want to document a gem, you need to write a coherent guide
explaining what it does and pointing out the more common options, with
a couple of tutorials. Writing documentation isn't easy, of course,
and worse, it takes different skills to writing code. But, it's not
something that can be skipped.

Shadowfirebird.

* Okay, we know where that last one is: under 10 feet of spam. Still.

On Tue, Aug 5, 2008 at 3:14 PM, Martin DeMello <martindemello@gmail.com> wrote:
> On Tue, Aug 5, 2008 at 7:05 AM, Peter Fitzgibbons
> <peter.fitzgibbons@gmail.com> wrote:
>> Isn't it true, though, that rubygems are the defacto distribution model for
>> projects in RubyForge ?
>> If so, then, like packaging a CPAN .tgz that includes the ./t, ./doc, ./lib
>> and Makefile.pl,
>> the "default" gem hierarchy created/expected by the gem tools should also
>> have ./test, ./doc, and ./lib directories
>
> Yeah, but *expecting* it is a pretty disruptive change. it's hard to
> do it incrementally. having hoe create a structure like that wouldn't
> be a bad idea, though.
>
>> Also, I seem to recall that although many (most?) projects on CPAN include
>> the usual-suspect titles in the documentation
>> (Name, Synopsis, Description...), those titles really are purely cultural,
>> there is nothing in POD spec that declares what the
>> title should be... just "convention"
>
> However, since Perl has settled on said usual-suspect titles, we might
> as well take advantage of their experience and adopt them wholesale :)
> Again, it wouldn't be something that, say, the gemspec enforces - all
> I want to do is provide a tool to make adding those sections the path
> of least resistance.
>
>> A lot of this has to do with the 25yrs of history w/ Perl vs the 12yrs
>> history w/ Ruby. 12 years is a long time... but seems to me
>> a short time in social-cultural development.
>
> Very true. Nothing says we can't stand on the shoulders of the perl
> giants, though :)
>
> martin
>
>



--
All you can do is try to know who your friends are as you head off to
the war / Pick a star on the dark horizon and follow the light

Avdi Grimm

8/5/2008 2:46:00 PM

0

On Tue, Aug 5, 2008 at 8:56 AM, Martin DeMello <martindemello@gmail.com> wrote:
> The important thing about Perl is that we have a culture of writing
> good libraries. No Perl programmer would write a few lines of code,
> post it to a blog, and call it a "library". Everyone feels obligated
> to create a CPAN distribution, with documentation (sometimes a bit on
> the minimal side, but not everyone is a writer), a test suite, a
> Makefile, etc. I'm not sure why, but this always happens. I think it's
> because there is a strong convention, and tools that make following
> the convention easy.

I've always liked the Perl documentation conventions. Particularly
the fact that *every* CPAN manpage starts with a Synopsis which
demonstrates the essential usage of the library in a few lines of
code.

--
Avdi

Home: http:...
Developer Blog: http:.../devblog/
Twitter: http://twitte...
Journal: http://avdi.livej...

Martin DeMello

8/5/2008 2:55:00 PM

0

On Tue, Aug 5, 2008 at 7:43 AM, Shadowfirebird <shadowfirebird@gmail.com> wrote:
> I don't wish to be critical (I really don't! That's not just a way of
> opening a sentence!) but in my experience there's very little
> documentation in Ruby at all. And I'm not convinced that having a
> little form with each gem giving the name of the author and a brief
> description of what it does is going to help that much. Authors that
> want to include that are already finding ways of including it in the
> rdoc, usually in some sort of 'readme' entry.

[...]

> 3) Yes, I'm aware of rdoc. But I'm sorry, that's not really
> documentation. It's just a way of reading the comments without having
> to wade through the code. For some people, it's all that is needed.
> But for others it's just confusing.

You can't have it both ways :) And this is indeed the specific problem
I would like to address - rdoc is too tied into the code, and a readme
file isn't structured enough to get past the blank canvas effect -
it's a mental effort to decide what to put into it.

martin

Shadowfirebird

8/5/2008 3:25:00 PM

0

_Why does a good job of this sort of thing, when he nails the syntax
of, say Hpricot or sqlite in a couple of pages. Really I think that
is the sort of thing that we should be aiming towards.

http://whytheluckystiff.net/articles/aQuickGuideToS...

On Tue, Aug 5, 2008 at 3:54 PM, Martin DeMello <martindemello@gmail.com> wrote:
> On Tue, Aug 5, 2008 at 7:43 AM, Shadowfirebird <shadowfirebird@gmail.com> wrote:
>> I don't wish to be critical (I really don't! That's not just a way of
>> opening a sentence!) but in my experience there's very little
>> documentation in Ruby at all. And I'm not convinced that having a
>> little form with each gem giving the name of the author and a brief
>> description of what it does is going to help that much. Authors that
>> want to include that are already finding ways of including it in the
>> rdoc, usually in some sort of 'readme' entry.
>
> [...]
>
>> 3) Yes, I'm aware of rdoc. But I'm sorry, that's not really
>> documentation. It's just a way of reading the comments without having
>> to wade through the code. For some people, it's all that is needed.
>> But for others it's just confusing.
>
> You can't have it both ways :) And this is indeed the specific problem
> I would like to address - rdoc is too tied into the code, and a readme
> file isn't structured enough to get past the blank canvas effect -
> it's a mental effort to decide what to put into it.
>
> martin
>
>



--
All you can do is try to know who your friends are as you head off to
the war / Pick a star on the dark horizon and follow the light