Lost in "=", forest searching for methods of abstraction (bad habits die hard)

Hello,

I have done few years of programming in Clipper and few more in MS
Access (experience not worth repeating).

Since then I have being using ruby (sporadically and not for big
projects), but with a bad style (I recognised this, when trying to
write something bigger).

When I see projects like rspec, sequel and ramaze, I am amazed what is
possible with ruby.

The question is, what concepts are necessary to grasp to be able to
create something like that (in ruby), and, is there a good read
(preferably on-line) about them?

Vlad

Vladimir K. wrote:

The question is, what concepts are necessary to grasp to be able to
create something like that (in ruby), and, is there a good read
(preferably on-line) about them?

Vlad

Some of the most interesting things about projects like rspec are their
DSL features. This is: they manipulate the ruby language itself into
something more specific to the domain for which they are writing their
application. Creating effective DSLs is probably one of the most
complicated processes in ruby and touches on everything from ruby’s open
classes to meta-programming to special ruby methods (method missing and
send).

I’d recommend starting from the ground up with a couple of great books:
why’s poignant guide to ruby, programming ruby (first edition free
online). If you want to throw down some cash I’m really liking Hal
Fulton’s The Ruby Way. Also, check out the ruby blogs out there! Tons of
good info on the more “hardcore” aspects of ruby.

  • Drew

Vladimir K. wrote:

The question is, what concepts are necessary to grasp to be able to
create something like that (in ruby), and, is there a good read
(preferably on-line) about them?

Vlad

Try writing Ruby code to look like english. If you focus on making
things look nice like that, most of it will fall into place. You can
do your project in english, but the hard part is doing it in Ruby. So
why not make Ruby do your project in english!

Ari
--------------------------------------------|
If you’re not living on the edge,
then you’re just wasting space.

2008/2/10, Vladimir K. [email protected]:

Since then I have being using ruby (sporadically and not for big
projects), but with a bad style (I recognised this, when trying to
write something bigger).

When I see projects like rspec, sequel and ramaze, I am amazed what is
possible with ruby.

The question is, what concepts are necessary to grasp to be able to
create something like that (in ruby), and, is there a good read
(preferably on-line) about them?

There are some fundamental principles in software engineering that
apply regardless of programming language chosen: basically you have to
carefully think about how you distribute functionality across
different programming artifacts (methods, functions, classes and the
like). In other words, complex systems are built by divide and conquer
and abstraction. There are different methodologies (top down, bottom
up, various OO approaches) but they all try to come up with a
distribution of functionality that avoids redundancies (ideally no two
methods / classes that do the same) and keeps things modular (so you
can easier reuse).

Off the top of my head I could not recommend a book or other resource
that will teach this. I tend to believe that, to a good extend, this
is learned from experience. Maybe looking into OO patterns can help,
because they deal exactly with this question “how do I create my
classes and make them collaborate?”:

Kind regards

robert

On 11.02.2008 13:49, Robert K. wrote:

(preferably on-line) about them?
can easier reuse).

Off the top of my head I could not recommend a book or other resource
that will teach this.

I found one which seems to cover what I meant:

Kind regards

robert

On Feb 13, 2008 11:34 AM, Robert K. [email protected]
wrote:

create something like that (in ruby), and, is there a good read
methods / classes that do the same) and keeps things modular (so you
can easier reuse).

Off the top of my head I could not recommend a book or other resource
that will teach this.

I found one which seems to cover what I meant:

http://www.amazon.com/Structure-Interpretation-Computer-Programs-Engineering/dp/0262510871/

The full text of SICP is available for free on the Web. Not as
convenient in some ways as dead trees, but for anyone interested
reading the thread, its easier to poke around and see if it meets your
needs: http://mitpress.mit.edu/sicp/full-text/book/book.html