<?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[// The Commented Section - Medium]]></title>
        <description><![CDATA[An Exploration of Programming Opinions - Medium]]></description>
        <link>https://medium.com/the-commented-section?source=rss----69daba5f9abd---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>// The Commented Section - Medium</title>
            <link>https://medium.com/the-commented-section?source=rss----69daba5f9abd---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 14:02:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/the-commented-section" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Object Oriented Programming and Functional Programming]]></title>
            <link>https://medium.com/the-commented-section/object-oriented-programming-and-functional-programming-fd9c73cd960d?source=rss----69daba5f9abd---4</link>
            <guid isPermaLink="false">https://medium.com/p/fd9c73cd960d</guid>
            <dc:creator><![CDATA[Strikingwolf]]></dc:creator>
            <pubDate>Sun, 12 Apr 2015 20:24:20 GMT</pubDate>
            <atom:updated>2015-04-12T20:47:23.006Z</atom:updated>
            <content:encoded><![CDATA[<p>People seem to think that Object-Oriented Programming (OOP) and Functional Programming (FP) are mutually exclusive. This topic has been written about <a href="http://blog.cleancoder.com/uncle-bob/2014/11/24/FPvsOO.html">before</a>; however, I see this constantly while talking to fellow software developers. In this blog post I hope to demystify the art of combining these two wonderful paradigms.</p><h4>Objects as Bags of Functions not Data</h4><p>When you think of objects as bags of data you are doing them a disservice. I think about it like this. When you delegate work off to someone else you don’t look at all the data that makes them up and take action depending on that, that would be you doing the work not them, instead you tell them to do an action. What are actions in programming? Functions! By using objects to perform actions rather than using them to store data you remove a layer that you as the programmer have to worry about. What does this imply for FP? It tells us that objects in OOP are not about state, but about functions. If objects are not about <em>state</em> then we can use FP to make the functions that will serve as the interface to our object, thus making our objects more thread-safe and easier to reason about.</p><h4>Functions as Objects Implies FP</h4><p>One of the fundamental building blocks of FP is the concept of <a href="http://en.wikipedia.org/wiki/Higher-order_function">higher-order functions</a> (HOFs). HOFs require some method of passing around functions to be a viable method of programming. A good way to do this is to make every function an Object, and if functions are objects then OOP can obviously be applied to them. Applying <em>OOP principles</em> to functions <em>implies functional programming. </em>For example, if we apply encapsulation to functions they immediately become <em>pure functions, </em>a core concept of FP, because they cannot interact with the outside world. Another example is the OCP (Open-Closed Principle); the OCP applied to functions exposes two key elements of FP, composition and currying. Instead of <em>extending </em>functions like in the OCP principle we compose or curry them. This achieves a similar effect to extending classes, adding functionality to them.</p><h4>Conclusion</h4><p>Functional Programming and Object-Oriented Programming can both be used together, and in fact they complement each other nicely. By using these two paradigms together we can create Objects that follow FP principles thus delegating tasks off to them is more isolated and when we create functions that follow OOP principles we automatically end up with FP.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd9c73cd960d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-commented-section/object-oriented-programming-and-functional-programming-fd9c73cd960d">Object Oriented Programming and Functional Programming</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>
        <item>
            <title><![CDATA[Differences between Ruby and Python]]></title>
            <link>https://medium.com/the-commented-section/differences-between-ruby-and-python-f4bfbf772de1?source=rss----69daba5f9abd---4</link>
            <guid isPermaLink="false">https://medium.com/p/f4bfbf772de1</guid>
            <dc:creator><![CDATA[trajing]]></dc:creator>
            <pubDate>Sun, 12 Apr 2015 16:12:45 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>
        <item>
            <title><![CDATA[The Best Programming Language?]]></title>
            <link>https://medium.com/the-commented-section/the-best-programming-language-d1deb164ad64?source=rss----69daba5f9abd---4</link>
            <guid isPermaLink="false">https://medium.com/p/d1deb164ad64</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[language]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Strikingwolf]]></dc:creator>
            <pubDate>Sat, 11 Apr 2015 22:39:40 GMT</pubDate>
            <atom:updated>2015-04-11T22:52:16.833Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Best Programming Language</h3><p>There is an idea in programming of a best programming language. Many people have their favorite programming language and will say that this is without question the <em>best </em>programming language. The truth is that there is no best programming language. Every programmer has their own style of programming, and the language that best supports that style will probably be their favorite.</p><p>All programmers have a style that they use when writing code. When I look at my team’s code I can usually pick out who has written the code, <em>even if it is the same language. </em>These styles show through in code very plainly to me, and I have a couple of groups that they fall under:</p><h4>The Novice:</h4><p>This person’s code is fairly simple. It works, but it is messy and follows no real pattern. Usually this person will use overly complex constructs when a simpler one would work very well. An example of this is nested if statements, where an and operator would work well. These kinds of programmers will eventually gravitate to one of the other groups after a while, but currently they are not the best programmers. Their favorite language will not be developed yet, and thus they will sit on the sidelines in the holy language wars.</p><h4>The Functional Programmer:</h4><p>This person values readability and elegance above all else. They will strive to make their code beautiful and to fit inside their definition of good code. Of course this programmer adheres to the functional programming idioms and generally has few variables and has a lot of higher order functions. This style is much easier to point out in a language that has first class functions, but it can be seen in other languages too. Their favorite language is almost always one that is a functional language such as</p><ul><li>Haskell</li><li>Clojure</li><li>Scala (also for OO)</li><li>ML</li><li>Scheme</li></ul><h4>The Object-Oriented Programmer:</h4><p>This person likes to separate out concerns among complex data structures. These programmers are easy to see because they prefer to make another class rather than to try to use a more simple data structure. These people succeed in delegating out concerns among objects. They usually favor a language that has an easy to use object system.</p><h4>The Systems Programmer:</h4><p>This person likes to be very low-level. Valuing the code working above all else. This person will generally use lower-level constructs and try to make his code very fast. These types of programmers are good for projects that either need to get off the ground quickly or need to be very fast while running. These programmers prefer low-level languages such as</p><ul><li>C</li><li>C++</li><li>Rust (also for functional programmers)</li><li>D</li></ul><p>If you were playing close attention you will understand what I just described. I described language groups. A lot of languages will fit into one or two of these groups because they are specifically targeted at these groups of people. Most people will fit into two of these groups. I myself lean towards functional programming, but do not lean heavily to OO or systems. The reason there is not a <em>best</em> language is that each language is targeted toward one or two of these <em>styles, </em>nor is it possible to cater to all of these styles well.</p><p>P.S: the best languages are Clojure, Haskell, and Rust :3</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1deb164ad64" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-commented-section/the-best-programming-language-d1deb164ad64">The Best Programming Language?</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>