Hacker News new | ask | show | jobs
by skitter 1283 days ago
> There are so many Ruby features built in to the language itself. In the very first episode of this series, we dove deep into the internals of one such gem bundled with Ruby's standard library: IRB. Keeping on theme, I'd like to take some time to explore some other areas of Ruby's source.

From that introduction I though this would be about different parts of the standard library, but it's about files from the example folder. In how far are these built in?

1 comments

> I though this would be about different parts of the standard library, but it's about files from the example folder.

All of the examples given use only the standard lib, afaict.

Yet there's almost no real discussion of how to use the standard library here, and a lot of talking about example code that's mostly useless (seriously - why is biorhythm pseudoscience #2, and how is displaying a calendar on the CLI going to help me...?)

I agree with the top post - I have a very different idea about what "built-in" means than the author of this article.

> seriously - why is biorhythm pseudoscience #2

It's an interactive tutorial on using the `Date` and `OptionParser` classes and printing stuff to stdout.

> and how is displaying a calendar on the CLI going to help me

It's an interactive tutorial on using the `Date` and `GetoptLong` classes and printing stuff to stdout :)

And that's fine. But that topic in the article is not Date/OptionParser/GetOptLong - it's

"This week I'm sharp-as-a-tack, and slow and sad as a sack. Here's to next week!"

and I don't see any value add above linking to examples (not built-ins).

Ex - why not explore OptionParser (the actual built-in!) - and compare to ARGV, or contrast with gets.chomp. Or explain how similar the concept is to something like Yargs from the node side.

Also, as a personal aside - I don't really see a bunch of custom formatted printf statements with no attempt at explanation a very good example at all.

> how is displaying a calendar on the CLI going to help me

How is displaying "Hello world" on the CLI going to help me?