<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>David Raab</title>
    <link>https://davidraab.github.io/</link>
    <description>Recent content on David Raab</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 26 Dec 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://davidraab.github.io/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Go&#39;s Error Handling</title>
      <link>https://davidraab.github.io/posts/gos-error-handling/</link>
      <pubDate>Fri, 26 Dec 2025 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/gos-error-handling/</guid>
      <description>Recently i tried out some Go. There are some good parts on Go that I think more languages should do, and some bad parts. Go&amp;rsquo;s Error Handling is something i consider better than in most other langauges, bad still bad enough looking on it from a function-programmer perspective.&#xA;So let&amp;rsquo;s dig deeper. Why do I think Go&amp;rsquo;s Error handling is better, let&amp;rsquo;s say compared to C. At least Go&amp;rsquo;s tries to be a system language competing with C.</description>
    </item>
    <item>
      <title>Why I Hate Templating Languages</title>
      <link>https://davidraab.github.io/posts/why-i-hate-templating-languages/</link>
      <pubDate>Mon, 21 Apr 2025 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/why-i-hate-templating-languages/</guid>
      <description>In the past I have worked a lot in web-development. This goes back to the early 2000 when web-sites was primarily just CGI scripts and didn&amp;rsquo;t used any JavaScript at all. Back then JavaScript also was mostly very slow as most Browser interpreted JavaScript.&#xA;Back in that old times every click on a button, link and so on was a full request to the browser and a full new page has to be generated on the server side.</description>
    </item>
    <item>
      <title>Quick: Useless Classes</title>
      <link>https://davidraab.github.io/posts/quick-useless-classes/</link>
      <pubDate>Sat, 01 Feb 2025 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/quick-useless-classes/</guid>
      <description>Here is a quick reminder. When you have a class/object that only has a single method.&#xA;1 2 3 4 5 6 7 8 9 my $obj = Class-&amp;gt;new( arg1 =&amp;gt; &amp;#34;whatever&amp;#34;, arg2 =&amp;gt; 10, ); my $result = $obj-&amp;gt;one_method( arg3 =&amp;gt; [], arg4 =&amp;gt; {}, ); then just make a single function out of it.&#xA;1 2 3 4 5 6 my $result = one_method( arg1 =&amp;gt; &amp;#34;whatever&amp;#34;, arg2 =&amp;gt; 10, arg3 =&amp;gt; [], arg4 =&amp;gt; {}, ); this also works with multiple methods, but with just a single method it defenitely should just be a single function.</description>
    </item>
    <item>
      <title>Sq: Counting to 1 Billion twice</title>
      <link>https://davidraab.github.io/posts/sq-counting-to-1-billion-twice/</link>
      <pubDate>Mon, 30 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/sq-counting-to-1-billion-twice/</guid>
      <description> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 #!/usr/bin/env perl use 5.036; use utf8; use open &amp;#39;:std&amp;#39;, &amp;#39;:encoding(UTF-8)&amp;#39;; use Sq; use Sq::Sig; # functional-style my $countup = assign { my $bill1 = Seq-&amp;gt;range(1,1_000_000_000); my $is_even = sub($x) { $x &amp;amp; 1 }; Seq::flatten_array( Seq::zip( Seq::filter($bill1, $is_even), Seq::remove($bill1, $is_even), ) ); }; run(sub { $countup-&amp;gt;iter(sub($x){ if ( $x % 10_000 == 0 ) { print &amp;#34;First: $x\n&amp;#34;; } }); }); # procedural / oo-style my $bill1 = Seq-&amp;gt;range(1,1_000_000_000); my $is_even = sub($x) { $x &amp;amp; 1 }; my $evens = $bill1-&amp;gt;filter($is_even); my $unevens = $bill1-&amp;gt;remove($is_even); my $zip = $evens-&amp;gt;zip($unevens); my $flatten = $zip-&amp;gt;flatten_array; run(sub { $flatten-&amp;gt;iter(sub($x){ if ( $x % 10_000 == 0 ) { print &amp;#34;Second: $x\n&amp;#34;; } }); }); sub run($f) { my $start = time(); $f-&amp;gt;(); my $stop = time(); printf &amp;#34;Time: %d seconds\n&amp;#34;, $stop; } Source Code for Example </description>
    </item>
    <item>
      <title>Sq Release v0.6</title>
      <link>https://davidraab.github.io/posts/sq-release-0-6/</link>
      <pubDate>Tue, 24 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/sq-release-0-6/</guid>
      <description>I am now bumping the version to 0.7, so this commit will be the last to define 0.6 or how Perl versions are used for this as 0.006.&#xA;I cannot provide a full Changelog and I also do not care. I am working on this alone and cannot provide full professional support for everything. If someone else want to have a changelog he can go through the commit and create it itself.</description>
    </item>
    <item>
      <title>Code as Data</title>
      <link>https://davidraab.github.io/posts/code-as-data/</link>
      <pubDate>Sun, 22 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/code-as-data/</guid>
      <description>I have the following type definition.&#xA;1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 my $album = t_hash( t_with_keys(qw/artist title tracks/), t_keys( artist =&amp;gt; t_str(t_min 1), # string must have at least 1 char title =&amp;gt; t_str(t_min 1), tracks =&amp;gt; t_array( t_min(1), # Array must have at least 1 entry t_of( t_hash( # All entries must be hashes t_with_keys(qw/name duration/), t_keys( name =&amp;gt; t_str, duration =&amp;gt; $duration)))))); this is code that builds a function that you can run and type check against any value.</description>
    </item>
    <item>
      <title>Moose Traits vs. Sq</title>
      <link>https://davidraab.github.io/posts/moose-traits-vs-sq/</link>
      <pubDate>Wed, 04 Dec 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/moose-traits-vs-sq/</guid>
      <description>Moose Traits vs. Sq (Explicit language) Did you ever hear of the Law of Demeter in object-orientation? Here is the idea behind it. Let&amp;rsquo;s assume we have a class, and that class has a property named options. This options is an array.&#xA;In procedural or functional programming we would just access that array and do whatever we wanna do with it. But somehow in object-orientation land people think this is bad.</description>
    </item>
    <item>
      <title>Benefits of Dynamic Typing</title>
      <link>https://davidraab.github.io/posts/benefits-of-dynamic-typing/</link>
      <pubDate>Thu, 28 Nov 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/benefits-of-dynamic-typing/</guid>
      <description>This is not a post about static typing vs. dynamic typing. In the several past years I have worked with both and see advantages and disadvantages in both dynamic and static typing. While this might be an interesting topic on its own, this is maybe for a future post.&#xA;No matter what you like or dislike more, some languages are built from the core being either static or dynamic typed. Perl, including other languages like Python, Ruby, JavaScript, Lisp, Lua, &amp;hellip; are built as a dynamic typed language.</description>
    </item>
    <item>
      <title>Algorithms: Filtering an Array (Benchmarks)</title>
      <link>https://davidraab.github.io/posts/algorithms-filtering-an-array-benchmarks/</link>
      <pubDate>Sat, 12 Oct 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/algorithms-filtering-an-array-benchmarks/</guid>
      <description>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 #!</description>
    </item>
    <item>
      <title>Algorithms: Filtering an Array</title>
      <link>https://davidraab.github.io/posts/algorithms-filtering-an-array/</link>
      <pubDate>Mon, 07 Oct 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/algorithms-filtering-an-array/</guid>
      <description>Let&amp;rsquo;s say we wanna filter an Array. In general that means we want to run some constraint on every element. The goal is to keep only the elements that fulfills the constraint.&#xA;This is a very easy task, and yet there are multiple ways on how todo that. Each solution offers different advantages and disadvantages.&#xA;But first let&amp;rsquo;s pick a concrete example. We just have an array of integers and we wanna keep only those that are even.</description>
    </item>
    <item>
      <title>Data vs. Interfaces</title>
      <link>https://davidraab.github.io/posts/data-vs-interfaces/</link>
      <pubDate>Tue, 17 Sep 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/data-vs-interfaces/</guid>
      <description>Intro When we face a problem, then we must admit one thing, there are always different kind of approaches how we can solve something. And on top of that, different kind of approaches have different kind of advantages and disadvantages.&#xA;Whatever you do, you will never find a perfect solution in the sense that this solution is best in everything.&#xA;Usually every advantage has its opposite disadvantage. For example for solving a problem there are usually different algorithm out there.</description>
    </item>
    <item>
      <title>interfaces in functional programming</title>
      <link>https://davidraab.github.io/posts/interfaces-in-functional-programming/</link>
      <pubDate>Wed, 04 Sep 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/interfaces-in-functional-programming/</guid>
      <description>Recently I worked with Raylib a graphics library for doing/learning game development. When I created multiple small demos there was one thing I wanted todo across multiple projects. I wanted to drag game objects on the screen. I already solved that problem once so now I just needed to create a general function that allowed me to drag any kind of object, instead of writing a specific solution again and again.</description>
    </item>
    <item>
      <title>GameDev: Implementing a Hash like structure</title>
      <link>https://davidraab.github.io/posts/gamedev-implementing-a-hash-like-structure/</link>
      <pubDate>Wed, 24 Jul 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/gamedev-implementing-a-hash-like-structure/</guid>
      <description>What Is Recently I implemented my own data-structure to optimize the storage of my components in a game. Okay its more an architecture i am exploring not a real game at the moment. I just try to render and move as many things as possible while i try to keep frames per second as high as possible.&#xA;For example rendering 10,000 boxes let them move in random directions, and change direction every second to a new random direction runs at 600 fps.</description>
    </item>
    <item>
      <title>Debian Tool: Purging config of removed packages</title>
      <link>https://davidraab.github.io/posts/debian-tool-purging-config-of-removed-packages/</link>
      <pubDate>Sat, 13 Jul 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/debian-tool-purging-config-of-removed-packages/</guid>
      <description>In Debian the following &amp;ldquo;problem&amp;rdquo; sometimes arrives. Let&amp;rsquo;s say you install for example Apache2, you do something with it but shortly after you don&amp;rsquo;t need it anymore. By default Debian always keeps all configuration files alive. So after installing Apache2 once, you are left with some configuration files in /etc/apache2/.&#xA;This is usually a good idea, because removing a package and re-installing shouldn&amp;rsquo;t delete all your configuration. But what do you do if you really want to delete the configuration because you really don&amp;rsquo;t need them anymore?</description>
    </item>
    <item>
      <title>OOP is Partial Application</title>
      <link>https://davidraab.github.io/posts/oop-is-partial-application/</link>
      <pubDate>Mon, 10 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/oop-is-partial-application/</guid>
      <description>In the past I spent a lot of time in different online forums, websites and so on. As I am interested in general about language design and learnt a lot of languages I also had many discussions with different programmers of different knowledge.&#xA;As I started programming with QBasic and C I am also used to procedural programming. The same goes for Perl. As of Perl 5 (1994) it also contains object-oriented programming, but still some parts of it are procedural.</description>
    </item>
    <item>
      <title>Example: F# List is Anemic</title>
      <link>https://davidraab.github.io/posts/example-f-list-is-anemic/</link>
      <pubDate>Thu, 06 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/example-f-list-is-anemic/</guid>
      <description>In my previous article Anemic Domain Model: Data and behaviour should be separated I explain why you should stick to an Anemic Domain Model and which benefits it offers.&#xA;In this article we look into F# to see how it applies there. F# has many built-in data-structures like many languages. One of the most used data-structure is the List data-structure.&#xA;When you follow a typical object-oriented solution then maybe you would end up with a List class, maybe you will consider some data as private, because the way how to manage a list should be managed by the class.</description>
    </item>
    <item>
      <title>Why map was not discovered in Object-Oriented Programming</title>
      <link>https://davidraab.github.io/posts/why-map-was-not-discovered-in-object-oriented-programming/</link>
      <pubDate>Wed, 05 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/why-map-was-not-discovered-in-object-oriented-programming/</guid>
      <description>When I started Perl programming back around 2003 one thing that Perl had, what most language didn&amp;rsquo;t, was the existence of the map function.&#xA;In today world of programming from JavaScript, C#, Java and so on, the concept nowadays is so common that nearly every language has it, and usually every programmers understands and use it.&#xA;That was not always the case. I can remember when LINQ was introduced in C# how a lot of people was complaining how from know on C# would be a language that nobody else never can read or understand anymore.</description>
    </item>
    <item>
      <title>Anemic Domain Model: Data and Behaviour should be separated</title>
      <link>https://davidraab.github.io/posts/anemic-domain-model-data-and-behaviour-should-be-separated/</link>
      <pubDate>Tue, 04 Jun 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/anemic-domain-model-data-and-behaviour-should-be-separated/</guid>
      <description>In the object-oriented world there is often a debate around the so called Anemic Domain Model. An Anemic Domain Model is when you clearly separate your data and your code.&#xA;In object-orientation this is usually considered bad, but when you look at procedural or functional-programming things change. They are seen as good practice you should follow. So who is right?&#xA;Rich Domain Model The opposite of an Anemic Domain Model is usually called a Rich Domain Model the idea of it goes as follow.</description>
    </item>
    <item>
      <title>Functions are interfaces</title>
      <link>https://davidraab.github.io/posts/functions-are-interfaces/</link>
      <pubDate>Thu, 30 May 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/functions-are-interfaces/</guid>
      <description>When I started to learn C# around 2013 there were certainly new things I came into contact. Some of them had todo with the fact that I primarily used Perl, a dynamic typed language, but in some sense the language features of Perl were also far ahead of C# back then, leading to different solutions and how you use a language.&#xA;Back at that time I realised that a lot of programmers were into a &amp;ldquo;newly&amp;rdquo; thing.</description>
    </item>
    <item>
      <title>Learning Lisp in 60 seconds</title>
      <link>https://davidraab.github.io/posts/learning-lisp-in-60-seconds/</link>
      <pubDate>Tue, 28 May 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/learning-lisp-in-60-seconds/</guid>
      <description>Do you wanna learn Lisp? If yes, you come to the right place. Do you know how to call a function/procedure in most languages? Yes right, like this.&#xA;1 function(arg1, arg2, arg3) This syntax is used in C, C++, Perl, Python, Java, &amp;hellip; you get it.&#xA;In a Lisp language you just put the starting ( before the function call and remove the commas.&#xA;1 (function arg1 arg2 arg3) There you have it, you have learned 100% of the syntax of a Lisp language.</description>
    </item>
    <item>
      <title>Perl Argument Aliasing</title>
      <link>https://davidraab.github.io/posts/perl-argument-aliasing/</link>
      <pubDate>Mon, 13 May 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/perl-argument-aliasing/</guid>
      <description>Different to many other languages Perl has an aliasing feature when you pass arguments to a function. As an example let&amp;rsquo;s see the following code.&#xA;1 2 3 sub increment { $_[0]++; } As probably known, all values in Perl are put into the @_ array. But when you directly modify one of these elements, then the original values are modified.&#xA;So executing the following.&#xA;1 2 3 4 5 6 7 my $x = 0; increment($x); say $x; increment($x); say $x; will print 1 and then 2.</description>
    </item>
    <item>
      <title>Class vs Hash</title>
      <link>https://davidraab.github.io/posts/class-vs-hash/</link>
      <pubDate>Wed, 08 May 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/class-vs-hash/</guid>
      <description>In my previous articles about object-orientation I explained how OO in general works. I used Perl for the explanation, as it doesn&amp;rsquo;t hide its itnernals like most other languages do. That&amp;rsquo;s Why I like Perl&amp;rsquo;s OO.&#xA;Usually OO works that we define a mutable data-structure and pass it to a function that mutates it. So in some sense calling func($obj, $arg1) is the same as $obj-&amp;gt;func($arg1). It&amp;rsquo;s just a different syntax and order we write, but the concept is the same.</description>
    </item>
    <item>
      <title>Why I Like Perl&#39;s OO</title>
      <link>https://davidraab.github.io/posts/why-i-like-perls-oo/</link>
      <pubDate>Mon, 15 Apr 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/why-i-like-perls-oo/</guid>
      <description>I started programming with QBasic and later C. While it was difficult to learn those languages back then (with no internet and just some books) nothing felt &amp;ldquo;out of place&amp;rdquo; for me.&#xA;For example, when I learned about arrays the first time, it took some time to learn the concept of it, that it is a storage of multiple elements one after another. How it is used and what you can do with it.</description>
    </item>
    <item>
      <title>Insanity of Object-Oriented Programming</title>
      <link>https://davidraab.github.io/posts/insanity-of-oo/</link>
      <pubDate>Sat, 16 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/insanity-of-oo/</guid>
      <description>The insanity of Object-Oriented Programming I started programming back in the 1990s. My first language I learned was QBasic and after 2 days of learning it, i switched to C. Back in these days there was no Internet. Okay, it existed but was not so common as today. Most people still didn&amp;rsquo;t even had computers.&#xA;I picked and learned C because when you got to the programming section in a store it was full of C books.</description>
    </item>
    <item>
      <title>Seq::Manual::FromSub</title>
      <link>https://davidraab.github.io/posts/perl-seq-seq-manual-fromsub/</link>
      <pubDate>Tue, 21 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/perl-seq-seq-manual-fromsub/</guid>
      <description>Seq::Manual::FromSub A deeper explanation how Seq-&amp;gt;from_sub works.&#xA;THE PROBLEM You could write the following in Perl&#xA;1 Seq-&amp;gt;wrap(1 .. 10_000_000) but it would be a bad idea. Perls range operator is non-lazy. When you call the above code perl will create an array with 10 Mio numbers and then pass that 10 Mio numbers to Seq-&amp;gt;wrap.&#xA;This is not only time-consuming, it will also use a lot of memory. Maybe with a bigger number your program or your computer could even crash with out of memory.</description>
    </item>
    <item>
      <title>Perl Sq: bind &amp; cartesian</title>
      <link>https://davidraab.github.io/posts/perl-sq-bind-and-cartesian/</link>
      <pubDate>Mon, 20 Nov 2023 20:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/perl-sq-bind-and-cartesian/</guid>
      <description>The cartesian function returns the Cartesian Product. The Cartesian Product is the combination of all possible values.&#xA;1 2 3 4 5 my $data = Seq::cartesian( Seq-&amp;gt;wrap(qw/clubs spades hearts diamond/), Seq-&amp;gt;wrap(qw/7 8 9 10 B D K A/), )-&amp;gt;to_array; Calling to_array will evaluate the expression and generates the following Perl data-structure.&#xA;1 2 3 4 5 6 7 8 9 10 [ [&amp;#39;clubs&amp;#39; ,&amp;#39;7&amp;#39;],[&amp;#39;clubs&amp;#39; ,&amp;#39;8&amp;#39;],[&amp;#39;clubs&amp;#39; ,&amp;#39;9&amp;#39;],[&amp;#39;clubs&amp;#39; ,&amp;#39;10&amp;#39;], [&amp;#39;clubs&amp;#39; ,&amp;#39;B&amp;#39;],[&amp;#39;clubs&amp;#39; ,&amp;#39;D&amp;#39;],[&amp;#39;clubs&amp;#39; ,&amp;#39;K&amp;#39;],[&amp;#39;clubs&amp;#39; ,&amp;#39;A&amp;#39; ], [&amp;#39;spades&amp;#39; ,&amp;#39;7&amp;#39;],[&amp;#39;spades&amp;#39; ,&amp;#39;8&amp;#39;],[&amp;#39;spades&amp;#39; ,&amp;#39;9&amp;#39;],[&amp;#39;spades&amp;#39; ,&amp;#39;10&amp;#39;], [&amp;#39;spades&amp;#39; ,&amp;#39;B&amp;#39;],[&amp;#39;spades&amp;#39; ,&amp;#39;D&amp;#39;],[&amp;#39;spades&amp;#39; ,&amp;#39;K&amp;#39;],[&amp;#39;spades&amp;#39; ,&amp;#39;A&amp;#39; ], [&amp;#39;hearts&amp;#39; ,&amp;#39;7&amp;#39;],[&amp;#39;hearts&amp;#39; ,&amp;#39;8&amp;#39;],[&amp;#39;hearts&amp;#39; ,&amp;#39;9&amp;#39;],[&amp;#39;hearts&amp;#39; ,&amp;#39;10&amp;#39;], [&amp;#39;hearts&amp;#39; ,&amp;#39;B&amp;#39;],[&amp;#39;hearts&amp;#39; ,&amp;#39;D&amp;#39;],[&amp;#39;hearts&amp;#39; ,&amp;#39;K&amp;#39;],[&amp;#39;hearts&amp;#39; ,&amp;#39;A&amp;#39; ], [&amp;#39;diamond&amp;#39;,&amp;#39;7&amp;#39;],[&amp;#39;diamond&amp;#39;,&amp;#39;8&amp;#39;],[&amp;#39;diamond&amp;#39;,&amp;#39;9&amp;#39;],[&amp;#39;diamond&amp;#39;,&amp;#39;10&amp;#39;], [&amp;#39;diamond&amp;#39;,&amp;#39;B&amp;#39;],[&amp;#39;diamond&amp;#39;,&amp;#39;D&amp;#39;],[&amp;#39;diamond&amp;#39;,&amp;#39;K&amp;#39;],[&amp;#39;diamond&amp;#39;,&amp;#39;A&amp;#39; ], ] The implementation of Seq::cartesian.</description>
    </item>
    <item>
      <title>Perl Sq: Seq in combination with I/O</title>
      <link>https://davidraab.github.io/posts/seq-in-combination-with-io/</link>
      <pubDate>Mon, 20 Nov 2023 01:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/seq-in-combination-with-io/</guid>
      <description>In one of my programs I already use my module. This program creates a new test-file in the &amp;rsquo;t&amp;rsquo; folder from a template. From all files in that directory I want to automatically pick the next highest number. I don&amp;rsquo;t want to search for the number myself.&#xA;So here is how i read all files from disk and only pick files matching the pattern &amp;ldquo;%d-$title.t&amp;rdquo;. Then i want the maximum number.</description>
    </item>
    <item>
      <title>Perl Sq: bind &amp; flatten</title>
      <link>https://davidraab.github.io/posts/perl-seq-module-bind-flatten/</link>
      <pubDate>Sun, 19 Nov 2023 02:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/perl-seq-module-bind-flatten/</guid>
      <description>I implemented the bind function in my Perl Seq Module. bind is a very useful function. For example here is flatten that I implemented with it.&#xA;flatten Flatten takes a sequence of sequences and returns a single sequence.&#xA;1 2 3 4 5 6 my $flattened = Seq-&amp;gt;wrap( Seq-&amp;gt;wrap(1,1), Seq-&amp;gt;wrap(2,3,5,8,13), ) -&amp;gt;flatten; This is how a non-lazy Perl implemenation would look like:&#xA;1 2 3 4 5 6 7 8 9 sub flatten($aoa) { my @flattened; for my $outer ( @$aoa ) { for my $inner ( @$outer ) { push @flattened, $inner; } } return \@flattened; }; Using it looks very similar.</description>
    </item>
    <item>
      <title>Shape of my Heart</title>
      <link>https://davidraab.github.io/posts/shape-of-my-heart/</link>
      <pubDate>Sun, 19 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/shape-of-my-heart/</guid>
      <description>Here are two programs that produces the same result.&#xA;This is something I would have written without my Sq module.&#xA;1 2 3 4 5 6 [ (map { [clubs =&amp;gt; $_ ] } qw/7 8 9 10 J Q K A/), (map { [spades =&amp;gt; $_ ] } qw/7 8 9 10 J Q K A/), (map { [hearts =&amp;gt; $_ ] } qw/7 8 9 10 J Q K A/), (map { [diamond =&amp;gt; $_ ] } qw/7 8 9 10 J Q K A/), ] With my module, i now can write the same in this way.</description>
    </item>
    <item>
      <title>Assigning variables</title>
      <link>https://davidraab.github.io/posts/assigning-variables/</link>
      <pubDate>Sat, 18 Nov 2023 02:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/assigning-variables/</guid>
      <description>This is how you assign a value from right to left.&#xA;1 2 my $x = 1; ... this is how you assign a value from left to right.&#xA;Perl 1 do_something(12, sub ($x) { ... }); JavaScript 1 do_something(1, function(x) { ... }) F# 1 doSomething 1 (fun x -&amp;gt; ... ) </description>
    </item>
    <item>
      <title>Perl Sq: Three ways of doing Fibonacci</title>
      <link>https://davidraab.github.io/posts/sq-fibonacci-with-seq/</link>
      <pubDate>Sat, 18 Nov 2023 01:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/sq-fibonacci-with-seq/</guid>
      <description>Hi there, I am developing a new Perl module to bring a lazy Sequence to Perl.&#xA;It should provide the functionaly you see in C# LINQ or Java 8 Stream. The origin of those interfaces comes from functional programming. Thus i decided to primarily pick the F# API and port it to Perl.&#xA;I already implemented a useful set of functions. Here is an example of the module and what you can do with it.</description>
    </item>
    <item>
      <title>Linux Tool: Searching for a Linux Command</title>
      <link>https://davidraab.github.io/posts/searching-for-a-linux-command/</link>
      <pubDate>Sat, 04 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/searching-for-a-linux-command/</guid>
      <description>Lately I wanted to search for a Linux Command.&#xA;I didn&amp;rsquo;t knew the exact command, only that there must be a &amp;ldquo;wacom&amp;rdquo; in it. A configuration tool to set some more details of my wacom tablet. So I thought.&#xA;Hey, just collect all binary files in all the directores in the PATH Environment of Linux. The Path environment is divided with colons. Just let me give it a Regex it can match against.</description>
    </item>
    <item>
      <title>Object-Oriented Programming in C</title>
      <link>https://davidraab.github.io/posts/object-oriented-programming-in-c/</link>
      <pubDate>Wed, 01 Nov 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/object-oriented-programming-in-c/</guid>
      <description>Let&amp;rsquo;s do object-oriented programming in C. First of I am creating an easy example for an Vector2 type. To define a Vector2 in C we use a struct.&#xA;1 2 3 4 struct Vector2 { int X; int Y; }; When you know C#, you are already familiar with a struct. A struct is a value-type in C. It always gets copied as a whole. In C# we have a class that is a reference-type but this doesn&amp;rsquo;t exist in C.</description>
    </item>
    <item>
      <title>Creating a real enum Type in Perl</title>
      <link>https://davidraab.github.io/posts/creating-a-real-enum-type-in-perl/</link>
      <pubDate>Sun, 29 Oct 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/creating-a-real-enum-type-in-perl/</guid>
      <description>In my previous article about Metaprogramming in Perl I show how to implement an enum() function that creates real special values that are distinct from each other.&#xA;When I called enum(&#39;red&#39;, &#39;green&#39;, &#39;blue&#39;) it created two functions for every passed string. red() and is_red() for the red string. red() returns the special value and is_red($value) checks if $value is our special value.&#xA;But currently it does not completely satisfy being an enum.</description>
    </item>
    <item>
      <title>Meta-Programming in Perl</title>
      <link>https://davidraab.github.io/posts/meta-programming-in-perl/</link>
      <pubDate>Thu, 26 Oct 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/meta-programming-in-perl/</guid>
      <description>In my last article about Special Values in Perl I explained how we can create true distinct values that can be safely distinguished by other values. The final result looked like this:&#xA;1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 use Scalar::Util qw(refaddr reftype); # Special values Red, Green and Blue { # &amp;lt;-- this creates a new lexical-scope my ($red, $green, $blue) = ([], [], []); sub red { $red } sub green { $green } sub blue { $blue } my $is_color = sub { my ($source, $color) = @_; my $type = reftype($source) // &amp;#39;&amp;#39;; return ( $type eq &amp;#39;ARRAY&amp;#39; and refaddr($source) == refaddr($color) ) ?</description>
    </item>
    <item>
      <title>Special values in Perl</title>
      <link>https://davidraab.github.io/posts/special-values-in-perl/</link>
      <pubDate>Wed, 25 Oct 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/special-values-in-perl/</guid>
      <description>Sometimes in programming we want to create special values that are distinct to anything else. Consider the following problem. We want to create a print_colored function, that can be given special values to change the terminal color. Here is one way to do it:&#xA;1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 use Term::ANSIColor qw(color); my $red = &amp;#34;RED&amp;#34;; my $green = &amp;#34;GREEN&amp;#34;; my $blue = &amp;#34;BLUE&amp;#34;; sub print_colored { for my $line ( @_ ) { print(color(&amp;#39;red&amp;#39;)) &amp;amp;&amp;amp; next if $line eq $red; print(color(&amp;#39;green&amp;#39;)) &amp;amp;&amp;amp; next if $line eq $green; print(color(&amp;#39;blue&amp;#39;)) &amp;amp;&amp;amp; next if $line eq $blue; print $line; } } print_colored($green, &amp;#34;red&amp;#34;, &amp;#34;\n&amp;#34;, $blue, &amp;#34;foo\n&amp;#34;); This solution successfully prints the string &amp;ldquo;red&amp;rdquo; in the green color and &amp;ldquo;foo&amp;rdquo; in the blue color.</description>
    </item>
    <item>
      <title>Perl vs. JavaScript: Scalar and List Context</title>
      <link>https://davidraab.github.io/posts/perl-vs-javascript-scalar-and-list-context/</link>
      <pubDate>Fri, 20 Oct 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/perl-vs-javascript-scalar-and-list-context/</guid>
      <description>Something I like in Perl, and also dislike sometimes, is Perl distinction between Scalar- and List Context. Something I haven&amp;rsquo;t seen in any other language so far. In Perl any function call can happen in two different context. And depending on the context a function can return different things, or even behave differently. But it also effects how arguments are passed to a function.&#xA;Let&amp;rsquo;s see an example. I want to write an easy sum function that sums up all numbers given to it.</description>
    </item>
    <item>
      <title>Installing perl with perlbrew</title>
      <link>https://davidraab.github.io/posts/installing-perl-with-perlbrew/</link>
      <pubDate>Fri, 17 Feb 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/installing-perl-with-perlbrew/</guid>
      <description>Today every Linux system mostly already ships Perl including a lot of modules. While this can be totally fine sometimes maybe you want to switch to a newer Perl version. Or maybe even an older version to test a module with an older Perl version for compatibility?&#xA;perlbrew is a tool that helps installing multiple Perl environments and gives you the ability to switch between them. Installing your own Perl also means you don&amp;rsquo;t mess with the system installed Perl and you are able to install any new module directly from CPAN.</description>
    </item>
    <item>
      <title>Closures in F#, C#, Perl, JavaScript and Racket</title>
      <link>https://davidraab.github.io/posts/closures-in-fsharp-csharp-perl-javascript-and-racket/</link>
      <pubDate>Wed, 15 Feb 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/closures-in-fsharp-csharp-perl-javascript-and-racket/</guid>
      <description>Today, more and more languages supports functions as first-class values. This means a function is just a value like any other. You can pass functions as arguments to functions, but you are also able to create functions and return them from functions.&#xA;Whenever this is done we have to think about the life-time of variables. Usually all variables are lexical scoped. Consider the following example.&#xA;F# C# Perl JavaScript Racket 1 2 3 let add10 y = let x = 10 x + y 1 2 3 4 public static int Add10(int y) { var x = 10; return x + y; } 1 2 3 4 sub add10($y) { my $x = 10; return $x + $y; } 1 2 3 4 function add10(y) { const x = 10; return x + y; } 1 2 3 4 (define (add10 y) (define x 10) (+ x y) ) In the example the variable x is created only temporary when the function is being executed.</description>
    </item>
    <item>
      <title>What is Dependency injection?</title>
      <link>https://davidraab.github.io/posts/what-is-dependency-injection/</link>
      <pubDate>Wed, 11 Jan 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/what-is-dependency-injection/</guid>
      <description>On Reddit i came to a question about someone who had problems understanding Dependency Injection. He provided the following code.&#xA;1 2 3 4 5 6 7 8 9 10 11 12 public class Wheel { public Wheel() {} public void moveleft() {} } public class Car { private Wheel wheel; public Car (Wheel wheel) { this.wheel = wheel; } } The question is: Is this usage of Wheel in Car Dependency injection?</description>
    </item>
    <item>
      <title>Perl Regex Parsing with the g option</title>
      <link>https://davidraab.github.io/posts/perl-regex-parsing-with-g-option/</link>
      <pubDate>Sat, 07 Jan 2023 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/perl-regex-parsing-with-g-option/</guid>
      <description>Perl regexes have the /g modifier that is worth knowing about, as you can do a lot of advanced things with this modifier. But here are the basics first.&#xA;Context First we need to understand that Perl has two different contexts and in both contexts the /g modifier works differently.&#xA;List context Let&amp;rsquo;s see list context first. We can enforce list context by assigning to an array.&#xA;Without the /g option a regex just finds its first match and just returns it.</description>
    </item>
    <item>
      <title>Are dynamic-typed languages really faster to develop in?</title>
      <link>https://davidraab.github.io/posts/are-dynamic-typed-languages-really-faster-to-develop/</link>
      <pubDate>Fri, 02 Dec 2022 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/are-dynamic-typed-languages-really-faster-to-develop/</guid>
      <description>On Reddit i came about a discussion of dynamic typed (functional) languages. A user suggested that in a dynamic typed language it might be easier to return different types for a function call and thus overall the development can be faster. He concluded.&#xA;Having not to deal with types in that way when you refactor or build a system makes you significantly faster. Combine that with a proper testing approach and you have a reason to use dynamically typed languages.</description>
    </item>
    <item>
      <title>Map operates on functions!</title>
      <link>https://davidraab.github.io/posts/map-operates-on-functions/</link>
      <pubDate>Thu, 27 Oct 2022 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/map-operates-on-functions/</guid>
      <description>map operates on functions not on data-types like list.&#xA;When I started learning F# I had some problems understanding the map function. Don&amp;rsquo;t get me wrong. As a Perl programmer map is built into the core language (long before other languages adopted the idea) and I used and understanded it very well in Perl. This map is the same as List.map that I also immediately understood.&#xA;But in F# you will encounter Result.</description>
    </item>
    <item>
      <title>Optional Generic Equality on a Data-Type in F#</title>
      <link>https://davidraab.github.io/posts/optional-generic-equality/</link>
      <pubDate>Tue, 25 Oct 2022 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/optional-generic-equality/</guid>
      <description>Lately I implemented my own immutable Queue and came upon a problem implementing equality for it. The problem goes like this: You want a generic data-type that supports equality. But it only should support equality if the generic type also supports equality.&#xA;Seems a little bit weird? But this is actually a common problem in F# that is already solved without that you probably even noticed that this is a problem.</description>
    </item>
    <item>
      <title>Understanding Fold</title>
      <link>https://davidraab.github.io/posts/understanding-fold/</link>
      <pubDate>Sun, 19 Mar 2017 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/understanding-fold/</guid>
      <description>A very important function in List-processing is the List.fold function. List.fold is a very powerful function that gives you a lot of flexibility to do any kind of list transformation. The disadvantage is that this kind of power makes understanding List.fold a lot harder. In this article we look at some visualizations to better understand List.fold.&#xA;First we need to understand how we visualize a function. A function has some inputs and one output and we visualize it as a box with the inputs on the top and the output on the bottom.</description>
    </item>
    <item>
      <title>Variable Arguments in F#</title>
      <link>https://davidraab.github.io/posts/variable-arguments-in-fsharp/</link>
      <pubDate>Mon, 13 Mar 2017 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/variable-arguments-in-fsharp/</guid>
      <description>One question that appears in F# from time to time is: How do you create a function that expects a variable amount of arguments?&#xA;A short answer is: You can&amp;rsquo;t do that.&#xA;A longer and correct answer: You can do it with (static) methods. But you probably don&amp;rsquo;t want to use this and look for an alternative.&#xA;First we should look at the difference between an F# function and a (static) method.</description>
    </item>
    <item>
      <title>Mutability vs. Immutability: Valid objects</title>
      <link>https://davidraab.github.io/posts/mutabaility-vs-immutability-validation/</link>
      <pubDate>Mon, 27 Feb 2017 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/mutabaility-vs-immutability-validation/</guid>
      <description>I already wrote an article that explains immutability, but one thing I hand-waved was the benefits of immutability and why you should program with immutable values.&#xA;In this article I talk about those benefits by trying to maintaining valid objects at all time and show how we can achieve it with mutability and immutability.&#xA;One question might be why I&amp;rsquo;m not just showing the immutable part. I could do this, but the problem I see is that it isn&amp;rsquo;t so obvious how hard the mutable part really is.</description>
    </item>
    <item>
      <title>Function Application and Composition</title>
      <link>https://davidraab.github.io/posts/function-application-and-composition/</link>
      <pubDate>Sun, 25 Sep 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/function-application-and-composition/</guid>
      <description>Function application is probably one of those terms in functional programming that sounds more scarier as the topic really is. The idea behind functional application just means that we execute a function to get the result. Let&amp;rsquo;s take the example of calculating the square root of 2.0. We can write the following in F# to do that:&#xA;1 let x = sqrt 2.0 The interesting part is how we read this example.</description>
    </item>
    <item>
      <title>Catamorphisms</title>
      <link>https://davidraab.github.io/posts/catamorphisms/</link>
      <pubDate>Sat, 28 May 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/catamorphisms/</guid>
      <description>Up to this point I created various articles about fold, in my Series I also created a category named Fold (Catamorphisms) but up till now I didn&amp;rsquo;t explained how this articles related to each other, or what Catamorphisms mean. In this article I want to talk about the remaining parts.&#xA;The List Catamorphisms is a generalization that emerged from the list data-structure. The list data-structure, how it is found in functional programming, is usually build as a single linked list.</description>
    </item>
    <item>
      <title>Monoids</title>
      <link>https://davidraab.github.io/posts/monoids/</link>
      <pubDate>Tue, 24 May 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/monoids/</guid>
      <description>A monoid is a simple concept. It is a generalization of some patterns that you very likely already have seen. Being aware of those can help in designing some operations and can simplify things. Without much further ado let us look at three simple math equations.&#xA;1 + 2 = 3 (1 + 2) + 3 = 1 + (2 + 3) 1 + 0 = 0 + 1 Binary Operations When we look at the first equation we just see the following: There exists some kind of binary operation that takes two things of the same type, and somehow combines those two things into one result of the same type.</description>
    </item>
    <item>
      <title>Introduction to Functional Programming</title>
      <link>https://davidraab.github.io/posts/introduction-to-functional-programming/</link>
      <pubDate>Wed, 11 May 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/introduction-to-functional-programming/</guid>
      <description>In this article I want to give a general introduction to some of the fundamental ideas of functional programming. I just start with the idea of function as data, and explain why functions are viewed as data and why it makes sense to pass functions as arguments.&#xA;When we understand this concept, I start explaining lambda expression, currying, partial application and closures. All of this ideas built on each other.</description>
    </item>
    <item>
      <title>The Option Module</title>
      <link>https://davidraab.github.io/posts/option-module/</link>
      <pubDate>Wed, 11 May 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/option-module/</guid>
      <description>The Option type is a well known and often used type, but at least for me, most of the time I just used Option.map and Option.bind and ignored functions like Option.exists, Option.filter, Option.fold and so on. I spent some time with those functions to understand when those are useful.&#xA;defaultArg The first function i look at is actually not in the Option module. It is the defaultArg function. With defaultArg we can extract an option type and provide a default value in the case we had no value.</description>
    </item>
    <item>
      <title>CPS fold -- fold with early exit</title>
      <link>https://davidraab.github.io/posts/cps-fold/</link>
      <pubDate>Sat, 07 May 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/cps-fold/</guid>
      <description>The most general function to traverse a data-structures is the fold function. But fold has one problem that is sometimes not optimal. It always traverses the whole data-structure and we cannot abort the recusion early.&#xA;But sometimes, that is exactly what we want to do. For example when we want to search for a specific element in a list, when we found it, we don&amp;rsquo;t want to go through the remaing list.</description>
    </item>
    <item>
      <title>Algebraic Data-Types</title>
      <link>https://davidraab.github.io/posts/algebraic-data-types/</link>
      <pubDate>Tue, 26 Apr 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/algebraic-data-types/</guid>
      <description>When we work in a programming language we usually have some primitive data-types likes int, float, string, bool and so on. All of those are important, but when we need to create more advanced logic we usually want to create our own data-types and group/compose different types together to create new data-types.&#xA;In an algebraic type-system there exists two different ways in how we can compose types. They are named Product-types and Sum-type.</description>
    </item>
    <item>
      <title>Continuations and foldBack</title>
      <link>https://davidraab.github.io/posts/continuations-and-foldback/</link>
      <pubDate>Sat, 16 Apr 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/continuations-and-foldback/</guid>
      <description>In From mutable loops to immutable folds we implemented foldBack through rev and fold. In this post I show you how you can implement foldBack by using a continuation function.&#xA;Functions Before we see how to implement foldBack, I want to give you analogy first. This analogy helped me in a lot of cases. I hope that this analogy will also help you in better understanding the further post, or probably even in other areas in programming in general.</description>
    </item>
    <item>
      <title>Sequence and Traverse</title>
      <link>https://davidraab.github.io/posts/sequence-and-traverse/</link>
      <pubDate>Thu, 14 Apr 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/sequence-and-traverse/</guid>
      <description>One problem that appears from time to time is that we we have some kind of collection (I use list here) and we want to map every element with a monadic function &#39;a -&amp;gt; M&amp;lt;&#39;b&amp;gt;. This then returns a list&amp;lt;M&amp;lt;&#39;a&amp;gt;&amp;gt;. But often we want a M&amp;lt;list&amp;lt;&#39;a&amp;gt;&amp;gt;.&#xA;To be more concrete. Let&amp;rsquo;s assume we want to turn a list of strings into integers. We could write a tryParseInt function that does string -&amp;gt; option&amp;lt;int&amp;gt;.</description>
    </item>
    <item>
      <title>Applicative: Lists</title>
      <link>https://davidraab.github.io/posts/applicative-list/</link>
      <pubDate>Wed, 13 Apr 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/applicative-list/</guid>
      <description>In Applicative Functors I primarily used the Option type to show how you implement and use an Applicative Functor. But the concept also works for any other type. This time I want to show you the idea of an Applicative with a list, what it means, what you can do with it and how apply works.&#xA;Implementing apply Currently the List module don&amp;rsquo;t offer a apply function. So we must write it on our own.</description>
    </item>
    <item>
      <title>Optionals</title>
      <link>https://davidraab.github.io/posts/optionals-app/</link>
      <pubDate>Mon, 11 Apr 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/optionals-app/</guid>
      <description>In this post I want to talk about Optionals more deeply. I already wrote about null, but I noticed that it is still not immediately clear on why Optionals are better. Instead of focusing why null is bad, this time I want to focus why Optionals are good. For this purpose I also wrote a small application that I will cover. But first, let&amp;rsquo;s go over Optionals and see which benefits they have.</description>
    </item>
    <item>
      <title>From mutable loops to immutable folds</title>
      <link>https://davidraab.github.io/posts/loops-to-folds/</link>
      <pubDate>Tue, 05 Apr 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/loops-to-folds/</guid>
      <description>When we ask of key-features of functional programming, you will probably hear two things most often. Immutability and recursion. But why is that so? As Immutability also becomes more important in OO languages you will probably find a lot of reason for that one, but why are recursive functions so important? The short answer is, because of Immutability! To understand the connection between those, let&amp;rsquo;s start with some code that uses loops with mutation.</description>
    </item>
    <item>
      <title>Understanding bind</title>
      <link>https://davidraab.github.io/posts/understanding-bind/</link>
      <pubDate>Sun, 03 Apr 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/understanding-bind/</guid>
      <description>In Understanding map we learned that implementing a map function is what we call a Functor. In Applicative Functors we extended that idea with the return and apply function and we call the result an Applicative Functor. The next important function in our toolset is the bind function.&#xA;Monads The combination of return and bind is what we call a Monad. But currently I will not consider this as an introduction to Monads at all.</description>
    </item>
    <item>
      <title>Applicative Functors</title>
      <link>https://davidraab.github.io/posts/applicative-functors/</link>
      <pubDate>Thu, 31 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/applicative-functors/</guid>
      <description>In my previous article Understanding map I introduced the map function and described that implementing map and fulfilling two laws we get what we call a Functor. In this Post we discuss the apply function that we can view as an extension to the map function.&#xA;Problem with map It might be that you have noticed one problem with map. map only can work with one-argument functions! The definition of map expects a function &#39;a -&amp;gt; &#39;b as it&amp;rsquo;s first argument.</description>
    </item>
    <item>
      <title>Understanding map</title>
      <link>https://davidraab.github.io/posts/understanding-map/</link>
      <pubDate>Sun, 27 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/understanding-map/</guid>
      <description>One important function in functional programming is the map function. When I learned F# I must admit that I had some problems first, understanding it. The problem was, I already knew the map function from dozens of other languages. Or to say it correctly, I mostly learned a wrong explanation of map.&#xA;The typical explanation I&amp;rsquo;m talking about often goes something like this: map takes a function and a list. It applies the function to every element in the list, and returns a new list.</description>
    </item>
    <item>
      <title>Exceptions are Evil</title>
      <link>https://davidraab.github.io/posts/exceptions-are-evil/</link>
      <pubDate>Fri, 25 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/exceptions-are-evil/</guid>
      <description>Most people today agree that null is evil, and they try to get rid of them. One technique that most people prefer is to throw an exception in the case of an error, or if we cannot return a valid value from a function. The problem is, exceptions are not any kind better than null, and they don&amp;rsquo;t solve any problem that null introduced.&#xA;In my previous post null is Evil i mentioned seven problems that null introduced.</description>
    </item>
    <item>
      <title>Higher-kinded Polymorphism: What is it, why you want it</title>
      <link>https://davidraab.github.io/posts/higher-kinded-polymorphism/</link>
      <pubDate>Thu, 24 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/higher-kinded-polymorphism/</guid>
      <description>One aspect of a programming language that is often noted as important is the idea of Polymorphism. But there doesn&amp;rsquo;t exists just one type of polymorphism. In functional languages Parametric Polymorphism (aka Generics) is often used. Haskell was the first language that introduced &amp;ldquo;Higher-kinded polymorphism&amp;rdquo;. Sadly, F# don&amp;rsquo;t support this kind of polymorphism directly. Actually it only has partial support for it. So let&amp;rsquo;s look in what it is, and why you want it.</description>
    </item>
    <item>
      <title>null is Evil</title>
      <link>https://davidraab.github.io/posts/null-is-evil/</link>
      <pubDate>Sun, 20 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/null-is-evil/</guid>
      <description>Tony Hoare once said: I call it my billion-dollar mistake. It was the invention of the null reference in 1965. So, why did he added &amp;ldquo;null&amp;rdquo; in the first place? Why was it such a big mistake. And if it is such a big mistake, what are the alternatives?&#xA;The purpose of null To understand why it was a mistake, let&amp;rsquo;s look why it was even added in the first place.</description>
    </item>
    <item>
      <title>Understanding Immutability and Pure Functions (for OOP)</title>
      <link>https://davidraab.github.io/posts/immutability-and-functions/</link>
      <pubDate>Mon, 14 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/immutability-and-functions/</guid>
      <description>One important concept in functional programming is immutability. But also in object-oriented programming immutability and so called immutable objects getting more attention. The problem that I see especially from object-oriented programmers are really bad explanations. A lot of explanation I had see described it like this: Just create a class and make all fields readonly (final or const) and you have an immutable object.&#xA;Explanations like these are horrible. Such explanations are so simplified that I would even call them wrong.</description>
    </item>
    <item>
      <title>Introduction to F#</title>
      <link>https://davidraab.github.io/posts/introduction-fsharp/</link>
      <pubDate>Thu, 10 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/introduction-fsharp/</guid>
      <description>When I remember the first time I looked at functional(-first) languages like F#, ML, Haskell and others. The typical reaction that I had, and I always see from other people is: This is unreadable, it must be hard to read, it feels complicated and hard.&#xA;After spending some time in F# I cannot agree to that at all anymore. Often the syntax itself is easier (for example compared to C#), shorter and in my opinion more readable.</description>
    </item>
    <item>
      <title>Applying Structured Programming</title>
      <link>https://davidraab.github.io/posts/applying-structured-programming/</link>
      <pubDate>Wed, 09 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/applying-structured-programming/</guid>
      <description>In my previous post about Structured Programming I talked about that basic looping constructs fold. But this is still to powerful. In the sense of readability we should try to eliminate them with more specific ones. In this post I go through a toy example to show the various ways on how to refactor some code.&#xA;The Toy Example Recently I had some conversation about code in a game and providing some kind of critical hit-chance in a game.</description>
    </item>
    <item>
      <title>Structured Programming</title>
      <link>https://davidraab.github.io/posts/structured-programming/</link>
      <pubDate>Wed, 09 Mar 2016 00:00:00 +0000</pubDate>
      <guid>https://davidraab.github.io/posts/structured-programming/</guid>
      <description>Back in 1968 Edsger W. Dijkstra wrote an open letter named &amp;ldquo;Go To Statement Considered Harmful&amp;rdquo;. As already suggested from the title, the very idea was to raise consciousness that the goto statement is more harmful then helpful. From today view we would expect that this idea catches fire really fast, but it didn&amp;rsquo;t. It took quite a long time. Even during all the 1970s and 1980s that question was debated a lot.</description>
    </item>
  </channel>
</rss>
