<?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>Endlessly Curious &#187; Ruby</title>
	<atom:link href="http://www.endlesslycurious.com/category/programming/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.endlesslycurious.com</link>
	<description>by Daniel Brown</description>
	<lastBuildDate>Thu, 03 Jun 2010 16:53:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ruby or Python: Round Two!</title>
		<link>http://www.endlesslycurious.com/2008/11/14/ruby-or-python-round-two/</link>
		<comments>http://www.endlesslycurious.com/2008/11/14/ruby-or-python-round-two/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 08:00:58 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.endlesslycurious.com/?p=745</guid>
		<description><![CDATA[Yesterday in my post about web development frameworks, I mentioned I would be revisiting my previous post on whether to learn Python or Ruby.  So this post is a continuation of that earlier discussion.  I&#8217;m bringing up the topic of Python or Ruby again as I have been thinking about web frameworks since watching Cal [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday in my <a href="http://www.endlesslycurious.com/2008/11/13/web-development-frameworks/">post</a> about web development frameworks, I mentioned I would be revisiting my previous <a href="http://www.endlesslycurious.com/2008/10/29/python-or-ruby/">post</a> on whether to learn Python or Ruby.  So this post is a continuation of that earlier discussion.  I&#8217;m bringing up the topic of Python or Ruby again as I have been thinking about web frameworks since watching Cal Henderson&#8217;s &#8216;Why I hate Django&#8217; talk from DjangoCon 2008 at the weekend and then the &#8216;Snakes and Rubies&#8217; <a href="http://www.djangoproject.com/snakesandrubies/">presentation</a>.</p>
<p>The availability of <a href="http://en.wikipedia.org/wiki/Model_View_Controller">MVC</a> oriented web frameworks for Python (<a href="http://www.djangoproject.com/">Django</a>) and Ruby (<a href="http://www.rubyonrails.org/">Ruby on Rails</a>) was not something I had considered when making my earlier decision about which of these two languages to put time into learning.  However now that the idea of writing a new version of this site in one of these new fangled MVC/ORM frameworks has occurred to me, I&#8217;d like to reconsider my earlier decision.  I&#8217;ve done some Google searches on &#8216;Django or Ruby on Rails&#8217; and have been reading through the <a href="http://www.google.ca/search?q=django+or+ruby+on+rails">results</a>.  One of the more interesting blog posts I found on Django, Rails and php (<a href="http://epicserve.com/blog/69/python-and-django-ruby-on-rails-and-php">here)</a> has lead me on to the videos of the &#8216;Snakes and Rubies&#8217; presentations which are very informative and well worth watching (they can be found <a href="http://www.djangoproject.com/snakesandrubies/">here</a>).</p>
<p>So far after watching the Django presentation I must admit I&#8217;m loving a lot of what was demonstrated: automatic administration page generation, built in caching, URL pattern matching and templates which separate content and logic/code sounds ideal.  The automatic generation of an administration interface sounds especially nice as writing an decent administration interface is very time consuming to do correctly.  And these interfaces are not something the end users will generally ever see so it can fell like a lot of effort for a feature that is never appreciated by the general population only by the administrators.  The template system sounds excellent as well as it means graphic/web designers can handle the design of the site without requiring programming knowledge or support.</p>
<p>I&#8217;ve now watched the Ruby presentation too and I have to admit it did not grab me as much as the Django presentation did.  Beautiful code, which seemed to be the main selling point of the presentation is a wonderful thing.  However features like administration interface generation, caching and templates are more attractive to me than being able to use fewer lines of code to do things.</p>
<p>To digress for a moment, I think that my lack of excitement at the concept of beautiful code as it was presented in the video, could be in part to me being mainly a C/C++ programmer: so beautiful code in the sense of code that does a lot of work in a few lines of source code is not something you see very often in C/C++.  In fact in a lot of cases that particular brand of beautiful code is something you would be down right suspicious of in C/C++ but that is perhaps more due to the nonrestrictive nature of C/C++: its lack of hand holding or built in safety as a language.  This lack of safety perhaps drives C/C++ programmers to be more obsessive about understanding what exactly their source code does under the hood to avoid unpleasant surprises later.  This encourages a preference for easy to read and comprehend source code and perhaps promotes suspicion of &#8216;voodoo&#8217; code that does allot of work in a few lines of usually harder to read code.  In short beautiful code is a worthy goal but something I would personally be suspicious of but that is probably more due to my personal C/C++ baggage than any fault in Ruby.</p>
<p>Now back to Ruby on Rails or Django.  Another thing which I had not really considered in my earlier post was which language had the best range of high quality libraries available.  I had assumed that both languages would have a similar range of libraries available but so far my investigations seem to be pointing to Python as having more.  Ruby does not seem to have as many available libraries, unless of course I&#8217;m using the wrong keywords when searching the ruby gems system and if that is actually the definitive library index for Ruby.  This lack of libraries is quite a big deal to me, as I am a big fan of not reinventing the wheel unless it is absolutely necessary, so I like having lots of high quality libraries I can use.  That also speeds up prototyping efforts as it is easier to hook up existing libraries than write the same functionality from scratch again yourself.</p>
<p>In summary when I consider learning Python or Ruby for scripting, rapid prototyping and with added dimension of writing a website with an MVC framework.  I think I would now reverse my decision and learn Python rather than Ruby.  If I was still just thinking about scripting and prototyping with these languages I would consider the two languages evenally matched.  With Python having an advantage with the apparent range and quality of its libraries and Ruby having an advantage with its support of Public/Private class members which I am more comfortable with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.endlesslycurious.com/2008/11/14/ruby-or-python-round-two/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web Development Frameworks</title>
		<link>http://www.endlesslycurious.com/2008/11/13/web-development-frameworks/</link>
		<comments>http://www.endlesslycurious.com/2008/11/13/web-development-frameworks/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 08:00:47 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.endlesslycurious.com/?p=738</guid>
		<description><![CDATA[When I created my first website back in 1998 it was purely static HTML that I created with Adobe&#8217;s DreamWeaver application.  Next I discovered dynamic websites built using php and MySQL databases, so my next few sites were all written in php and accessing a MySQL database for the content.  I have to confess that [...]]]></description>
			<content:encoded><![CDATA[<p>When I created my first website back in 1998 it was purely static <a href="http://en.wikipedia.org/wiki/HTML">HTML</a> that I created with Adobe&#8217;s <a href="http://www.adobe.com/products/dreamweaver/">DreamWeaver</a> application.  Next I discovered dynamic websites built using <a href="http://www.php.net/">php</a> and <a href="http://www.mysql.com/">MySQL</a> databases, so my next few sites were all written in php and accessing a MySQL database for the content.  I have to confess that these initial dynamic sites were written in the worst style possible: inline php in the HTML and spaghetti php, all things that <a href="http://www.tbray.org/ongoing/When/200x/2006/02/17/PHP">invoke</a> <a href="http://www.codinghorror.com/blog/archives/001119.html">horror</a> in other programmers.</p>
<p>It was not until I started helping out with <a href="http://www.rockclimbing.com/">RockClimbing.com</a> for a brief period which exposed me to a large scale php project supporting many thousands of users.  With its advanced language usage, separation of code, content and layout with <a href="http://www.smarty.net/">smarty</a> templates, advanced caching and high performance database queries (one of the developers ended up working for MySQL iirc) it was beyond anything I had seen before.  All this opened my eyes to how to architect a site in php correctly and that it could be a truly elegant language to work with and I am not alone in this <a href="http://www.sitepoint.com/blogs/2006/02/21/a-pro-php-rant/">feeling</a>.  Then for a period of several years my personal site fell into disuse as I was distracted by work and life from doing any active web development.</p>
<p>This year I decided to start this blog on a new domain name and start writing about software engineering and programming.  My choice of blog engine?  <a href="http://wordpress.org/">WordPress</a>: which is a php based blogging engine which runs with MySQL as its database.  I found myself tweaking my WordPress installation almost immediately and I found it easy enough to do as php was already familiar to me.  In fact I&#8217;ve been tweaking so much that I&#8217;ve now set-up a Perforce server at home so I can track, audit and keep a log of my changes.  As I&#8217;ve explored the WordPress code base over the months, I&#8217;ve noticed that it is not the prettiest of code in place and again I&#8217;m <a href="http://mgeisler.net/2005/05/wordpress-code-quality/">not</a> <a href="http://www.codinghorror.com/blog/archives/001105.html">alone</a> <a href="http://codeutopia.net/blog/2008/01/26/impressions-on-wordpress/">in</a> <a href="http://twitter.com/codinghorror/statuses/994018417">noticing</a> <a href="http://talideon.com/weblog/2006/06/bad-wordpress.cfm">this</a>.</p>
<p>Please don&#8217;t misunderstand me, I like WordPress <em>a lot</em>, it has made setting up and running this blog <em>trivial</em>, especially when compared with writing my own blog engine from scratch. I&#8217;m simply commenting on my perception of the quality of the underlying source code, something I think all programmers do especially with things they&#8217;ve written (although I did not write WordPress, I just modified it).  It would be nice to see a code tidy up and the introduction of templates and caching to the core engine, but that is a big job to undertake and I don&#8217;t think I have the required amount of spare time to achieve it myself.</p>
<p>All this has got me thinking about the recent(ish) upsurge in the number of web development frameworks that are embracing things like <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">Object Relational Mapping</a> (ORM) and development models like the <a href="http://en.wikipedia.org/wiki/Model_View_Controller">Model-View-Controller</a> (MVC) pattern.  The two programming languages that seem to be leading this charge are <a href="http://www.python.org/">Python</a> with <a href="http://www.djangoproject.com/">DJango</a> and <a href="http://www.ruby-lang.org/en/">Ruby</a> with its <a href="http://www.rubyonrails.org/">Rails</a> framework, no doubt there are other frameworks in other languages too (e.g. <a href="http://www.asp.net/mvc/">ASP MVC</a>, php&#8217;s <a href="http://www.symfony-project.org/">symfony</a> framework).  The increase in popularity of these frameworks with built in template engines and abstraction of content from layout and logic via MVC are making me consider setting out on the path of writing my own personal blog engine again.</p>
<p>Mostly writing my own blog engine is a way to learn and embrace these new technologies and concepts and also a chance to see what all the fuss is about.  This would mean leaving the cosy comfort of my WordPress armchair, so most likely this experiment will become something I initially develop in a test <a href="http://en.wikipedia.org/wiki/Sandbox_(software_development)">sandbox</a> at home until I have something that is worthy of publishing online.  My decision now is what language and framework to use.  Do I stick to php with Smarty and MySQL or do I try something new like Python&#8217;s Django or Ruby on Rails?  Right now I&#8217;m tempted by either Python or Ruby for reasons I will talk about in a post tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.endlesslycurious.com/2008/11/13/web-development-frameworks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby Hello World</title>
		<link>http://www.endlesslycurious.com/2008/10/30/ruby-hello-world/</link>
		<comments>http://www.endlesslycurious.com/2008/10/30/ruby-hello-world/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 08:00:57 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.endlesslycurious.com/?p=586</guid>
		<description><![CDATA[Its a computing tradition to have your first program in a new programming language output &#8216;Hello World&#8217;, best not to go against tradition:
puts 'hello world'
This has uncovered an issue with the WYSIWYG editor built into Wordpress which is stripping out the name part of the pre tags that is used by the google syntax highlighter. [...]]]></description>
			<content:encoded><![CDATA[<p>Its a computing tradition to have your first program in a new programming language output &#8216;Hello World&#8217;, best not to go against tradition:</p>
<pre class="brush: ruby;">puts 'hello world'</pre>
<p>This has uncovered an issue with the <a href="http://en.wikipedia.org/wiki/WYSIWYG">WYSIWYG</a> editor built into Wordpress which is stripping out the name part of the <a href="http://www.w3schools.com/TAGS/tag_pre.asp">pre</a> tags that is used by the google syntax highlighter.  I have found a work around though which you can find out about <a href="http://ellisweb.net/2008/08/using-syntaxhighlighter-to-format-code-in-wordpress/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.endlesslycurious.com/2008/10/30/ruby-hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python or Ruby?</title>
		<link>http://www.endlesslycurious.com/2008/10/29/python-or-ruby/</link>
		<comments>http://www.endlesslycurious.com/2008/10/29/python-or-ruby/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 08:00:32 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Programming Languages]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.endlesslycurious.com/?p=549</guid>
		<description><![CDATA[I&#8217;ve really needed to get round to learning a powerful object oriented scripted or interpreted programming language to replace windows batch files (which I currently use) for a while now.  As Microsoft seems determined to gut their functionality with each new Windows release and I find myself wanting more functionality and power than batch scripts [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve really needed to get round to learning a powerful object oriented <a href="http://en.wikipedia.org/wiki/Scripting_language">scripted</a> or <a href="http://en.wikipedia.org/wiki/Interpreter_(computing)">interpreted</a> programming language to replace windows batch files (which I currently use) for a while now.  As Microsoft seems determined to gut their functionality with each new Windows release and I find myself wanting more functionality and power than batch scripts can provide.  So I have been looking for a high level <a href="http://en.wikipedia.org/wiki/Scripting_language">scripted</a> or <a href="http://en.wikipedia.org/wiki/Interpreter_(computing)">interpreted</a> language for platform independent scripting, rapid application prototype and generally messing about with at home.  Ideally the language is scripted or interpreted (so no compilation required), has a unit test harness available, ideally some form of IDE/debugger, some decent solid libraries (e.g, database, visualisation/graphing etc) and is object oriented.</p>
<p>I know I don&#8217;t want to use the following languages mostly for reasons of personal taste:</p>
<ul>
<li><a href="http://www.perl.org/">Perl</a> as I can never remember it&#8217;s syntax and I can&#8217;t seem to read any script I&#8217;ve written in Perl after a week or so.</li>
<li><a href="http://www.php.net/">php</a> as I already use it for web development (and like it a lot) but it does not really seam suitable for scripting or quick application development that is not running on a web server.</li>
<li><a href="http://java.com/en/">Java</a> I&#8217;ve never gotten on with, but that was probably more to do with falling out with my Java lecturer at university.  Although I should probably revisit Java at some point as it seems very popular at the enterprise level.</li>
<li>I also want something not Microsoft specific, as much as I love <a href="http://msdn.microsoft.com/en-us/vcsharp/default.aspx">C#</a> I want something I can use easily on my Mac or Linux boxes at home without compiling.</li>
</ul>
<p>So far I&#8217;ve narrowed it down to either <a href="http://www.python.org/">Python</a> or <a href="http://www.ruby-lang.org/en/">Ruby</a>.  Originally I was going to learn Python as I like its use of white space for scoping, its wide range of libraries and maturity as a language.  However there seems to be a lot of buzz about Ruby these days, especially its <a href="http://www.rubyonrails.org/">Rails framework</a> and all the buzz has piqued my interest.  Further investigation into Ruby has me now leaning towards learning it mostly for the trivial reason (as the languages are equally matched in my mind) that Ruby has the similar concept and syntax of public, protected and private for methods which is familiar to me as a C++ and C# programmer.</p>
<p>In fact I am more then leaning towards Ruby as I bought a copy of &#8216;<a href="http://oreilly.com/catalog/9780596516178/">The Ruby Programming Language</a>&#8216; at lunchtime, mostly as it was getting good reviews online and because the original developer of Ruby was a co-author.  I always enjoyed <a href="http://www.research.att.com/~bs/homepage.html">Bjarne Stroustrup</a>&#8217;s &#8216;<a href="http://www.research.att.com/~bs/3rd.html">The C++ Programming Language</a>&#8216; book, getting the language creators view on their creation is always fascinating and provides valuable insights.</p>
<p>So expect to see more posts about Ruby as I work my way through the book and experiement.  I can even post code snippets with syntax highlighting thanks to the Google <a href="http://code.google.com/p/syntaxhighlighter/">Syntax Highlighter</a> in the form of a handy <a href="http://wordpress.org/extend/plugins/google-syntax-highlighter/">plug-in</a> for Wordpress!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.endlesslycurious.com/2008/10/29/python-or-ruby/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
