ivan.pavlov
1/21/2006 7:27:00 AM
Patrick, thanks for the pointer to #!/usr/bin/ruby-web , I missed this
during the installation. Well, I guess I missed all the install
instructions.
I am very new to Ruby and am just exploring different things. Rails is
far too much for my needs and I found ruby-web does exactly what I
want. I probably use like 1% of its capabilities, because all I really
need are the data submitted by the user, once I have them, all the
program flow goes through various classes which in the end return a
string cotaining the whole HTML of the page. All the logic is in the
classes and I do not need to output anything piece by piece. So, in the
end I have a string which I pass to a single Web::open block and I'm
done.
I am using templates of course; having programmed in PHP for several
years I hate plain HTML in my code, so I took probably the worse
approach - wrote a small template engine myself, for reasons described
below.
In the end, I have to say I'm beginning to like Ruby. Code is shorter
than PHP and more elegant, which does not necessarily mean it takes
less time to write but sometimes it does. My only frustration is the
lack of good documentation for the external libraries I download from
rubyforge. Most people seem to think that a hastily prepared rdoc is
enough, and that examples are not really necessary because the user has
like 5 years of Ruby experience and understatnds everything just by
looking at a method name. I am not speaking here about the core classes
and methods which are indeed very well-documented.
I know that writing documentation is a pain. But this can really speed
up adoption of the language. Good, working examlpes of something
meaningful are the best documentation.
p.s. Patrick, this entry is in no way connected to ruby-web, I got
frustrated over some other libraries, like rexml.