{"id":377,"date":"2014-11-02T19:49:30","date_gmt":"2014-11-03T00:49:30","guid":{"rendered":"http:\/\/codefork.com\/blog\/?p=377"},"modified":"2014-11-03T00:10:42","modified_gmt":"2014-11-03T05:10:42","slug":"arriving-late-to-the-party","status":"publish","type":"post","link":"https:\/\/codefork.com\/blog\/index.php\/2014\/11\/02\/arriving-late-to-the-party\/","title":{"rendered":"Arriving Late to the Party"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/codefork.com\/blog\/wp-content\/uploads\/2014\/11\/chunky_bacon.png\" alt=\"chunky_bacon\" width=\"286\" height=\"242\" class=\"aligncenter size-full wp-image-381\" \/><\/p>\n<p>I started playing with Ruby this past week, at the suggestion of a coworker I respect who thinks highly of the language, and of Rails. I&#8217;ve found <a href=\"https:\/\/pragprog.com\/book\/ruby4\/programming-ruby-1-9-2-0\">Programming Ruby 1.9 &#038; 2.0<\/a> to be an excellent way to get started.<\/p>\n<p>Now, it&#8217;s only been a week, but so far? I really love it.<\/p>\n<p>This surprised me.<\/p>\n<p>Some first thoughts and impressions, subject to change:<\/p>\n<p>1) Ruby is VERY expressive. I&#8217;m astounded by what you can do in a few short lines of code. I wasn&#8217;t initially thrilled about some of its uses of character symbols, obviously borrowed from Perl, but these are actually pretty judicious and not as bad as I expected.<\/p>\n<p>2) There&#8217;s a commonplace idea that Python and Ruby are redundant: if you know one, there&#8217;s not a lot of reason to learn the other. I can see this, as they do have many overlapping features and roles, but their philosophies could not be more different. So from an experiential standpoint rather than a business one, they&#8217;re both worth learning.<\/p>\n<p>3) Things that Ruby does better than Python: the object orientation is stronger (access controls, single inheritance with a powerful mixin mechanism, most[?] operators are methods); blocks are way more powerful than lambdas; regexes are native constructs; Ruby&#8217;s symbols are a nice feature taken from Lisp.<\/p>\n<p>4) I hate that &#8216;require&#8217; autoimports things into your namespace, like Perl does. This is where I much prefer Python&#8217;s &#8216;import&#8217; statement. For the love of God, DO NOT TOUCH MY NAMESPACE unless I say so. (EDIT: this is actually incorrect! Files that get required typically define modules, which are constants in a global namespace, which is quite different from autoimporting names into the current namespace, like Perl.)<\/p>\n<p>5) The fact that strings are mutable is one of those things that filled me with horror, but I&#8217;m not sure it actually matters that much in practice.<\/p>\n<p>6) If <a href=\"http:\/\/mislav.uniqpath.com\/poignant-guide\/book\/\">Why&#8217;s Poignant Guide to Ruby<\/a> doesn&#8217;t inspire you to learn and use Ruby, you may not be human.<\/p>\n<p>As a learning exercise, I rewrote a short Python script that watches RSS feeds for certain keywords. <a href=\"https:\/\/github.com\/codeforkjeff\/feedwatcher\">It&#8217;s available on github<\/a>. Even as a newcomer (albeit one with Perl and Python experience), writing the code was intuitive and painless. In fact, it was a strangely pleasing experience. The code could be improved, I&#8217;m sure, but arriving at a decent, clean first pass wasn&#8217;t hard to do at all.<\/p>\n<p>This feels like a good time to look at Ruby. The initial frenzy and excitement over Ruby, and Rails, in the mid-to-late 2000s has died down considerably, displaced by the current wave of languages focusing on concurrency. Yet its performance, once a huge blight, has been quietly improving from 1.8 to 1.9 to 2.0, and the ecosystem (gems, rbenv, rake) seems very mature.<\/p>\n<p>Now that it&#8217;s no longer sexy, it can focus on doing what it was designed for in the first place: making programmers happier to be writing code. Languages these days are emphasizing features and power, but how many actually tout your happiness as its primary reason for existence?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I started playing with Ruby this past week, at the suggestion of a coworker I respect who thinks highly of the language, and of Rails. I&#8217;ve found Programming Ruby 1.9 &#038; 2.0 to be an excellent way to get started. Now, it&#8217;s only been a week, but so far? I really love it. This surprised &hellip; <a href=\"https:\/\/codefork.com\/blog\/index.php\/2014\/11\/02\/arriving-late-to-the-party\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Arriving Late to the Party&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-377","post","type-post","status-publish","format-standard","hentry","category-ruby"],"_links":{"self":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=377"}],"version-history":[{"count":7,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/377\/revisions"}],"predecessor-version":[{"id":385,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/377\/revisions\/385"}],"wp:attachment":[{"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codefork.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}