<?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>MacTheWeb &#187; Ruby</title>
	<atom:link href="http://mactheweb.com/archives/catagories/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://mactheweb.com</link>
	<description>Mac and the Web - Perfect</description>
	<lastBuildDate>Mon, 15 Dec 2008 22:45:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What is Ruby?</title>
		<link>http://mactheweb.com/ruby/what-is-ruby/</link>
		<comments>http://mactheweb.com/ruby/what-is-ruby/#comments</comments>
		<pubDate>Mon, 28 May 2007 09:19:21 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://mactheweb.com/software-review/what-is-ruby/</guid>
		<description><![CDATA[According to Wikipedia, Ruby is a reflective, dynamic, object-oriented programming language. It combines syntax inspired by Perl with Smalltalk-like object-oriented features, and also shares some features with Python, Lisp, Dylan, and CLU. Ruby is a single-pass interpreted language. Its official implementation is free software written in C.
That may mean something to a real programmer but [...]]]></description>
			<content:encoded><![CDATA[<p>According to <a href="http://en.wikipedia.org/wiki/Ruby_programming_language">Wikipedia</a>, Ruby is a reflective, dynamic, object-oriented programming language. It combines syntax inspired by Perl with Smalltalk-like object-oriented features, and also shares some features with Python, Lisp, Dylan, and CLU. Ruby is a single-pass interpreted language. Its official implementation is free software written in C.</p>
<p>That may mean something to a real programmer but to me it is about as useful as a kick in the head. Let&#8217;s go a bit farther. Again from Wikipedia:</p>
<h3>Philosophy</h3>
<p>The language&#8217;s creator has said that Ruby is designed for programmer productivity and fun, following the principles of good user interface design.[1] He stresses that systems design needs to emphasize human, rather than computer, needs</p>
<blockquote><p>&#8220;Often people, especially computer engineers, focus on the machines. They think, &#8220;By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something.&#8221; They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves.&#8221;</p></blockquote>
<h3>Translating to designer speak</h3>
<p>That makes a bit more sense. Productivity and fun sound good. Emphasizing human needs over those of the computer sounds even better. All these factors should make Ruby easier to learn than older languages and more or less equivalent to Python.</p>
<p>So, put into terms that may not be totally accurate but that reflect my level of understanding, Ruby is a modern programming language that borrows the better parts from its predecessors. It shares certain features with other modern languages that make it a more productive programming environment. And as a programming language is a set of formalized instructions that make a computer do useful and interesting things.<span id="more-229"></span></p>
<ul>
<li>Ruby is <strong>reflective</strong>. Huh? Again from Wikipedia:  Figuratively speaking, it is then said that the program has the ability to &#8220;observe&#8221; and possibly to modify its own structure and behavior.That sounds good. If Ruby can &#8220;observe&#8221; its own actions while doing its program thing then I understand that it is more flexible than some other languages.</li>
<li>Ruby is <strong>object oriented</strong>. Apparently there are two main types of programming procedures, object oriented and procedural (functional). The theory seems to be that object oriented or OO programming creates more flexible and maintainable code.One of the problems I&#8217;m finding is that most definitions define OO programming in contrast to procedural. Fine, there are differences but for a beginner that kind of definition is pretty useless.
<p>The best I can understand is that a programming object can both store information and interact with other objects. Since Ruby makes everything an object I think that means that anything created or defined in Ruby can act on or be acted upon by anything else.</p>
<p>In procedural languages information blocks are separate from the instructions that manipulate them. One thing happens after another and information blocks don&#8217;t interact without specific instructions.</p>
<p>To put objects in more ordinary terms lets consider me walking my dog. I am an object of the class owner. Mollydog is an object of the class pet. Or to be politically correct we are both objects of the class companions. I pick up the leash from the coat rack and Molly starts running in circles and makes excited sounds. My action affects Molly. Later in the walk Molly sees a squirrel and charges after it, pulling on me. Molly affects me. We have both been affected by the actions of yet another object of the class squirrel.</p>
<p>An example of a procedure would be cooking dinner. I follow a recipe and prepare, combine and heat ingredients in a particular order. I perform procedures upon the ingredients, which (unless I burn myself) don&#8217;t modify my behavior in return. The end result of the cooking procedure, dinner, if eaten, will modify me but the cooking itself won&#8217;t.</li>
<li>Ruby is a <strong>dynamic programming language.</strong> Okay, this one I think I understand the basics of. There are two basic types of programming languages, compiled and dynamic. the difference between them is in how they are presented to the operating system. Computers can&#8217;t actually understand most programming. Programs have to go through an in-between step between starting them and having the computer actually run them.Compiled languages run through this step before they are ready for use. This is called compiling. Dynamic languages are interpreted for the computer at the time that they are exceuted (<a href="http://en.wikipedia.org/wiki/Runtime">runtime</a>).
<p>As with almost any situation there are tradeoffs involved in using one or the other. Compiled languages are much faster. Dynamic languages are typically much easier to learn and use and are usually more flexible. Ruby sacrifices absolute speed for this ease of use and abstraction. Abstraction is the degree to which the programmer is separated from the nitty-gritty of the ones and zeros that computers actually use to compute.</p>
<p>Ruby on Rails adds another level of abstraction to Ruby which equates with another hit is execution speed.</li>
</ul>
<h3>One more thing</h3>
<p>There is one more aspect of Ruby that appeals to me, called the <em>principle of least surprise.</em> That simply means the Ruby should behave in such a way that it makes sense to experience programmers. After a short and painful stab at Perl about 7 years ago that is totally appealing. Perl seemed so flexible to me that it bordered on chaotic. A related RoR concept is that of <em>convention over configuration</em>,which promotes doing similar tasks the same way with similar parts of the program in the same place. Every Time.</p>
]]></content:encoded>
			<wfw:commentRss>http://mactheweb.com/ruby/what-is-ruby/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Learning Ruby and Ruby on Rails</title>
		<link>http://mactheweb.com/ruby/ruby-on-rails/learning-ruby-and-ruby-on-rails/</link>
		<comments>http://mactheweb.com/ruby/ruby-on-rails/learning-ruby-and-ruby-on-rails/#comments</comments>
		<pubDate>Sun, 27 May 2007 21:20:37 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://mactheweb.com/software-review/learning-ruby-and-ruby-on-rails/</guid>
		<description><![CDATA[My Reasoning
Web design is getting more and more complicated and clientâ€™s expectations are getting more and more sophisticated. People want both more flashier presentation and more interactivity for their sites. The presentation component calls for Flash or JavaScript effects. The interactivity calls for server side programming. Keeping current is a lot of work if not [...]]]></description>
			<content:encoded><![CDATA[<h2>My Reasoning</h2>
<p>Web design is getting more and more complicated and clientâ€™s expectations are getting more and more sophisticated. People want both more flashier presentation and more interactivity for their sites. The presentation component calls for Flash or JavaScript effects. The interactivity calls for server side programming. Keeping current is a lot of work if not totally impossible. Whatâ€™s a fella to do?</p>
<p>The simple answer is learn to program. Even Flash requires programming if you want to build any kind of interactivity into your movies. Great idea but Iâ€™m a designer and donâ€™t really know how to program anything. Oh, I can do some simple PHP and JavaScript tricks and more or less know where to look in somebody elseâ€™s program to find the HTML part to tweak but thatâ€™s about it. If Dreamweaver doesnâ€™t handle my PHP needs Iâ€™m basically SOL.</p>
<p>Where to start? As a middle aged HTML jockey Iâ€™m not going to go back to college for a computer science degree, so itâ€™s pretty much learn as you go. Obvious, but where to start?<span id="more-228"></span></p>
<p>If you keep at all current with the current web buzz you know that <a href="http://www.rubyonrails.org/">Ruby on Rails</a> (RoR) is the wonder child of the year. <a href="http://twitter.com/">Twitter</a> and <a href="http://37signals.com/">37 Signals</a> have gotten a lot of press and have put RoR on the map.</p>
<p>But does popular equal good or appropriate? In this case I think the answer is a qualified yes. Ruby on Rails is whatâ€™s called an application framework. A framework is a combination of a program to program and formal conventions designed to speed up development time. The idea makes a lot of sense. Much of programming web sites involves doing the same kinds of things over and over, not anybodyâ€™s idea of fun. The RoR framework automates many of the repetitive tasks involved in creating an interactive website and greatly speeds up development time. Cool.</p>
<p>Of course, Ruby on Rails is not the only web development framework around. And whether or not it is the best is a subject of debate. But it is popular, and in large part because its creator <a href="http://www.loudthinking.com/">inventor, David Heinemeier Hansson,</a> is an exceptional salesman, which creates a sort of self-fullfilling prophesy loop. More people are convinced that RoR it the place to be so more people work on the project. With more programmers involved RoR gets more mature and feature rich more quickly.</p>
<p>If you are already comfortable in another language like Python or PHP you might want to look at frameworks written in those languages <a href="http://www.djangoproject.com/">Django</a>, a Python offering probably fits my immediate goals better than RoR. There are other Python frameworks that  bear consideration. Iâ€™m just not qualified to judge their quality.</p>
<p>I also took a look at <a href="http://www.phphacks.com/content/view/53/33/">some PHP frameworks</a>. Itâ€™s probable that my small knowledge of PHP might save a bit of ramp up time in learning. But two factors influenced my decision to learn Ruby and RoR. The most important is that the tremendous popularity of RoR has influenced a lot of very talented people to write some good books on the framework and on the mother language, Ruby. Programming is enough like mathematics that my experience with calculus probably offers a good preview of what learning Ruby will be like.</p>
<p>Simply put, calculus was hard for me. My brain doesnâ€™t easily follow the kind of logic tracks that it requires. I needed five textbooks, all covering to same material to grasp some of the concepts. Often I just couldnâ€™t understand one authorâ€™s explanation and needed another take to clear the mud out of my head. My small experience with programming has been similar. I sometimes need to have the same concept explained multiple times in multiple ways before it becomes clear. Ruby on Rails and Ruby have enough reference material published that I have access to the different explanations that I need. PHP, in general, does but none of the PHP frameworks has anything that I can grok. Itâ€™s the same with Python. I would need to spend months getting enough of a foundation under me before I could even begin to grasp the details of Django or itâ€™s competitors that the possibility of bootstrapping myself into productivity this year is virtually zero.</p>
<p>The other reason is simple. Apple will bundle Ruby on Rails into the version of OS X. Iâ€™m enough of a fan boy to appreciate that. If another framework like Django or <a href="http://www.cakephp.org/">CakePHP</a> were included instead my choice might have been different.</p>
<h2>To Date</h2>
<p>I tried to get myself ramped up with the first, and most popular, Ruby on Rails book, <cite><a href="http://www.amazon.com/Agile-Development-Rails-Pragmatic-Programmers/dp/0977616630/ref=pd_bbs_sr_1/104-8180635-2187115?ie=UTF8&#038;s=books&#038;qid=1180288226&#038;sr=8-1">Agile Web Development with Rails</a></cite> but it was simply over my head. So my venture into Ruby on Rails has been slow.</p>
<p>The learning options a year ago were slim. There were <a href="http://webdeveloper.econsultant.com/ruby-rails-tutorials/">a number of tutorials online</a>. I tried most of them out but they werenâ€™t geared to a novice like me. Like most tutorials they are quick looks into the potentials of RoR but not complete enough for a non-programmer to do more than follow along. Thatâ€™s not saying that they arenâ€™t valuable, just that I need a more basic and systematic type of instruction. I imagine that real programmers can use them to kick start a real project. Maybe someday&#8230;</p>
<p>So to facilitate learning I bought a couple of RoR books. The first was last September,  <a href="http://www.amazon.com/Ruby-Rails-Techniques-Developers/dp/1932394699/ref=pd_bbs_sr_9/104-8180635-2187115?ie=UTF8&#038;s=books&#038;qid=1180288226&#038;sr=8-9">Ruby for Rails</a> by David A. Black. That was still a bit advanced for me, though I look forward to re-examining it shortly. What I can understand seem well written and it gets good reviews.</p>
<p>Finally I found something written to my level, <a href="http://www.amazon.com/Ruby-Rails-Dummies-Computer-Tech/dp/0470081201/ref=pd_bbs_sr_8/104-8180635-2187115?ie=UTF8&#038;s=books&#038;qid=1180288226&#038;sr=8-8">Ruby on Rails for Dummies</a>. It explained some of the terminology that more advanced texts assumed I already knew and it provides a gentle introduction to RoR. It is a good first baby step for the non-programmer into the world of Ruby and Ruby on Rails.</p>
<p>Another advantage I realized from the Dummies book is that I really needed a basic grounding in programming in general and Ruby in particular. So, Iâ€™ve taken a short side trip into Ruby with <a href="http://pine.fm/LearnToProgram/?Chapter=00">Learning to Program With Ruby</a>.</p>
<p>More on that soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://mactheweb.com/ruby/ruby-on-rails/learning-ruby-and-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Old fart on rails</title>
		<link>http://mactheweb.com/ruby/ruby-on-rails/old-fart-on-rails/</link>
		<comments>http://mactheweb.com/ruby/ruby-on-rails/old-fart-on-rails/#comments</comments>
		<pubDate>Tue, 13 Feb 2007 00:57:51 +0000</pubDate>
		<dc:creator>michael</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://mactheweb.com/ruby-on-rails/old-fart-on-rails/</guid>
		<description><![CDATA[Way back in the stone age when I began my bachelor&#8217;s degree in computer science, computers were impressive things, taking up whole buildings though having less actual computing power than a modern cell phone. Yes, we powered the things by steam and entered data with stone tablets. It seems like it anyway. Punch cards were [...]]]></description>
			<content:encoded><![CDATA[<p>Way back in the stone age when I began my bachelor&#8217;s degree in computer science, computers were impressive things, taking up whole buildings though having less actual computing power than a modern cell phone. Yes, we powered the things by steam and entered data with stone tablets. It seems like it anyway. Punch cards were not much better. We also walked uphill five miles to class each way in the snow in our bare feet, too.</p>
<p>Where am I going with this? What happened was that I changed my major from CS to geology and pretty much forgot about computers for years. The whole process was just too much hard work.</p>
<p><span id="more-227"></span>20 years later when, armed with a Mac and happy with computers again, I decided to try my hand at programming once more, I looked at Perl. Perl is certainly different from the Fortran I worked with in the bad old days and without punch cards it was sort of fun to get into.</p>
<p><a href="http://www.perl.com/">Perl</a> makes it possible to create interactive web site and programs like shopping cart, but Perl wasn&#8217;t designed as a web specific language. Rather it was born as a compilation of Unix administration scripts. As such it is powerful. Unfortunately, as a web programming language it has a lot of baggage.</p>
<p>So from Perl was born <a href="http://www.php.net/">PHP</a>, which focused on only on internet specific functionality. Wanting things to be easier I simplified my life by moving from Perl to PHP.</p>
<p>PHP makes it very straightforward to do simple things on the web. But it quickly becomes very complicated to create a more complex application. The progression is more than linear, too. As complexity grows, web apps sprout frighteningly many directories and includes. Not appealing.</p>
<p>Of course, I made the obligatory personal blog and shopping cart applications with PHP/MySQL then pretty much quit bothering. There were smarter people than I and certainly better programmers who were building quality products that I could simply use. This blog is built with <a href="http://wordpress.org/">Wordress</a> and is so much better than I could have created that it would have been silly to try to roll my own.</p>
<p>And since PHP grew semi-randomly from a base of Perl, which also grew semi-randomly, it is a messy and complicated language, composed of tacked on pieces and parts that was never a joy to use.</p>
<p>Skip ahead a few years and we find that others, much smarter than I, have had the same experiences and done something about it. One in particular, <a href="http://loudthinking.com">David Heinemeier Hansson</a>, created a set of new web programming protocols called <a href="http://rubyonrails.org/">Ruby on Rails</a>.</p>
<p>Ruby on Rails, or RoR or simply Rails was built from the <a href="http://www.ruby-lang.org/en/">Ruby</a> programming language. Ruby has the advantage over Perl or PHP of being created from scratch as a whole and not duck taped together from bits an pieces. As such it is both easier to learn and more streamlined. I find this highly appealing. As I get older I&#8217;m getting both a little slower in my learning ability and a lot less willing to spend the effort to learn something complicated. Yeah, yeah, all programming is complicated but there are degrees.</p>
<p>But what really makes Rails appealing is that its creator, DHH, has a Steve Jobsian like vision of making things elegant (DHH uses the term beautiful), easy to use, and productive. In short it makes the idea of programming fun again the way that my first Mac made computing fun again. Moving from PHP to Rails feels very much like moving from the oppressive world of DOS to the pleasingly sane world of the Mac OS.</p>
<p>The idea is simple, follow Rails conventions and most of the work is taken care of. Things just work &#8211; the way a Mac just works. Of course, there is still a learning curve, but it&#8217;s one that seems reasonable to an aging HTML jockey.</p>
<p>I have a couple of web applications that I&#8217;ve been thinking of making. Before it just seemed like too much work, especially since they are specialized and would appeal to a small audience. It just wasn&#8217;t worth the effort to write a program for myself. Obviously, I&#8217;m not a programmer at heart. There is no joy of creating applications to scratch an itch. Programming is a tool that requires a lot of skill and time to master and to keep current with. Rails just may make the effort required to create personal applications small enough to be worth my time. It&#8217;s certainly interesting enough on its own for me to give it a serious learning effort.</p>
]]></content:encoded>
			<wfw:commentRss>http://mactheweb.com/ruby/ruby-on-rails/old-fart-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
