<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: 10 Ruby One Liners to Impress Your Friends	</title>
	<atom:link href="https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/feed/" rel="self" type="application/rss+xml" />
	<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/</link>
	<description>Meditations on programming, startups, and technology</description>
	<lastBuildDate>Tue, 19 Apr 2016 13:50:26 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Swift ? 10 ??????????? &#124; ????		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-29096</link>

		<dc:creator><![CDATA[Swift ? 10 ??????????? &#124; ????]]></dc:creator>
		<pubDate>Tue, 19 Apr 2016 13:50:26 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-29096</guid>

					<description><![CDATA[[&#8230;] ????????????????????? Scala ? 10 ????????????????????????????????????????????????? Haskell?Ruby?Groovy?Clojure?Python?C#?????F#?CoffeeScript? [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] ????????????????????? Scala ? 10 ????????????????????????????????????????????????? Haskell?Ruby?Groovy?Clojure?Python?C#?????F#?CoffeeScript? [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: swapnil patil		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-27678</link>

		<dc:creator><![CDATA[swapnil patil]]></dc:creator>
		<pubDate>Wed, 30 May 2012 20:51:52 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-27678</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23292&quot;&gt;Florian Gilcher&lt;/a&gt;.

use p or puts]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23292">Florian Gilcher</a>.</p>
<p>use p or puts</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: doel		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-27676</link>

		<dc:creator><![CDATA[doel]]></dc:creator>
		<pubDate>Tue, 29 May 2012 07:29:04 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-27676</guid>

					<description><![CDATA[I liked the concept pf &#124;&#124;= in ruby
a &#124;&#124;= b]]></description>
			<content:encoded><![CDATA[<p>I liked the concept pf ||= in ruby<br />
a ||= b</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: IT Programming Courses &#8211; News &#187; Blog Archive &#187; Ten Groovy One Liners to Impress Your Friends		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23672</link>

		<dc:creator><![CDATA[IT Programming Courses &#8211; News &#187; Blog Archive &#187; Ten Groovy One Liners to Impress Your Friends]]></dc:creator>
		<pubDate>Tue, 14 Jun 2011 12:57:24 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-23672</guid>

					<description><![CDATA[[...] 10 Scala One Liners to Impress Your Friends, which then led to (not in this order) 10 Ruby One Liners to Impress Your Friends, 10 Python one liners to impress your friends, 10 Clojure One Liners to Impress Your Friends, F# [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] 10 Scala One Liners to Impress Your Friends, which then led to (not in this order) 10 Ruby One Liners to Impress Your Friends, 10 Python one liners to impress your friends, 10 Clojure One Liners to Impress Your Friends, F# [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: oldmoe		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23569</link>

		<dc:creator><![CDATA[oldmoe]]></dc:creator>
		<pubDate>Fri, 10 Jun 2011 17:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-23569</guid>

					<description><![CDATA[def fib(n, h= n &#060; 2? 1 : fib( n -1) + fib(n-2)); h; end

I recall seeing this Fibonacci function somewhere, makes an interesting one liner I suppose]]></description>
			<content:encoded><![CDATA[<p>def fib(n, h= n &lt; 2? 1 : fib( n -1) + fib(n-2)); h; end</p>
<p>I recall seeing this Fibonacci function somewhere, makes an interesting one liner I suppose</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sijo		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23560</link>

		<dc:creator><![CDATA[Sijo]]></dc:creator>
		<pubDate>Fri, 10 Jun 2011 09:50:19 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-23560</guid>

					<description><![CDATA[I thought  
(1..1).inject { &#124;sum, n&#124; sum + n }   and
(1..1).sum  will return 2 but it is 1. Can anybody please explain]]></description>
			<content:encoded><![CDATA[<p>I thought<br />
(1..1).inject { |sum, n| sum + n }   and<br />
(1..1).sum  will return 2 but it is 1. Can anybody please explain</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: 10 Smalltalk One Liners to Impress Your Friends &#124; Varvello On XP, Simplicity, Smalltalk, Agile, Programming		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23551</link>

		<dc:creator><![CDATA[10 Smalltalk One Liners to Impress Your Friends &#124; Varvello On XP, Simplicity, Smalltalk, Agile, Programming]]></dc:creator>
		<pubDate>Fri, 10 Jun 2011 02:42:19 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-23551</guid>

					<description><![CDATA[[...] days ago, Antonio posted a list of 10 Ruby one-liners. The 1-liners saga started [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] days ago, Antonio posted a list of 10 Ruby one-liners. The 1-liners saga started [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: -= 10 Haskell One Liners to Impress Your Friends =-		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23357</link>

		<dc:creator><![CDATA[-= 10 Haskell One Liners to Impress Your Friends =-]]></dc:creator>
		<pubDate>Fri, 03 Jun 2011 21:56:32 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-23357</guid>

					<description><![CDATA[[...] the meme (scala, ruby, clojure, python, f#, coffeescript, [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] the meme (scala, ruby, clojure, python, f#, coffeescript, [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: steve		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23354</link>

		<dc:creator><![CDATA[steve]]></dc:creator>
		<pubDate>Fri, 03 Jun 2011 20:59:45 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-23354</guid>

					<description><![CDATA[&#062; I find Ruby’s syntax to be a bit cleaner than Scala’s

As far as I understood the author of &quot;10 Scala One Liners to Impress Your Friends&quot; really decided to use some more complicated constructs tobe sure to impress.


&#062; (1..1000).inject(&#038;:+)
&#062; [14, 35, -7, 46, 98].min
&#062; [14, 35, -7, 46, 98].max

could be written as

&#062; 1 to 1000 sum
&#062; List(14, 35, -7, 46, 98) min
&#062; List(14, 35, -7, 46, 98) max

in Scala.

The Ruby code (as well as the original Scala example have the problem that their algorithm (accumulating the result of adding every number of the range) is O(n) which is really really slow!

Summing 1 to Int.MaxValue takes ~35 seconds in Scala (so probably a few minutes in Ruby).

There exists a ticket for #sum in Scala to make it an O(1) operation.]]></description>
			<content:encoded><![CDATA[<p>&gt; I find Ruby’s syntax to be a bit cleaner than Scala’s</p>
<p>As far as I understood the author of &#8220;10 Scala One Liners to Impress Your Friends&#8221; really decided to use some more complicated constructs tobe sure to impress.</p>
<p>&gt; (1..1000).inject(&amp;:+)<br />
&gt; [14, 35, -7, 46, 98].min<br />
&gt; [14, 35, -7, 46, 98].max</p>
<p>could be written as</p>
<p>&gt; 1 to 1000 sum<br />
&gt; List(14, 35, -7, 46, 98) min<br />
&gt; List(14, 35, -7, 46, 98) max</p>
<p>in Scala.</p>
<p>The Ruby code (as well as the original Scala example have the problem that their algorithm (accumulating the result of adding every number of the range) is O(n) which is really really slow!</p>
<p>Summing 1 to Int.MaxValue takes ~35 seconds in Scala (so probably a few minutes in Ruby).</p>
<p>There exists a ticket for #sum in Scala to make it an O(1) operation.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Antonio Cangiano		</title>
		<link>https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23340</link>

		<dc:creator><![CDATA[Antonio Cangiano]]></dc:creator>
		<pubDate>Fri, 03 Jun 2011 16:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://programmingzen.com/?p=1383#comment-23340</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23329&quot;&gt;al&lt;/a&gt;.

Al, these are definitely basic one liners. They are just a Ruby translation of a Scala post made by someone else. They&#039;d probably look more impressive to people used to mainstream statically typed languages like Java or C++.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://programmingzen.com/10-ruby-one-liners-to-impress-your-friends/#comment-23329">al</a>.</p>
<p>Al, these are definitely basic one liners. They are just a Ruby translation of a Scala post made by someone else. They&#8217;d probably look more impressive to people used to mainstream statically typed languages like Java or C++.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
