<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by trajing on Medium]]></title>
        <description><![CDATA[Stories by trajing on Medium]]></description>
        <link>https://medium.com/@trajing?source=rss-4fc6f0dc6547------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6SCrG5913SRtu4e73jXj-A.jpeg</url>
            <title>Stories by trajing on Medium</title>
            <link>https://medium.com/@trajing?source=rss-4fc6f0dc6547------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:04:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@trajing/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Differences between Ruby and Python]]></title>
            <link>https://medium.com/the-commented-section/differences-between-ruby-and-python-f4bfbf772de1?source=rss-4fc6f0dc6547------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4bfbf772de1</guid>
            <dc:creator><![CDATA[trajing]]></dc:creator>
            <pubDate>Sun, 12 Apr 2015 16:12:37 GMT</pubDate>
            <atom:updated>2015-04-12T16:12:37.556Z</atom:updated>
            <content:encoded><![CDATA[<p>Often, people talk about Ruby and Python being similar. This isn’t true.</p><p>While at first glance, they look similar — puts “Hello, World” for Ruby and print “Hello, World” for Python, but there are quite a few differences.</p><h4>Python’s Whitespace Requirement</h4><p>In Ruby, whitespace is by no means required. Tabbing should be done, of course, but nothing’s there to stop you from writing code that isn’t indented. In Python, things are different. You must indent every statement by four spaces — no more, no less. Four shall be the number that-</p><p>Wait. This is a coding language, not the Holy Hand Grenade.</p><h4>Ruby’s Philosophy</h4><p>Technically, it’s the Perl philosophy. For those that don’t know, the Perl philosophy is that there should be many ways to solve a problem. Python defaults to the opposite extreme. This is by no means bad, just different.</p><h4>Blocks</h4><p>I present you with my favorite feature of Ruby — blocks.</p><pre>[&#39;hello&#39;, &#39;world&#39;, &#39;~NL&#39;, &#39;this&#39;, &#39;is&#39;, &#39;a&#39;, &#39;ruby&#39;, &#39;block&#39;].each do |str|<br>  if str == &#39;~NL&#39;<br>    print &#39;\n&#39;<br>  else<br>    print &quot;#{str} &quot;<br>  end<br>end</pre><p>Wait, what?</p><p>If you’re new to Ruby — and you very well might be, this is a block. As opposed to looping over the array via for or something else, it’s just a convenient little method that executes a block of code with a variable given to it. Very nice.</p><h4>Conclusion</h4><p>While there’s probably a bunch more, I’ve covered enough differences for now. Keep in mind that most standards are standards for a reason — they’re different, not better. While some standards keep at it long past when they should’ve stopped <em>*cough*Java*cough*</em>, don’t suggest that someone who has learned language x to switch over to language y, which has similar syntax. Coding languages are like snowflakes — no two are quite alike. And if you find an exact duplicate of a snowflake, it’s probably a pointer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4bfbf772de1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-commented-section/differences-between-ruby-and-python-f4bfbf772de1">Differences between Ruby and Python</a> was originally published in <a href="https://medium.com/the-commented-section">// The Commented Section</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>