<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shimon Rura's Blog &#187; computers/programming languages/Ruby</title>
	<atom:link href="http://rura.org/blog/category/computersprogramming-languagesruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://rura.org/blog</link>
	<description>just another software developer in Boston striving to be a renaissance man</description>
	<lastBuildDate>Thu, 10 Sep 2009 17:15:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8220;Practical Ruby Projects&#8221;: a fascinating guide for the curious hacker</title>
		<link>http://rura.org/blog/2008/02/25/practical-ruby-projects-a-fascinating-guide-for-the-curious-hacker/</link>
		<comments>http://rura.org/blog/2008/02/25/practical-ruby-projects-a-fascinating-guide-for-the-curious-hacker/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 20:21:03 +0000</pubDate>
		<dc:creator>shimon</dc:creator>
				<category><![CDATA[computers/programming languages/Ruby]]></category>

		<guid isPermaLink="false">http://rura.org/blog/2008/02/25/practical-ruby-projects-a-fascinating-guide-for-the-curious-hacker/</guid>
		<description><![CDATA[
Writing a program is fun.  Like writing an essay, the endeavor has two kinds of results: stuff that gets written down, and stuff that changes the way you think.  Sometimes you&#8217;re aiming for the written product, to fulfill some external obligation.  But other times, you&#8217;re aiming for enlightenment.  The end product [...]]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://rcm.amazon.com/e/cm?t=geeinbos-20&#038;o=1&#038;p=8&#038;l=as1&#038;asins=159059911X&#038;fc1=000000&#038;IS2=1&#038;lt1=_top&#038;lc1=0000FF&#038;bc1=FFFFFF&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px; float:right;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p>
<p>Writing a program is fun.  Like writing an essay, the endeavor has two kinds of results: stuff that gets written down, and stuff that changes the way you think.  Sometimes you&#8217;re aiming for the written product, to fulfill some external obligation.  But other times, you&#8217;re aiming for enlightenment.  The end product is irrelevant next to the understanding you developed in making it.</p>
<p>Most computer book authors wouldn&#8217;t claim to be writing about enlightenment. They&#8217;ll tell you that if you learn their language, framework, or methodology, you&#8217;ll win clients and impress coworkers.  In this category there are a lot of useful introduction and reference books, along with a lot of buzzword-laden crap.  But there&#8217;s another genre altogether, that doesn&#8217;t make these claims; it reflects the geek tradition of explaining interesting <i>because they&#8217;re interesting.</i>  Looking back on experiences that really shaped my thinking as a hacker&mdash; a great algorithms course in college, a talk on &#8220;Tricks of the Perl Wizards&#8221; by Mark-Jason Dominus, Philip Greenspun&#8217;s book on web publishing&mdash; it&#8217;s clear that the most profound things I&#8217;ve learned spring from that tradition.  <a href="http://www.amazon.com/dp/159059911X?tag=geeinbos-20&#038;camp=14573&#038;creative=327641&#038;linkCode=as1&#038;creativeASIN=159059911X&#038;adid=184Z1HMD8F67107RY6YY&#038;"><i>Practical Ruby Projects</i></a> is an exceptional book because it does, too.</p>
<p>Topher Cyll, author of the book, is a friend of mine.  In college, Topher and I worked together on a community website for students as well as spending a lot of time in the same computer lab.  In both roles, he was always full of clever and thoughtful ideas.  <i>Practical Ruby Projects</i> is full of such ideas, expanded to project form and in an approachable buffet layout.  The projects are indeed eclectic, from computer-generated music to gaming to genetic algorithms, but their common strand is the curiosity they all reward.  If you&#8217;re one of the unusual folks who maintained this curiosity beyond school, or perhaps if you&#8217;re a professor who wants to assemble an intermediate projects course that will appeal to the most curious and passionate of students, this book is for you.  With books like this and an open, curious mind, enlightenment might still be unreachable but at least you&#8217;re getting closer.<!--5251bd93d45ee3d5d7a2519e88403915--><!--da7d6baf7f5789ba9dab3bda18f2e3fe--><!--19fdfab46bb3e9140e19e92e6b240788--></p>
]]></content:encoded>
			<wfw:commentRss>http://rura.org/blog/2008/02/25/practical-ruby-projects-a-fascinating-guide-for-the-curious-hacker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Languages Make O-R Mapping OK, or How I learned to stop worrying and love Rails</title>
		<link>http://rura.org/blog/2005/09/21/dynamic-languages-make-o-r-mapping-ok-or-how-i-learned-to-stop-worrying-and-love-rails/</link>
		<comments>http://rura.org/blog/2005/09/21/dynamic-languages-make-o-r-mapping-ok-or-how-i-learned-to-stop-worrying-and-love-rails/#comments</comments>
		<pubDate>Wed, 21 Sep 2005 23:38:30 +0000</pubDate>
		<dc:creator>shimon</dc:creator>
				<category><![CDATA[computers/programming languages/Perl]]></category>
		<category><![CDATA[computers/programming languages/Ruby]]></category>
		<category><![CDATA[computers/web app frameworks]]></category>

		<guid isPermaLink="false">http://rura.org/blog/2005/09/21/dynamic-languages-make-o-r-mapping-ok-or-how-i-learned-to-stop-worrying-and-love-rails/</guid>
		<description><![CDATA[I have a confession to make: I&#39;m learning Ruby and Rails.  And I dig it.  It is, as it claims, a great leap forward in productivity compared to complex frameworks like J2EE, Struts, or even ASP.NET.  I was always prepared to believe this&#8212; I would say the same for the PageKit framework [...]]]></description>
			<content:encoded><![CDATA[<p>I have a confession to make: I&#39;m learning <a href="http://ruby-lang.org/en/">Ruby</a> and <a href="http://rubyonrails.org">Rails</a>.  And I dig it.  It is, as it claims, a great leap forward in productivity compared to complex frameworks like J2EE, Struts, or even ASP.NET.  I was always prepared to believe this&mdash; I would say the same for the <a href="http://www.pagekit.org/">PageKit</a> framework for <a href="http://www.perl.org/">Perl</a>, which I&#39;ve been using for 4 years, and has been pretty stable for at least 5.  But until recently, I wasn&#39;t believing the hype that Rails could be much better than PageKit.</p>
<p>After all, both PageKit and Rails had the whole MVC thing going, which is the most important advantage.  (MVC stands for Model-View-Controller, a pattern whose incarnation in web apps generally means that you have HTML-like files describing page layout, and Perl (or Ruby or Java or whatever) modules containing program code that provides data for that view.)  The difference seemed to be mainly that Rails included an <a href="http://ar.rubyonrails.org/">object-relational mapping tool</a>.</p>
<p>I am not a fan of object-relational mapping tools.  I consider them a special case (no pun intended&#8230; well not originally at least) of CASE tools.  CASE stands for Computer Assisted Software Engineering, and is based around the idea that you can write programs to do part of the job of software engineering, and thereby make humans more productive.</p>
<p>CASE tools are bullshit.  It&#39;s not that productive tools aren&#39;t helpful to hackers &mdash; they certainly are.  But tools that write code necessarily degrade the design of your software in a very severe way.  If you can&#39;t just write the code in an appropriately uncomplicated way, the solution isn&#39;t to have a fancy program produce the complicated code.  The solution is to change the language you&#39;re using so you can express exactly what you need to express, concisely.</p>
<p>That is basically why I like dynamic languages.  They remove a large set of restrictions on how you can redefine the meaning of utterances in the languages, so if you decide that looking up the key sasquatch in an associative array has a special meaning anywhere in your program, then damnit, you can have it work in a special way.  Easily.</p>
<p>For those who argue that this enables sloppy code, I have two answers:</p>
<ol>
<li>With great power comes great responsibility.  Not everyone is capable of accepting the responsibility of programming in a wide-open language, and if you think you need the sort of guidance that the Java wizards at Sun can produce (aimed at a target market of all application programmers in the world), you should use Java.  I&#39;m not going to say great programmers don&#39;t need guidelines or rules, because they do&mdash; they are constantly both affecting them and affected by them&mdash; but their rules are crafted and evolved around the subtle needs of their partners and customers, not pronouncements from language priests.</li>
<li>The alternatives are still sloppy code or code generation.  If your language won&#39;t let you say things elegantly, you can either buy/invent a new language that will, or you can write inelegant code.</li>
</ol>
<p>Anyway&#8230; back on topic: Object-Relational Mappers.  First a definition: an O-R Mapper is a gadget that bridges the divide between your relational database&#39;s idea of the important data types in your application, and your programming system&#39;s idea of the important data types in your application.  Your DB will be relational (stuff goes in tables, powerful querying is built-in) and normally persistent (saved to disk), while your programming system&#39;s data will be object-oriented (data is abstracted within object interfaces, querying has to be custom-built) and normally transient (in memory only).</p>
<p>I have so far been doing my web applications in a pretty traditional way, database-wise: my Perl code contains strings of SQL.  Then the Perl code processes the results of the SQL query and munges it into data structures (lists of hashes or something) that my templates can handle.  This is OK; I&#39;ve gotten pretty good at dashing out SQL.  But:</p>
<ul>
<li>it&#39;s hard to reuse code for queries needed in multiple places
</li>
<li>Perl may not be the most visually clean language, but it has a style, and dropping a fat SQL string into the middle of it is like carpeting the floor of a rainforest
</li>
<li>each data structure is specifically designed to match the template where it is used, so changes in what details are displayed require changes to SQL and to SQL-result-processing code</li>
<li>there isn&#39;t an obvious place to put common functions relating to a certain data type.</li>
</ul>
<p>Well, that list is exactly what O-R Mappers are supposed to solve.  Unfortunately, I thought none of them actually worked, mostly because code generation produces very brittle code and it&#39;s not OK for code that depends on my (rapidly evolving) database design to be brittle.</p>
<p>Thanks to Rails&#39; ActiveRecord, I now realize O-R mappers aren&#39;t doomed.  ActiveRecord creates the mapping at runtime, which is possible because it&#39;s running in a dynamic language, all of which means that I can add a column to some table and then just program with it.  And because things are just expected to have the same name convention everywhere, there&#39;s no need for bloated configuration files that tell you totally obvious crap, eg. that the DB&#39;s people table&#39;s birthday column goes into the Person object&#39;s birthday field.  And you can still write SQL if you must, though AR will do most of the joins you need.</p>
<p>This O-R stuff isn&#39;t as huge a productivity gain as moving from J2EE to anything dynamic and MVC.  So the PageKit to Rails transition isn&#39;t as huge as most transitions to Rails.  But the benefit, though marginal, is significant.  Consider me impressed.</p>
<p>[Of course, if someone had done this in Perl it would have been faster! &mdash;ed.]<!--301b1c728462b705545a01a0807ff6d0--><!--e8011d01d930a7abb83fd463b181e0a2--><!--4d579768e8f5a8275633bb22bb7f7df7--><!--ee00ba1d555f65fb3dcf56e48683eb6b--></p>
]]></content:encoded>
			<wfw:commentRss>http://rura.org/blog/2005/09/21/dynamic-languages-make-o-r-mapping-ok-or-how-i-learned-to-stop-worrying-and-love-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drooling on Ruby</title>
		<link>http://rura.org/blog/2005/03/17/drooling-on-ruby/</link>
		<comments>http://rura.org/blog/2005/03/17/drooling-on-ruby/#comments</comments>
		<pubDate>Thu, 17 Mar 2005 23:30:04 +0000</pubDate>
		<dc:creator>shimon</dc:creator>
				<category><![CDATA[computers/programming languages/Ruby]]></category>
		<category><![CDATA[computers/useful software]]></category>
		<category><![CDATA[computers/web app frameworks]]></category>
		<category><![CDATA[computers/web design]]></category>
		<category><![CDATA[shimon/voo2do]]></category>

		<guid isPermaLink="false">http://rura.org/blog/2005/03/17/drooling-on-ruby/</guid>
		<description><![CDATA[I keep on hearing good stuff about the Ruby on Rails web application framework. It&#39;s like the Republican party&#8212;one of the highest values of its supporters is to tout its greatness.  But the Rubyblicans have evidence: cool projects like Basecamp and sibling Tadalist, wiki+hierarchy tool Hieraki, and the aforementioned Web Collaborator.  Not to [...]]]></description>
			<content:encoded><![CDATA[<p>I keep on hearing good stuff about the <a href="http://www.rubyonrails.com/">Ruby on Rails</a> web application framework. It&#39;s like the Republican party&mdash;one of the highest values of its supporters is to tout its greatness.  But the Rubyblicans have evidence: cool projects like <a href="http://www.basecamphq.com/">Basecamp</a> and sibling <a href="http://tadalist.com/">Tadalist</a>, wiki+hierarchy tool <a href="http://www.hieraki.org/">Hieraki</a>, and the aforementioned <a href="http://webcollaborator.com/">Web Collaborator</a>.  Not to mention very nice documentation, such as <a href="http://darkhost.mine.nu:81/~vince/rails/tutorial.html">this tutorial on making, guess what, a to-do list</a>.</p>
<p>Perhaps it&#39;s too late to turn my own (upcoming) to-do list application into an experiment with Ruby on Rails, but my beloved <a href="http://www.pagekit.org/">Perl on PageKit</a> still let me get a prototype of voo2do kicking in about a day.  Definitely, the vast majority of my time on v2 has been spent tweaking CSS and Javascript to make the interface work.</p>
<p>But I&#39;ll save the rest of the hype until you can actually visit and try voo2do&#8230;<!--bd108c6b2c134886c7f5c5d42cdfd277--><!--94c66682650e51cb0429904f4d07ea98--></p>
]]></content:encoded>
			<wfw:commentRss>http://rura.org/blog/2005/03/17/drooling-on-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is Ruby Hot or Not?</title>
		<link>http://rura.org/blog/2005/02/04/is-ruby-hot-or-not/</link>
		<comments>http://rura.org/blog/2005/02/04/is-ruby-hot-or-not/#comments</comments>
		<pubDate>Fri, 04 Feb 2005 20:08:44 +0000</pubDate>
		<dc:creator>shimon</dc:creator>
				<category><![CDATA[computers/programming languages/Java]]></category>
		<category><![CDATA[computers/programming languages/Ruby]]></category>
		<category><![CDATA[kind of writing/predictions]]></category>
		<category><![CDATA[kind of writing/rants]]></category>

		<guid isPermaLink="false">http://rura.org/blog/2005/02/04/is-ruby-hot-or-not/</guid>
		<description><![CDATA[link
A friend emailed me asking what I thought about Ruby.  I&#39;ve only recently picked up a book on Ruby and am charmed by its comprehensive non-annoyingness.  Here&#39;s what I wrote back to him.  What do you think?
Will it take off?  I doubt it.  I think it has been steadily gaining [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ruby-lang.org/en/">link</a>
<p>A friend emailed me asking what I thought about <a href="http://www.ruby-lang.org/en/">Ruby</a>.  I&#39;ve only recently picked up a book on Ruby and am charmed by its comprehensive non-annoyingness.  Here&#39;s what I wrote back to him.  What do you think?</p>
<p>Will it take off?  I doubt it.  I think it has been steadily gaining over<br />
the past few years, but there isn&#39;t anything so revolutionary about its<br />
design or its culture that I think will let it dethrone Perl, PHP, and<br />
Python (perhaps it&#39;s the lack of a letter P).  At least not in the US.  Ruby<br />
originated in Japan, and may well be a leading scripting language there.<br />
It&#39;s well-enough known, it has its O&#39;Reilly books, but I don&#39;t see it<br />
becoming THE HOT THING.  It certainly has little traction in big software<br />
companies.</p>
<p>There is a web application framework for Ruby called Rails [<a href="http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html">here&#39;s a promising recent article</a>], which is rumored<br />
to be a very lightweight, easy-to-start-with framework.  Their website has a<br />
10 minute <a href="http://media.nextangle.com/rails/rails_setup.mov">video</a> where someone installs it and builds a sample site.  This<br />
is highly laudable in a world where suits insist on web applications written<br />
in J2EE, a framework so byzantine that it makes Software Architects<br />
confident they cannot understand the details of programming, while making Programmers confident they cannot understand the scope of design.</p>
]]></content:encoded>
			<wfw:commentRss>http://rura.org/blog/2005/02/04/is-ruby-hot-or-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Quick (and Hopefully Painless) Ride Through Ruby (with Cartoon Foxes)</title>
		<link>http://rura.org/blog/2004/03/12/a-quick-and-hopefully-painless-ride-through-ruby-with-cartoon-foxes/</link>
		<comments>http://rura.org/blog/2004/03/12/a-quick-and-hopefully-painless-ride-through-ruby-with-cartoon-foxes/#comments</comments>
		<pubDate>Fri, 12 Mar 2004 20:59:05 +0000</pubDate>
		<dc:creator>shimon</dc:creator>
				<category><![CDATA[computers/programming languages/Ruby]]></category>
		<category><![CDATA[computers/reference materials]]></category>

		<guid isPermaLink="false">http://rura.org/blog/2004/03/12/a-quick-and-hopefully-painless-ride-through-ruby-with-cartoon-foxes/</guid>
		<description><![CDATA[link
Ruby is a sweet little programming language. It has some of the Perl ethos of inspiration by natural language, and it is simple. It&#39;s smaller and less well known than Perl, but as you can tell by the name, it&#39;s probably roughly in the same family of programming languages. Future project: take an afternoon and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://poignantguide.net/ruby/chapter-3.html">link</a>
<p>Ruby is a sweet little programming language. It has some of the Perl ethos of inspiration by natural language, and it is simple. It&#39;s smaller and less well known than Perl, but as you can tell by the name, it&#39;s probably roughly in the same family of programming languages. Future project: take an afternoon and learn it. This guide seems like a fun, skimmable way to start. And if I don&#39;t learn it soon, it&#39;ll be hard to be the first kid on the block hacking it.
<p>(I&#39;m betting there are a lot of geeks on my block, which seems probabilistically true although I have no first-hand evidence. Another project: get to know my neighbors better?)</p>
]]></content:encoded>
			<wfw:commentRss>http://rura.org/blog/2004/03/12/a-quick-and-hopefully-painless-ride-through-ruby-with-cartoon-foxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
