Proposal: Secrets of the standard library

4 views
Skip to first unread message

Paul Battley

unread,
Nov 10, 2009, 5:12:09 PM11/10/09
to Ruby Manor
There are a bunch of useful classes and methods in the standard
library (and even in the core in some cases) that seem to be
overlooked often, but which may help to solve problems just a little
bit more easily or elegantly.

For example:

Forwardable
Set
Array#assoc
pp

I can think up about seven or eight off the top of my head, and I'm
sure that other people will have suggestions of their own which I
could also work in.

Does that sound interesting?
Paul.

James Adam

unread,
Nov 10, 2009, 6:15:30 PM11/10/09
to ruby-...@googlegroups.com

Yes, yes and thrice yes. I keep hitting objects that need to delegate
some part of their behaviour to another one, and I keep setting the
delegation up manually. I know there is a std lib for this, but I need
it to be thrown solidly into my face before it's really going to stick.

I think there could be a rock solid short presentation in this. Or, if
you built it around a narrative - lets say a warrior prince trying to
return home to his bethrothed, after the crusades, and discovering the
riches of the Ruby Standard Library on the way - then it could almost
certainly be longer.

Yep, sounds good. I'll have a spelunk around for some other core
libraries that could do with some exposure.

- James

Tom Lea

unread,
Nov 10, 2009, 6:33:56 PM11/10/09
to ruby-...@googlegroups.com

Paul teaches you to write ruby (because you didn't pay attention first time). Look forward to it.

If you are doing the narrative, as suggested by JA, can you do it in costume?

Or possibly in "here is some cool code", "here is how ruby already did it for me", "here is what I could have done in the time I wasted writing all that code" triples?
 


edavey

unread,
Nov 11, 2009, 6:48:13 AM11/11/09
to Ruby Manor
Yes to secrets of the standard library.

What about Find and File::Stat? - they have some useful methods.

and yes to Paul doing it - always enjoy his presentations.

Ed

On Nov 10, 11:33 pm, Tom Lea <goo...@tomlea.co.uk> wrote:

Matt Westcott

unread,
Nov 12, 2009, 6:17:22 PM11/12/09
to Ruby Manor
On Nov 10, 10:12 pm, Paul Battley <pbatt...@gmail.com> wrote:
> There are a bunch of useful classes and methods in the standard
> library (and even in the core in some cases) that seem to be
> overlooked often, but which may help to solve problems just a little
> bit more easily or elegantly.
[...]
> Does that sound interesting?

Definitely. A couple of weeks back I stumbled upon the Generator class
for the first time while stuck on a messy problem with iterators, and
it was one of those moments of enlightenment on the path to becoming a
better coder - just the sort of thing I'd most like to gain from a
conference like this.

- for that matter, if Generator isn't on Paul's list then I would
gladly do an 8-minute slot on the project in question <http://
matt.west.co.tt/music/midibeep/> - while it was just a toy project
really, I think it would make a good self-contained case study in why
you might want to use Generator. And it's reassuringly non-webby and
has a certain amount of geek-porn appeal too...

- Matt

Roland Swingler

unread,
Nov 16, 2009, 8:02:18 AM11/16/09
to Ruby Manor
If you'd be willing to cover Array#pack and String#unpack that would
be welcome. They confuse me.

Roland

On Nov 10, 10:12 pm, Paul Battley <pbatt...@gmail.com> wrote:

Murray Steele

unread,
Nov 16, 2009, 4:22:24 PM11/16/09
to ruby-...@googlegroups.com
The standard library is huge, so any time anyone suggests going in and
mining some nuggets of know for me I'm all for it. As we saw with Tom
Stuart's talk on enumerators a couple of LRUG's ago, there's always
something we can all learn. That said, it's a broad subject, and
there's the differences that ruby 1.9 brings to consider too.

I'd like someone to explain if there is a difference between
Forwardable and Delegate and why use one over the other.
Date vs. Time vs. DateTime
I'd definintely be keen to hear about Generator

I'm sure there are more, I just don't know what they are!

2009/11/16 Roland Swingler <roland....@gmail.com>:

Nasir

unread,
Nov 17, 2009, 2:47:10 AM11/17/09
to ruby-...@googlegroups.com
+1

Thats definitely useful, always good to recap std lib and learn new stuff on the way. I don't have any preference on what to cover or leave as there are more than enough classes/modules in std lib that can be interesting to most people in the audience.

Nas

botanicus

unread,
Nov 17, 2009, 9:35:52 AM11/17/09
to Ruby Manor
Definitely! There is still quite a lot of things many rubyists
(include myself) don't know.

Jakub Stastny
http://twitter.com/botanicus

On Nov 17, 7:47 am, Nasir <nas35...@yahoo.com> wrote:
> +1
>
> Thats definitely useful, always good to recap std lib and learn new stuff on the way. I don't have any preference on what to cover or leave as there are more than enough classes/modules in std lib that can be interesting to most people in the audience.
>
> Nas
>
>
>
> ----- Original Message -----
> From: "Murray Steele" <murray.ste...@gmail.com>
> To: ruby-...@googlegroups.com
> Sent: Monday, November 16, 2009 9:22:24 PM GMT +00:00 GMT Britain, Ireland, Portugal
> Subject: [Ruby Manor] Re: Proposal: Secrets of the standard library
>
> The standard library is huge, so any time anyone suggests going in and
> mining some nuggets of know for me I'm all for it.  As we saw with Tom
> Stuart's talk on enumerators a couple of LRUG's ago, there's always
> something we can all learn.  That said, it's a broad subject, and
> there's the differences that ruby 1.9 brings to consider too.
>
> I'd like someone to explain if there is a difference between
> Forwardable and Delegate and why use one over the other.
> Date vs. Time vs. DateTime
> I'd definintely be keen to hear about Generator
>
> I'm sure there are more, I just don't know what they are!
>
> 2009/11/16 Roland Swingler <roland.swing...@gmail.com>:

alan

unread,
Nov 19, 2009, 6:28:09 PM11/19/09
to Ruby Manor
+1

On 17 Nov, 14:35, botanicus <stas...@101ideas.cz> wrote:
> Definitely! There is still quite a lot of things many rubyists
> (include myself) don't know.
>
> Jakub Stastnyhttp://twitter.com/botanicus
Reply all
Reply to author
Forward
0 new messages