Ruby… at last!

Well it’s been a long time coming but i’m finally dipping into the Ruby pool of magic 🙂  Actually, coming from a groovy and grails background it’s a pretty close neighbour – metaclassing, dynamic loading, closures, heaps of syntatic sugar and strong convention over configuration.  I’m not sure I like the fact they’ve saved me from even declaring variables (def account in groovy) but so far, it seems nice.

I’m glad the do keyword is fairly redundant now, as it seemed quite dated syntax. Using the & symbol for closures is pretty archaic, too. Still, there are benefits, which remind me of C and C++ a bit. It seems the basic philosophy of Ruby is.. “trust me, i’m a programmer and I know what i’m doing… just do it!”. No type-checking, access to everything, no limits. Nice. Well nice for certain apps, and nice for disciplined programmers with solid test code to back it up. I can imagine large-scale apps being a nightmare, but that doesn’t mean Ruby is to blame. Often it’s the tradie, not the tool 🙂

Anyway, i’ve now turned to Neo4J with Ruby (actually I have moved to Ruby from Grails after feeling quite let down by the lack of new features, progress and quirky behaviour of grails when you start doing some serious stuff… I don’t need the web components so it was really just sticking with what I knew).

Points for the irb in Ruby – helps alot to sanity check little spikes you want to do with a rapid test. It seems both groovy and ruby share the ability of rapid prototyping quite well, I wonder how this makes it travel once it reaches a sizable app.

One thing I want to be able to do easily is read files and create sizable data from it, for testing and further prototyping. One problem going with Neo4J seems to be lack of visibility of the data once it’s injected into the graph world 🙂 There’s all these nodes, all these relationships with properties and all you do is code traversers and query the data. That’s great, but it’s only recently tools have become available to visually display the structure of your live database. SQL may have it’s limits, but it’s very easy to write bog-standard queries. One thing i’d like to see for Neo4J is an irb or HQL style query interface, which can attach to live databases. To their credit, though, the Neo4J library for Ruby is excellent, and was my main reason for changing to Ruby. Excellent work guys.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s