Ruby redux
A while ago I posted that I’d tried Ruby and didn’t like it, thanks very much. But I’ve been back and tried it again and it’s beginning to grow on me.
To be honest, going back to Java was a little hard. It was a bit like going back to C++ after working in Java – it suddenly takes a lot of code to do something very simple. So I admit it’s true – Ruby does get a lot more done with less lines of code. The major problem I had with using Ruby was really Rails – it’s attitude is do it my way or don’t do it and I didn’t want to do it its way. I have another project now to prototype a simple cloud API, the only requirement was that it should be REST-ful and it would be good if it was in Ruby. So I did some googling and discovered Sinatra, a very lightweight framework that seems to have been designed specifically for writing REST-ful APIs in Ruby. And it is very cool. I don’t find the framework getting in the way at all – I just define the http action and URL and it handles directing the request to my code and then promptly gets out of the way. I intend to post the code to my prototype as soon as it’s presentable, but for anyone with a development background in Java thinking about dipping a toe into the world of Ruby I heartily recommend Sinatra as a starting point. Unfortunately I don’t see any easy solution for the performance issues I mentioned.