{"id":432,"date":"2008-06-21T13:37:24","date_gmt":"2008-06-21T12:37:24","guid":{"rendered":"http:\/\/wp.devco.net\/?p=432"},"modified":"2009-10-09T13:59:44","modified_gmt":"2009-10-09T12:59:44","slug":"new_programming_language_of_choice_-_ruby","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2008\/06\/21\/new_programming_language_of_choice_-_ruby.php","title":{"rendered":"New programming language of choice – Ruby"},"content":{"rendered":"

I have fallen out of love with Perl some time ago, I cannot point to one specific thing about it that put me off, I think it’s just a general un-sexyness about it now.<\/p>\n

I have been doing some Java and PHP development that was very OOP heavy and have been doing OO coding since school in the Pascal 6 days, I find it’s almost become the natural way of thinking when thinking about problems.  OO though does not generally translate well to scripting tasks which is what I generally use Perl for so it’s not been too bad.<\/p>\n

I am however a Perl 4 coder, Perl 5’s OO syntax really puts me off, I’ve used it, have written some pluggable systems in the past where plugins were Perl Ojbects, but I’ve never liked them…with Perl 6 coming (or not) having to relearn a large chunk of Perl is becoming inevitable so I figured I might as well switch.  This is a decision I’ve made ages ago.<\/p>\n

I could however not decide on where to go from here?  There are several contenders out there for scripting languages thesedays and weighing up their merits is a time consuming business for sure.  <\/p>\n

So along came Puppet, I am doing massive amount of Puppet work now for 3 clients and my own systems.  Puppet is extendible using Ruby code as it’s written in Ruby itself so I think the decision has been made.  I still have no interest in using it on the web, but for scripting I’ve found my new love.<\/p>\n

I wont go into long examples and discussions about the Ruby Language, but I’ll say I have learned in the space of a week on the train and have found it incredibly friendly and usable.  The Core and Standard Libraries are rich and modern including out of the box XML, YAML, SOAP, XML-RPC and very powerful networking libraries such as GServer<\/a>.<\/p>\n

Documentation has been generally good but I did buy a copy of Beginning Ruby From Novice to Professional<\/a> which I believe is a awesome introduction to the language, I followed that up with The Ruby Way 2nd Edition<\/a> and Ruby Cookbook<\/a>.<\/p>\n

Beginning Ruby takes you on a gentle stroll through a lot of the major features of the language, shows you Strings, Arrays, Numbers, OO, Threads, Sockets and RPC.  It doesn’t go too deep into any of these subjects, for instance it does not show much about Mutexes or any locking methods inside threads, but it puts down a very solid framework to go from.<\/p>\n

The Ruby Way is more task based and goes into more detail about the tasks, returning to the threads example, The Ruby Way discusses Mutexes and shows some of the concurrency issues you can expect, it has a whole chapter devoted to Threading.  <\/p>\n

These two books more than put you in a position to quickly and effectively use any of the online documentation resources so I would greatly recommend this combination.<\/p>\n

I have skimmed through the Cookbook, it’s your typical O’Reilly Cookbook – I mostly bought it because I have 6 or 7 other Cookbook titles and they are all invaluable, I spent an hour with it so far and it looks to live up to this reputation.<\/p>\n

If you’ve programmed before in any serious way picking up Ruby should be a walk in the park, the syntax is great, the language does what you’d expect and as you’ll see in my next post spending a week with it on and off is enough to write a capable multi threaded socket server.<\/p>\n","protected":false},"excerpt":{"rendered":"

I have fallen out of love with Perl some time ago, I cannot point to one specific thing about it that put me off, I think it’s just a general un-sexyness about it now. I have been doing some Java and PHP development that was very OOP heavy and have been doing OO coding since […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","footnotes":""},"categories":[7],"tags":[121,13],"_links":{"self":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/432"}],"collection":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/comments?post=432"}],"version-history":[{"count":1,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/432\/revisions"}],"predecessor-version":[{"id":521,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/432\/revisions\/521"}],"wp:attachment":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/media?parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/categories?post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/tags?post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}