Monday, July 30, 2007

Why Rio?

Ever set out to write a simple little program only to find that hours or days later you have spent most of your time dealing with code that has nothing to do with the problem you were trying to solve? Ever get to that point and not even remember what you were trying to do in the first place? Ever find yourself mumbling obscenities about people who don't write documentation for their code even though you don't write documentation for your own?


The first time I saw Ruby I was in awe of her beauty -- and she was so smart! It was as if she could read my mind. I would write:

3.times { print "Hello Ruby" }

and she would print "Hello Ruby" 3 times.

She really understood me.

I had dated her older cousin Perl for several years. While Perl was resourceful, she was not much to look at. And while she tried so hard to understand things like objects, it always seemed like she was faking it. She pretended to understand them only because she knew that was what I wanted. She never really got it.

Being so enamored of Ruby I wanted to take her out in public. I was stunned to find that when I tried to have her do common tasks, like dealing with files, directories and streams, she was as clumsy as her cousin. Sometimes she acted like an object and other times she made me treat her like a function. Her I/O interface was spread across File, Dir, IO, and Pathname. Sometimes available through instance methods and other times using class methods. In many ways she reminded me of her grandfather, C. I was getting confused.

I thought the problem must be with me and decided to seek more documentation. The only thing I could find was
Why's Poignant Guide... now I was really confused.

I decided I must find a way to help Ruby be as beautiful when dealing with the public as she was with me in private; to make her Input/Output operations so simple that they would be an afterthought; so that I and others could concentrate on the problem we were trying to solve rather than mundane things like I/O. I also decided to document my work well -- with lots of examples.

I remembered a pretty dress I saw Perl wear once called IO::All. Using that as a starting point, I tried to design a gown that, when adorning Ruby's natural beauty, would make common I/O operations as simple and painless as they should be.

11 comments:

Unknown said...

Is rio dead?
The latest version I could find is almost a year old: http://github.com/wishdev/rio

rio4ruby said...

Not quite.

In January 2010 I released a version (0.4.4) that works with Ruby 1.9, but does not address the 1.9 encoding and other issues. The version currently in the rubyforge.org svn respository deals with most of the outstanding 1.9 issues, but is not ready for prime time.

Until I saw your post I was unaware of the wishdev branch. I welcome the help in getting Rio working with Ruby 1.9.

rkj said...

I dd gem install rio,

my system seems to have downloaded the rio-0.4.2

Now, while doing a simple test n a ruby file, I have the line:
require 'rio'

Doesn't work ! How do I require the library in my projects ?

My error message:
rajive-jains-computer:~/Desktop/temp/ruby rajivejain$ ruby rexample.rb
rexample.rb:1:in `require': no such file to load -- rio (LoadError)
from rexample.rb:1

My file (so simple):
require 'rio'

puts "hello rio"

Anonymous said...

[url=http://www.onlinecasinos.gd]online casino[/url], also known as uncommon casinos or Internet casinos, are online versions of commonplace ("stone and mortar") casinos. Online casinos approve gamblers to encompass up and wager on casino games from start to write 'finis' to the Internet.
Online casinos superficially submit on the market odds and payback percentages that are comparable to land-based casinos. Some online casinos navigate higher payback percentages with a modus operandi of thoughtful allude to gismo games, and some publish payout participation audits on their websites. Assuming that the online casino is using an aptly programmed indefinitely coterie generator, catalogue games like blackjack enthral warrant an established restrain edge. The payout holding voyage of ascertaining of these games are established erstwhile the rules of the game.
Uncountable online casinos hire out out in ravish or tangible their software from companies like Microgaming, Realtime Gaming, Playtech, Cosmopolitan Contrivance Technology and CryptoLogic Inc.

Anonymous said...

Іt's in fact very difficult in this busy life to listen news on Television, so I just use world wide web for that reason, and get the newest news.

Also visit my blog payday loans bad credit
My site: payday loans bad credit

Anonymous said...

It is perfect tіmе to make some planѕ for the
future anԁ it's time to be happy. I'vе rеad thіs poѕt and іf I could I ωіsh to suggеst
уou sоme іntеresting things
oг ѕuggestions. Pеrhаps you cаn write nеxt artісles гefеrring tο thiѕ artіcle.

Ι wish to rеad even morе
things abοut it!

Hеre іs my websіtе Engagement Rings

Anonymous said...

Awesome article.

Havе a looκ аt my sіte .
.. payday loans
Also see my website > payday loans

Anonymous said...

What is worth, investing for home business or On-line marketing.
These websites get in full highly-developed in the
sum of money of backlinks, its quality that counts.

In that location are trine things you Require your Online business to Throw its own.

Article marketing is a great deal Interested in your products or services, Thither
is no motivation for them to Call your website.

Here is my homepage :: Kawable.Com
Also see my website: review-electroniccigarette.com

Anonymous said...

hеllo there and thank you for your info – I hаve
certainly picked up аnything neω fгom right
here. I did howеѵer eхpertiѕe ѕeveral technicаl рoints usіng thiѕ site, as I expeгienced tο relоad thе ѕite
many tіmes preνiοus to I coulԁ get it to
load pгoperly. I had been ωondering if youг web hoѕting іs OK?
Not that Ӏ am comρlaіning, but sloω loаding
instancеs times will sometimеs аffect your
placemеnt in google and cοuld damage your high-qualitу scоre if ads and
maгkеting ωith Aԁwoгds. Anyway I'm adding this RSS to my e-mail and could look out for much more of your respective fascinating content. Make sure you update this again very soon.

my weblog ... payday loans

Anonymous said...

http://hapna.com/pre/buypropeciaonline/#19962 order propecia online - propecia 8 month results

erectile dysfunction remedies said...

Hmm is anyone else having problems with the pictures on this blog loading? I'm trying to figure out if its a problem on my end or if it's the blog. Any responses would be greatly appreciated.