<?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>danielmiessler.com &#187; Beauty</title>
	<atom:link href="http://danielmiessler.com/categories/beauty/feed" rel="self" type="application/rss+xml" />
	<link>http://danielmiessler.com</link>
	<description>grep understanding</description>
	<lastBuildDate>Sun, 12 Feb 2012 09:25:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Why I Love Ruby</title>
		<link>http://danielmiessler.com/blog/why-i-love-ruby</link>
		<comments>http://danielmiessler.com/blog/why-i-love-ruby#comments</comments>
		<pubDate>Mon, 19 Mar 2007 20:57:26 +0000</pubDate>
		<dc:creator>Daniel Miessler</dc:creator>
				<category><![CDATA[Beauty]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://dmiessler.com/archives/1216</guid>
		<description><![CDATA[If you&#8217;re looking for a comprehensive comparison of 15 programming languages based on decades of experience, this isn&#8217;t it. I&#8217;m a hobbiest programmer. Most of my &#8220;programs&#8221; are either in bash or Python, fit on one page, and are based firmly in laziness. But I do know beauty when I see it, and Ruby is [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re looking for a comprehensive comparison of 15 programming languages based on decades of experience, this isn&#8217;t it. I&#8217;m a hobbiest programmer. Most of my &#8220;programs&#8221; are either in bash or Python, fit on one page, and are based firmly in laziness. But I do know beauty when I see it, and <a href="http://en.wikipedia.org/wiki/Ruby_%28programming_language%29">Ruby</a> is beautiful.</p>

<p>In this post I&#8217;m going to show you, using just a points from the beginning of <a href="http://www.oreilly.com/catalog/rubyckbk/">a Ruby book</a>, why I love this language more than any other. I write this post because I&#8217;m always given &#8220;the look&#8221; by people when I tell them I&#8217;m learning Ruby. Most either think it&#8217;s:</p>

<ol>
    <li>not a &#8220;real&#8221; programming language (those are the C and Java people)</li>
    <li>a lame replacement for Perl (Perl people)</li>
    <li>a slightly different Python (people who don&#8217;t know either Python or Ruby)</li>
</ol>

<p>This post is designed to counter that look.</p>

<p><strong>Intuitiveness</strong></p>

<p>To me, programming should be intuitive before anything else. You should be able to think about problems, start writing, and realize that you&#8217;ve solved some. Ruby isn&#8217;t there yet, but it&#8217;s the closest thing I&#8217;ve found. Check out this syntax:
<pre class="codeblock">
string.length</pre>
That&#8217;s it. Prints out how big the string is. No biggie, but notice you don&#8217;t need any parenthesis. Very cool.
<pre class="codeblock">
string.count('m')</pre>
Find that letter in the string, and print how many there are.
<pre class="codeblock">
string.length.next</pre>
Utterly sick. Whatever the length of your string was, plus 1. Oh, and strings are completely mutable in Ruby. You can do useful things like this:
<pre class="codeblock">
string.upcase</pre>
&#8230;which returns your string, but in all upercase. And here&#8217;s the cool bit: if you look at your string again it&#8217;s still lowercase. But if you want to permanently change it you can too:
<pre class="codeblock">
string.upcase!</pre>
That&#8217;s it. Just add the exclamation point and you&#8217;ve permanently changed the string in place. Wicked. Ok, now check out these boolean checks:
<pre class="codeblock">
string.empty?</pre>
This returns a true or false, based on whether or not the string is empty or not. Insane. Here&#8217;s another:
<pre class="codeblock">
string.include('test')</pre>
Returns a true or false based on whether or not your string &#8220;includes&#8221; the string &#8216;test&#8217;. But you already knew that, and that&#8217;s the point. It&#8217;s SO DAMN easy to read and write. Check this out:
<pre class="codeblock">
3.times</pre>
What do you think that does? It does whatever you tell it do &#8212; <strong>three times</strong>. W00t. I&#8217;m in love with this language.:</p>
<div id="crp_related"><h3>Related Content</h3><ul><li><a href="http://danielmiessler.com/blog/a-wicked-string" rel="bookmark" class="crp_title">A Wicked String</a></li><li><a href="http://danielmiessler.com/blog/getting-into-ruby" rel="bookmark" class="crp_title">Getting Into Ruby</a></li><li><a href="http://danielmiessler.com/blog/updated-ruby-code-for-querying-ipinfodb" rel="bookmark" class="crp_title">Updated Ruby Code for Querying IpInfoDB</a></li><li><a href="http://danielmiessler.com/blog/adding-color-to-your-grep-output" rel="bookmark" class="crp_title">Adding Color to Your Grep Output</a></li><li><a href="http://danielmiessler.com/blog/how-to-filter-google-results-by-date" rel="bookmark" class="crp_title">How-to Filter Google Results by Date</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://danielmiessler.com/blog/why-i-love-ruby/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

