<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Functional on queil.net</title>
    <link>https://queil.net/tags/functional/</link>
    <description>Recent content in Functional on queil.net</description>
    <generator>Hugo</generator>
    <language>en-uk</language>
    <lastBuildDate>Tue, 27 Nov 2018 08:50:13 +0100</lastBuildDate>
    <atom:link href="https://queil.net/tags/functional/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Pure Functions in C#</title>
      <link>https://queil.net/2018/11/pure-functions-in-csharp/</link>
      <pubDate>Tue, 27 Nov 2018 08:50:13 +0100</pubDate>
      <guid>https://queil.net/2018/11/pure-functions-in-csharp/</guid>
      <description>&lt;h2 id=&#34;intro&#34; class=&#34;anchor-link&#34;&gt;&lt;a href=&#34;#intro&#34;&gt;Intro&lt;span class=&#34;pilcrow&#34;&gt;&amp;nbsp;¶&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;Having some recent experience with F# I realised some of the functional programming principles could also be successfully used in C#. One could go completely crazy and create/use library like &lt;a href=&#34;https://github.com/louthy/language-ext&#34;&gt;language-ext&lt;/a&gt;. However, I would like to focus on the way of writing code rather than utilizing any libraries. The idea I would like to introduce in this article is pure functions.&lt;/p&gt;&#xA;&#xA;&lt;h2 id=&#34;pure-has-no-side-effects&#34; class=&#34;anchor-link&#34;&gt;&lt;a href=&#34;#pure-has-no-side-effects&#34;&gt;Pure has no side effects&lt;span class=&#34;pilcrow&#34;&gt;&amp;nbsp;¶&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;In a non-functional mindset there is a common misconception that side effects are something unwanted in good code. I guess it comes from the medical definition of side effects&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; where indeed any other than healing effects are undesirable. However, in the functional mindset we define side effects as changes to any external state. External i.e. not exclusively owned by the function. Here are a few examples of side effects:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
