<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>J3RN's Blog</title><link>https://j3rn.com/</link><description>Recent content on J3RN's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 01 Nov 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://j3rn.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Avoiding a GenServer Pitfall</title><link>https://j3rn.com/posts/a-genserver-pitfall/</link><pubDate>Sat, 01 Nov 2025 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/a-genserver-pitfall/</guid><description>&lt;h1 id="firstly-what-is-a-genserver" class="relative group">Firstly, what is a GenServer? &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#firstly-what-is-a-genserver" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h1>&lt;p>GenServer, short for &amp;ldquo;generic server&amp;rdquo;, is a type of process within BEAM (Erlang, Elixir) applications that can hold state and respond to requests; much like a web server, in a way. For instance, you could create a GenServer that you could handle requests to store blog posts as well as other requests to list or read those blog posts—but those request would have to be made within the BEAM VM rather than with a web browser. Within BEAM applications, the two primary purposes of GenServers are to execute code asynchronously and act as a store of shared, mutable state.&lt;/p></description></item><item><title>My API Integration Methodology</title><link>https://j3rn.com/posts/api-integration-design/</link><pubDate>Sun, 27 Jul 2025 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/api-integration-design/</guid><description>&lt;p>The code examples in this post are in Elixir, and some of the design aspects are Elixir-specific, but the concepts are translatable to most languages.&lt;/p>
&lt;p>A common aspect of modern web applications is the need to communicate with other web applications in what is usually referred to as &amp;ldquo;API integrations&amp;rdquo;. For example, consider &lt;a href="https://stripe.com" target="_blank" rel="noreferrer">Stripe&lt;/a>. Stripe is a payment processor service that handles the complicated parts of accepting payments. If your app is being extended to have a checkout experience for customers, you might integrate with Stripe to accomplish that.&lt;/p></description></item><item><title>Paper Review: *Compiling Routines* by Richard K. Ridgway, 1952</title><link>https://j3rn.com/paper-review/compiling-routines/</link><pubDate>Tue, 17 Jun 2025 00:00:00 +0000</pubDate><guid>https://j3rn.com/paper-review/compiling-routines/</guid><description>&lt;h2 id="compiling-routines" class="relative group">&lt;a href="https://dl.acm.org/doi/pdf/10.1145/800259.808980" target="_blank" rel="noreferrer">Compiling Routines&lt;/a> &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#compiling-routines" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;h3 id="richard-k-ridgway-1952" class="relative group">Richard K. Ridgway, 1952 &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#richard-k-ridgway-1952" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h3>&lt;p>&lt;em>Compiling Routines&lt;/em> is a short paper (3 paged of text, 2 pages of figures) that describes one of the first compilers, termed &amp;ldquo;A-0&amp;rdquo;. A-0 is also referred to as &amp;ldquo;the antique compiler&amp;rdquo; in the paper as, apparently, newer compilers had been developed.&lt;/p></description></item><item><title>Object Orientation and the Limits of Metaphor</title><link>https://j3rn.com/posts/object-orientation-limits-of-metaphor/</link><pubDate>Sun, 13 Apr 2025 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/object-orientation-limits-of-metaphor/</guid><description>&lt;p>Roughly ten years ago, I was very excited about object orientation. Which made me somewhat late to the party; glowing pronouncements of how object orientation was going to solve the software complexity crisis had flooded industry publications some two decades prior. Regardless, in 2014, I was trying to explain to a friend why objects were so grand.&lt;/p>
&lt;p>&amp;ldquo;Objects model the real world,&amp;rdquo; I said, grabbing a pencil off the table and holding it up. &amp;ldquo;For instance, I could create a Pencil class, representing the Platonic idea of Pencil, and this would be an instance of it.&amp;rdquo; I, like any modern person, did not actually subscribe to Platonism. &amp;ldquo;And it&amp;rsquo;s able to &lt;em>do&lt;/em> stuff, which we refer to as &amp;lsquo;methods&amp;rsquo;. For instance,&amp;rdquo; I said, scribbling on a piece of paper, &amp;ldquo;it might have a &amp;lsquo;write&amp;rsquo; method, for writing things.&amp;rdquo;&lt;/p></description></item><item><title>Revealing Reveal</title><link>https://j3rn.com/posts/revealing-reveal/</link><pubDate>Sun, 17 Nov 2024 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/revealing-reveal/</guid><description>&lt;p>&lt;strong>Disclaimer: A limitation of the work that I&amp;rsquo;m describing in this post is that it may only be useful to sighted persons and is enhanced by being not colorblind. This post discusses a tool that displays code within colored boxes. The current implementation provides titles on the boxes which might be of use to those without (color) vision, but I have not verified it with a screen reader. I will strive in my future work to create tools that are of use to the (color)blind community.&lt;/strong>&lt;/p></description></item><item><title>Why I Still Use JavaScript's then</title><link>https://j3rn.com/posts/javascript-prefer-then/</link><pubDate>Wed, 04 Sep 2024 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/javascript-prefer-then/</guid><description>&lt;p>With ECMAScript 2017, JavaScript gained the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/async_function" target="_blank" rel="noreferrer">&lt;code>async&lt;/code>&lt;/a> and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await" target="_blank" rel="noreferrer">&lt;code>await&lt;/code>&lt;/a> keywords as a new way to deal with &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise" target="_blank" rel="noreferrer">Promise&lt;/a>s. The traditional way to work with Promises was with the methods &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then" target="_blank" rel="noreferrer">&lt;code>then&lt;/code>&lt;/a>, &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch" target="_blank" rel="noreferrer">&lt;code>catch&lt;/code>&lt;/a>, and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally" target="_blank" rel="noreferrer">&lt;code>finally&lt;/code>&lt;/a>, like so:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#b0c4de;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-javascript" data-lang="javascript">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#c678dd">const&lt;/span> &lt;span style="color:#c1abea">fetchResource&lt;/span> &lt;span style="color:#c7bf54">=&lt;/span> () =&amp;gt; {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#c678dd">return&lt;/span> &lt;span style="color:#c1abea">fetch&lt;/span>(&lt;span style="color:#63c381">&amp;#34;https://example.com/api/resource&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .&lt;span style="color:#c1abea">then&lt;/span>((&lt;span style="color:#c1abea">res&lt;/span>) =&amp;gt; &lt;span style="color:#c1abea">handleResponse&lt;/span>(&lt;span style="color:#c1abea">res&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .&lt;span style="color:#c678dd">catch&lt;/span>((&lt;span style="color:#c1abea">err&lt;/span>) =&amp;gt; &lt;span style="color:#c1abea">handleError&lt;/span>(&lt;span style="color:#c1abea">err&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> .&lt;span style="color:#c678dd">finally&lt;/span>(() =&amp;gt; &lt;span style="color:#c1abea">cleanup&lt;/span>());
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>};
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The above function:&lt;/p>
&lt;ul>
&lt;li>fetches a data from a server using the venerable &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch" target="_blank" rel="noreferrer">&lt;code>fetch&lt;/code>&lt;/a> function, which returns a Promise,&lt;/li>
&lt;li>calls the &lt;code>then&lt;/code> method on the Promise returned from &lt;code>fetch&lt;/code> to configure it such that if the Promise &amp;ldquo;resolves&amp;rdquo; (completes successfully), the &lt;code>handleResponse&lt;/code> function is invoked with the &amp;ldquo;resolved&amp;rdquo; value (here, an HTTP response),&lt;/li>
&lt;li>calls the &lt;code>catch&lt;/code> method on the Promise returned from &lt;code>then&lt;/code> which configures it such that if the Promise &amp;ldquo;rejects&amp;rdquo; (is unsuccessful), the &lt;code>handleError&lt;/code> is invoked with the reject value (some kind of error),&lt;/li>
&lt;li>calls the &lt;code>finally&lt;/code> method on the Promise returned from &lt;code>catch&lt;/code> which configures it such that the &lt;code>cleanup&lt;/code> function is always invoked regardless of whether the Promise resolves or rejects.&lt;/li>
&lt;/ul>
&lt;p>Technically, the &lt;code>catch&lt;/code> and &lt;code>finally&lt;/code> method are wrappers around &lt;code>then&lt;/code> that specialize it for different scenarios and allow programmers to convey intent more easily.&lt;/p></description></item><item><title>Demystifying .NET Terminology</title><link>https://j3rn.com/posts/demystifying-dotnet-terminology/</link><pubDate>Wed, 26 Jun 2024 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/demystifying-dotnet-terminology/</guid><description>&lt;p>So much modern technology is built with Microsoft&amp;rsquo;s .NET, it seems inevitable that I would have to learn about it eventually. When I did, I found so much of the terminology confusing; things had overlapping names and nothing seemed consistent. This table hopefully helps you (and me!) keep it all straight.&lt;/p>
&lt;table>
&lt;thead>
&lt;th>Name&lt;/th>
&lt;th>Description&lt;/th>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>.NET&lt;/td>
&lt;td>
The "application platform" for all other technologies listed here. It consists of:
&lt;ul>
&lt;li>The Common Language Runtime (or CLR)&lt;/li>
&lt;li>Libraries (standard lib type stuff; i/o, dates and times, etc)&lt;/li>
&lt;li>Compiler&lt;/li>
&lt;li>SDK and tools&lt;/li>
&lt;li>"App stacks" such as ASP.NET Core and Windows Forms&lt;/li>
&lt;/ul>
&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>.NET Framework&lt;/td>
&lt;td>A closed-source, Windows-only version of .NET that is deprecated. It's last version is .NET Framework 4.8.1, released in 2022.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>.NET Core&lt;/td>
&lt;td>A newer implementation of .NET that is &lt;a href="https://github.com/dotnet">open source&lt;/a> and cross-platform (Windows, Linux, and macOS). Since .NET Framework is deprecated, it is commonly referred to as just ".NET".&lt;br>&lt;br>The latest version as of writing is .NET Core 8.0.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ASP.NET&lt;/td>
&lt;td>ASP.NET is a web framework extending .NET for making web services. The term can refer to the original ASP.NET, the closed-source, .NET Framework version which, naturally, is also deprecated, or ASP.NET Core, the newer, open-source version targeting .NET Core.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>ASP.NET Core&lt;/td>
&lt;td>The newer, &lt;a href="https://github.com/dotnet/aspnetcore">open-source&lt;/a>, cross-platform web framework.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Entity Framework&lt;/td>
&lt;td>An Object-Relational Mapping (ORM) library for .NET. The story with Entity Framework is very similar to the story with ASP.NET; it was originally shipped as part of .NET Framework, but has been split off and has been superseded by Entity Framework Core.
&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Entity Framework Core&lt;/td>
&lt;td>The newer, &lt;a href="https://github.com/dotnet/efcore">open-source&lt;/a>, cross-platform ORM.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>I&amp;rsquo;ll add more terms as I encounter them!&lt;/p></description></item><item><title>Why Fedora Silverblue?</title><link>https://j3rn.com/posts/why-fedora-silverblue/</link><pubDate>Tue, 05 Mar 2024 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/why-fedora-silverblue/</guid><description>&lt;p>This post is largely based on a write-up I gave to a friend about why I recommended Fedora Silverblue as their first Linux distribution. I assume no knowledge of Linux here.&lt;/p>
&lt;p>I&amp;rsquo;ve been using Linux-based operating systems (termed &amp;ldquo;Linux distributions&amp;rdquo;, &amp;ldquo;Linux distros&amp;rdquo;, or just &amp;ldquo;distros&amp;rdquo;) since about 2011. I&amp;rsquo;ve hopped between many distros, and for some years would switch distros every few months. Lately, though, I&amp;rsquo;ve been quite content to use only one distro for my daily desktop use, &lt;strong>Fedora Silverblue&lt;/strong>.&lt;/p></description></item><item><title>Let it Crash?</title><link>https://j3rn.com/posts/let-it-crash/</link><pubDate>Mon, 12 Feb 2024 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/let-it-crash/</guid><description>&lt;p>






 
 
&lt;figure>&lt;img src="https://j3rn.com/images/titanic.webp" alt="The oceanliner Titanic sinking in the North Atlantic" class="mx-auto my-0 rounded-md" />
&lt;/figure>
&lt;/p>
&lt;p>In the BEAM ecosystem (&lt;a href="https://erlang.org" target="_blank" rel="noreferrer">Erlang&lt;/a>, &lt;a href="https://elixir-lang.org" target="_blank" rel="noreferrer">Elixir&lt;/a>, &lt;a href="https://gleam.run" target="_blank" rel="noreferrer">Gleam&lt;/a>, etc), there&amp;rsquo;s a common idiom:&lt;/p>
&lt;h2 id="let-it-crash" class="relative group">Let It Crash &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#let-it-crash" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>And your first reaction to this is probably astonishment, because crashing is, generally-speaking, not ideal. In traditional, single-threaded systems, a crash means that your program dies and—in server settings—it&amp;rsquo;s then the responsibility of some other service (SystemD or Kubernetes or whatever) to notice that your program has died and restart it. In the event that this process was non-redundant (which is, itself, bad), this may result in downtime. However, in BEAM languages this is usually not the case; business logic is typically executed by BEAM worker processes&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> which are isolated from all other BEAM processes. If one BEAM process crashes, all the other processes keep going&lt;sup id="fnref:2">&lt;a href="#fn:2" class="footnote-ref" role="doc-noteref">2&lt;/a>&lt;/sup>. Furthermore, these processes are usually &amp;ldquo;supervised&amp;rdquo; by a &lt;a href="https://www.erlang.org/doc/man/supervisor" target="_blank" rel="noreferrer">Supervisor&lt;/a> which will detect the crash and start a replacement process, if necessary.&lt;/p></description></item><item><title>The Four Part Migration</title><link>https://j3rn.com/posts/the-four-part-migration/</link><pubDate>Thu, 11 May 2023 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/the-four-part-migration/</guid><description>&lt;p>If you&amp;rsquo;ve been writing relational database-backed applications for long enough, you&amp;rsquo;ve needed this. The situation is common enough: You have a some kind of web application, you don&amp;rsquo;t want to have any downtime, and you need to make a breaking change to your schema.&lt;/p>
&lt;p>Breaking changes come in several forms: renaming a column, changing its type, or even just changing the format in which you store data (e.g. normalizing phone numbers), etc. What these cases have in common is that once the change is made, the code that relied on the way that things were will no longer function. For instance, when a column is renamed, code that&amp;rsquo;s looking for the data under the old name won&amp;rsquo;t work. Code looking for data under the &lt;em>new&lt;/em> name won&amp;rsquo;t function either until the rename is complete.&lt;/p></description></item><item><title>Debugging Elixir with Erlang's dbg</title><link>https://j3rn.com/posts/debugging-with-dbg/</link><pubDate>Wed, 01 Mar 2023 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/debugging-with-dbg/</guid><description>&lt;p>Sometimes, either in local development or on a production server, you want to see when a given function is called, what arguments it is being called with, and what it&amp;rsquo;s returning. Let&amp;rsquo;s say that you have a &lt;code>MyApp.Widgets.show_widget?/1&lt;/code> function which consumes a widget and returns a boolean indicating whether or not that widget should be shown to the user. However, the logic contained in there is pretty complicated and—worse—you don&amp;rsquo;t know really where it is called from anyway.&lt;/p></description></item><item><title>Readability vs Comprehensibility</title><link>https://j3rn.com/posts/readability-vs-comprehensibility/</link><pubDate>Sun, 04 Sep 2022 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/readability-vs-comprehensibility/</guid><description>&lt;p>For me, clarity is composed of two smaller ideas: &lt;em>readability&lt;/em> and &lt;em>comprehensibility&lt;/em>. Neither of these words have widely-accepted definitions in software engineering, so for the purposes of this article, I will define them like so:&lt;/p>
&lt;dl>
&lt;dt>readability&lt;/dt>
&lt;dd>ability for a reader to recognize the syntactic constructs in a body of code.&lt;/dd>
&lt;dt>comprehensibility&lt;/dt>
&lt;dd>ability for a reader to discern the what a body of code does at a high level.&lt;/dd>
&lt;/dl>
&lt;h2 id="readability" class="relative group">Readability &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#readability" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>The LISP family of programming languages have reached the pinnacle of &lt;em>readability&lt;/em>.&lt;/p></description></item><item><title>Elixir GenServers vs Agents</title><link>https://j3rn.com/posts/genserver-vs-agent/</link><pubDate>Sat, 06 Aug 2022 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/genserver-vs-agent/</guid><description>&lt;p>Just as &lt;a href="https://j3rn.com/posts/2021-10-14-elixir-behaviours-vs-protocols">Protocols are an abstraction built upon Behaviours&lt;/a>, Agents are an abstraction built upon GenServers. While GenServers can serve a wider variety of purposes, Agents serve a single purpose: storing state.&lt;/p>
&lt;h2 id="genserver" class="relative group">GenServer &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#genserver" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>The &lt;a href="https://hexdocs.pm/elixir/1.13.4/GenServer.html" target="_blank" rel="noreferrer">Elixir documentation for GenServer&lt;/a> summarizes them as such:&lt;/p>
&lt;blockquote>
&lt;p>A GenServer is a process like any other Elixir process and it can be used to keep state, execute code asynchronously and so on. The advantage of using a generic server process (GenServer) implemented using this module is that it will have a standard set of interface functions and include functionality for tracing and error reporting. It will also fit into a supervision tree.&lt;/p></description></item><item><title>Focusing on What Matters</title><link>https://j3rn.com/posts/focusing-on-what-matters/</link><pubDate>Fri, 01 Apr 2022 00:00:00 +0000</pubDate><guid>https://j3rn.com/posts/focusing-on-what-matters/</guid><description>&lt;p>Update 2025-07-12: I merged two sections, Stability and Availability, into one section, Usability, that also encompasses topics such as accessibility. I also updated some paragraph structures and removed the intro because it was weak.&lt;/p>
&lt;h1 id="what-matters" class="relative group">What matters? &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#what-matters" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h1>&lt;p>The reason that we write software in the first place is to create solutions to problems&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>. Around the world, every day people face problems that can be solved by computers. A person might want to know &amp;ldquo;What are the chances it will rain tomorrow?&amp;rdquo; A statistical model can provide a reasonable estimate. A person might want to know &amp;ldquo;If I have a loan at 3%, how much will I pay in interest over the term of the loan?&amp;rdquo; Accounting software can answer this question.&lt;/p></description></item><item><title>Profiling Elixir for Advent of Code</title><link>https://j3rn.com/posts/profiling-elixir-for-advent-of-code/</link><pubDate>Sun, 05 Dec 2021 15:34:07 -0500</pubDate><guid>https://j3rn.com/posts/profiling-elixir-for-advent-of-code/</guid><description>&lt;p>Every now and again, you may run into a problem that isn&amp;rsquo;t hard to solve using functional programming, but which is hard to solve &lt;em>quickly&lt;/em> using functional programming. For me, today, that problem was &lt;a href="https://adventofcode.com/2021/" target="_blank" rel="noreferrer">Advent of Code&lt;/a>, &lt;a href="https://adventofcode.com/2021/day/5" target="_blank" rel="noreferrer">Day 5&lt;/a>.&lt;/p>
&lt;p>If you&amp;rsquo;re participating in Advent of Code and you haven&amp;rsquo;t yet solved Day 5, this is your last chance to leave the page without spoilers. You have been warned!&lt;/p>
&lt;h2 id="the-problem" class="relative group">The Problem &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#the-problem" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>You are provided with a list of lines of hydrothermal vents on the ocean floor. These lines are represented by start and end coordinates, such as &lt;code>0,9 -&amp;gt; 5,9&lt;/code>. In this example, this means that there are hydrothermal vents at coordinates &lt;code>0,9&lt;/code>, &lt;code>1,9&lt;/code>, &lt;code>2,9&lt;/code>, &lt;code>3,9&lt;/code>, &lt;code>4,9&lt;/code>, and &lt;code>5,9&lt;/code>. Interestingly, two &amp;ldquo;lines&amp;rdquo; of vents may intersect or overlap, which create areas of increased concern.&lt;/p></description></item><item><title>Truly Declarative: Logic Programming</title><link>https://j3rn.com/posts/truly-declarative-logic-programming/</link><pubDate>Sat, 30 Oct 2021 10:21:19 -0400</pubDate><guid>https://j3rn.com/posts/truly-declarative-logic-programming/</guid><description>&lt;p>While reading through Miran Lipovača&amp;rsquo;s excellent &lt;a href="http://learnyouahaskell.com/" target="_blank" rel="noreferrer">&lt;em>Learn You a Haskell&lt;/em>&lt;/a>, I came across the following problem:&lt;/p>
&lt;blockquote>
&lt;p>Which right triangle that has integers for all sides and all sides equal to or smaller than 10 has a perimeter of 24?&lt;/p>&lt;/blockquote>
&lt;p>To demonstrate some properties of different programming languages, I&amp;rsquo;ll solve this problem in three languages embodying three different paradigms:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="#c">C&lt;/a> (imperative and procedural)&lt;/li>
&lt;li>&lt;a href="#haskell">Haskell&lt;/a> (functional)&lt;/li>
&lt;li>&lt;a href="#prolog">Prolog&lt;/a> (logic and constraint)&lt;/li>
&lt;/ul>
&lt;h2 id="c" class="relative group">C &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#c" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>The general approach I&amp;rsquo;ll be taking here is to generate every set of possible lengths fitting the constraints (namely being integers between 1 and 10) and then check to see if the other two conditions are met (being a right triangle, having a perimeter of 24).&lt;/p></description></item><item><title>Elixir Behaviours vs Protocols</title><link>https://j3rn.com/posts/elixir-behaviours-vs-protocols/</link><pubDate>Thu, 14 Oct 2021 22:40:42 -0400</pubDate><guid>https://j3rn.com/posts/elixir-behaviours-vs-protocols/</guid><description>&lt;p>As developers begin learning Elixir, they often have a very understandable confusion around the difference between Elixir&amp;rsquo;s &lt;a href="https://hexdocs.pm/elixir/typespecs.html#behaviours" target="_blank" rel="noreferrer">behaviours&lt;/a> and &lt;a href="https://hexdocs.pm/elixir/Protocol.html" target="_blank" rel="noreferrer">protocols&lt;/a>. These are similar constructs, but with important differences.&lt;/p>
&lt;h2 id="behaviours" class="relative group">Behaviours &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#behaviours" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>Behaviours are conceptually quite simple:&lt;/p>
&lt;blockquote>
&lt;p>A behaviour module defines a set of functions and macros (referred to as callbacks) that callback modules implementing that behaviour must export.&lt;/p>&lt;/blockquote>
&lt;p>For instance, a commonly used behaviour is GenServer, used like so:&lt;/p></description></item><item><title>Exciting Changes Coming in Elixir 1.12</title><link>https://j3rn.com/posts/elixir-1.12/</link><pubDate>Wed, 14 Apr 2021 15:10:00 -0500</pubDate><guid>https://j3rn.com/posts/elixir-1.12/</guid><description>&lt;p>José recently &lt;a href="https://github.com/elixir-lang/elixir/releases/tag/v1.12.0-rc.0" target="_blank" rel="noreferrer">announced the availability of Elixir 1.12.0 rc.0&lt;/a>, a precursor to the full Elixir 1.12.0 release which should come within the next month or so. This update consists primarily of developer quality-of-life improvements. In his announcement, José elaborated on a few changes, but I couldn&amp;rsquo;t help but feel that some exciting changes were relegated to footnotes. As such, I&amp;rsquo;m dedicating this post to trawling through the full changelog and shining a spotlight on a few of my favorite changes.&lt;/p></description></item><item><title>The Agile Myth</title><link>https://j3rn.com/posts/the-agile-myth/</link><pubDate>Sat, 06 Mar 2021 15:10:00 -0500</pubDate><guid>https://j3rn.com/posts/the-agile-myth/</guid><description>&lt;p>Writing a criticism of Agile after &lt;a href="https://pragdave.me/blog/2014/03/04/time-to-kill-agile.html#fn:2" target="_blank" rel="noreferrer">the word &amp;ldquo;Agile&amp;rdquo; has been pronounced dead by one of its authors&lt;/a> may seem like overkill, but nothing has put a stop to the software industry&amp;rsquo;s glut of &lt;a href="https://www.bmc.com/blogs/agile-certifications/" target="_blank" rel="noreferrer">Agile certifications&lt;/a>, &lt;a href="https://www.projectmanager.com/blog/what-is-a-scrum-master-everything-you-need" target="_blank" rel="noreferrer">occupations of &amp;ldquo;doing Agile&amp;rdquo;&lt;/a>, and every engineering manager I&amp;rsquo;ve ever spoken to saying &amp;ldquo;Oh, yes, we do Agile here.&amp;rdquo; I could write an entire blog post haranguing the profiteering and narcissistic industry (see Dave Thomas&amp;rsquo; post linked above), but today I want to dive deeper, take a hard look at the original document, and ask &amp;ldquo;Who actually does this?&amp;rdquo;&lt;/p></description></item><item><title>The Harmful Duality of Elixir's nil</title><link>https://j3rn.com/posts/harmful-duality-of-elixirs-nil/</link><pubDate>Sun, 13 Dec 2020 20:46:00 -0500</pubDate><guid>https://j3rn.com/posts/harmful-duality-of-elixirs-nil/</guid><description>&lt;h3 id="the-problem" class="relative group">The Problem &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#the-problem" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h3>&lt;p>Have you ever written code like this?&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#b0c4de;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elixir" data-lang="elixir">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#c678dd">def&lt;/span> &lt;span style="color:#c1abea">get_address&lt;/span>(&lt;span style="color:#c1abea">address_id&lt;/span>) &lt;span style="color:#c678dd">do&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#c678dd">case&lt;/span> &lt;span style="color:#76a9f9">Addresses&lt;/span>&lt;span style="color:#c7bf54">.&lt;/span>&lt;span style="color:#c1abea">get&lt;/span>(&lt;span style="color:#c1abea">address_id&lt;/span>) &lt;span style="color:#c678dd">do&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#b756ff;font-weight:bold">nil&lt;/span> &lt;span style="color:#c7bf54">-&amp;gt;&lt;/span> {&lt;span style="color:#56b6c2">:error&lt;/span>, &lt;span style="color:#56b6c2">:address_not_found&lt;/span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#c1abea">val&lt;/span> &lt;span style="color:#c7bf54">-&amp;gt;&lt;/span> {&lt;span style="color:#56b6c2">:ok&lt;/span>, &lt;span style="color:#c1abea">val&lt;/span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#c678dd">end&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#c678dd">end&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>I have. This pattern is commonly used to make the value that &lt;a href="https://hexdocs.pm/ecto/Ecto.Repo.html#c:get/3" target="_blank" rel="noreferrer">Ecto.Repo.get/3&lt;/a> returns (a struct or &lt;code>nil&lt;/code>) play well with Elixir&amp;rsquo;s &lt;a href="https://hexdocs.pm/elixir/Kernel.SpecialForms.html#with/1" target="_blank" rel="noreferrer">&lt;code>with&lt;/code>&lt;/a> construct. Since &lt;code>Ecto.Repo.get/3&lt;/code> will always return some single value, a &lt;code>nil&lt;/code> check is required to determine whether that value indicates a success or a failure. Doing this check inline is somewhat clumsy:&lt;/p></description></item><item><title>Escaping from Ruby Blocks</title><link>https://j3rn.com/posts/escaping-from-ruby-blocks/</link><pubDate>Wed, 18 Oct 2017 12:00:00 -0400</pubDate><guid>https://j3rn.com/posts/escaping-from-ruby-blocks/</guid><description>&lt;h2 id="guard-clauses" class="relative group">Guard Clauses &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#guard-clauses" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>Once upon a time, &lt;a href="http://rubocop.readthedocs.io/en/latest/cops_style/#styleguardclause" target="_blank" rel="noreferrer">Rubocop taught me to love guard clauses&lt;/a>. When I first started learning to program, I was deeply conflicted about guard clauses. On the one hand, guard clauses can prevent the need to have deeply nested &lt;code>if&lt;/code>s. On the other hand, it can be hard to remember the context deep into a method without being able to reference the enveloping &lt;code>if&lt;/code>s (similarly to RSpec contexts). In any case, Rubocop wants me to use guard clauses, so I do.&lt;/p></description></item><item><title>To Monkey Patch Ruby</title><link>https://j3rn.com/posts/to-monkey-patch-ruby/</link><pubDate>Thu, 25 Aug 2016 16:07:49 -0400</pubDate><guid>https://j3rn.com/posts/to-monkey-patch-ruby/</guid><description>&lt;p>This is the first of a series of posts I intend to write in a new &amp;ldquo;J3RN vs J3RN&amp;rdquo; style. Essentially, I will be stating a problem with two or more possible solutions, taking both sides in turn, and hopefully ultimately reaching a well thought out solution to the problem.&lt;/p>
&lt;h2 id="the-problem" class="relative group">The Problem &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#the-problem" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>For my &lt;a href="https://github.com/J3RN/timesheet" target="_blank" rel="noreferrer">Time Tracker application&lt;/a>, I want to have a pretty date and time picker. However, Ruby only natively understands a handful of formats and &amp;ldquo;&lt;a href="https://en.wikipedia.org/wiki/Date_and_time_notation_in_the_United_States" target="_blank" rel="noreferrer">American date&lt;/a>&amp;rdquo;, the format used by the pretty date and time picker, is not one of them.&lt;/p></description></item><item><title>Interpolating Ruby Strings</title><link>https://j3rn.com/posts/interpolating-ruby-strings/</link><pubDate>Fri, 19 Dec 2014 22:14:25 -0500</pubDate><guid>https://j3rn.com/posts/interpolating-ruby-strings/</guid><description>&lt;p>Let&amp;rsquo;s talk about interpolation. Sure, you probably know the Ruby string interpolation syntax:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#b0c4de;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-ruby" data-lang="ruby">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#c1abea">arg&lt;/span> &lt;span style="color:#c7bf54">=&lt;/span> &lt;span style="color:#63c381">&amp;#34;world&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ef8383">puts&lt;/span> &lt;span style="color:#63c381">&amp;#34;Hello &lt;/span>&lt;span style="color:#98c379">#{&lt;/span>&lt;span style="color:#c1abea">arg&lt;/span>&lt;span style="color:#98c379">}&lt;/span>&lt;span style="color:#63c381">!&amp;#34;&lt;/span> &lt;span style="color:#8a93a5;font-style:italic">#=&amp;gt; &amp;#34;Hello world!&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This syntax is pretty useful. However, it has it&amp;rsquo;s limitations. Let&amp;rsquo;s say that we are generating strings that are almost the same each time, but with each, one word changes. How are you going to do this now?&lt;/p>
&lt;p>My first inclination was something like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#b0c4de;background-color:#282c34;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-ruby" data-lang="ruby">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#c1abea">template&lt;/span> &lt;span style="color:#c7bf54">=&lt;/span> &lt;span style="color:#63c381">&amp;#34;Today the weather is &lt;/span>&lt;span style="color:#d26464;font-weight:bold">\#&lt;/span>&lt;span style="color:#63c381">{ weather }&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#c1abea">weather_strings&lt;/span> &lt;span style="color:#c7bf54">=&lt;/span> {}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#c7bf54">[&lt;/span>&lt;span style="color:#63c381">&amp;#34;warm&amp;#34;&lt;/span>, &lt;span style="color:#63c381">&amp;#34;cloudy&amp;#34;&lt;/span>, &lt;span style="color:#63c381">&amp;#34;windy&amp;#34;&lt;/span>&lt;span style="color:#c7bf54">].&lt;/span>&lt;span style="color:#c1abea">each&lt;/span> &lt;span style="color:#c678dd">do&lt;/span> &lt;span style="color:#c7bf54">|&lt;/span>&lt;span style="color:#c1abea">weather&lt;/span>&lt;span style="color:#c7bf54">|&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#c1abea">weather_strings&lt;/span>&lt;span style="color:#c7bf54">[&lt;/span>&lt;span style="color:#c1abea">weather&lt;/span>&lt;span style="color:#c7bf54">]&lt;/span> &lt;span style="color:#c7bf54">=&lt;/span> &lt;span style="color:#c1abea">template&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#c678dd">end&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>It&amp;rsquo;s not hard to see why &lt;code>weather&lt;/code> wasn&amp;rsquo;t interpolated into the strings. Well, it occurred to me shortly thereafter that ERB might be the right way to go with this.&lt;/p></description></item><item><title>Portfolio</title><link>https://j3rn.com/portfolio/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://j3rn.com/portfolio/</guid><description>&lt;h3>Developer Tooling&lt;/h3>

&lt;ul class="cards">
 &lt;li>
 &lt;h4>Viz&lt;/h4>
 &lt;img alt="Call graph of an Elixir codebase" src="https://j3rn.com/images/viz.svg" />
 Visualize the call graph for Elixir codebases. Especially helpful for debugging and discovering unusual codepaths!
 &lt;div class="actions">
 &lt;a href="https://github.com/J3RN/viz">Source&lt;/a>
 &lt;/div>
 &lt;/li>
 &lt;li>
 &lt;h4>Reveal&lt;/h4>
 &lt;img alt="JavaScript code in colorful nested blocks" src="https://j3rn.com/images/reveal.png" />
 Reveal the hidden structure in code. A helpful tool for junior programmers.
 &lt;div class="actions">
 &lt;a href="https://reveal.j3rn.com">See it&lt;/a>
 &lt;a href="https://github.com/J3RN/reveal">Source&lt;/a>
 &lt;/div>
 &lt;/li>
 &lt;li>
 &lt;h4>tree-sitter-gleam&lt;/h4>
 &lt;img alt="Screenshot of Emacs showing Gleam code with syntax highlighting" src="https://j3rn.com/images/tree-sitter-gleam.png" />
 Grammar to construct a concrete syntax tree (CST) from &lt;a href="https://gleam.run">Gleam&lt;/a> code.
 &lt;div class="actions">
 &lt;a href="https://github.com/gleam-lang/tree-sitter-gleam">Source&lt;/a>
 &lt;/div>
 &lt;/li>
&lt;/ul>

&lt;h3>Toys &amp;amp; Games&lt;/h3>

&lt;ul class="cards">
 &lt;li>
 &lt;h4>Conway's Game of Life&lt;/h4>
 &lt;img alt="Grid showing a glider gun in Conway's Game of Life" src="https://j3rn.com/images/conway.png" />
 The classic cellular automata.
 &lt;div class="actions">
 &lt;a href="https://j3rn.com/conway">See it&lt;/a>
 &lt;a href="https://github.com/j3rn/game-of-life-elm">Source&lt;/a>
 &lt;/div>
 &lt;/li>
 &lt;li>
 &lt;h4>QuAnts&lt;/h4>
 &lt;img alt="Grid showing various QuAnts (three-segment colored automata) moving in a grid" src="https://j3rn.com/images/quants.png" />
 A two-dimensional reverseable cellular automata.
 &lt;div class="actions">
 &lt;a href="https://j3rn.com/quants">See it&lt;/a>
 &lt;a href="https://github.com/J3RN/game-of-life-elm/tree/qu-ants">Source&lt;/a>
 &lt;/div>
 &lt;/li>
 &lt;li>
 &lt;h4>Darwin's Game of Evolution&lt;/h4>
 &lt;img alt="Colorful cells representing simulated lifeforms on a grid" src="https://j3rn.com/images/goe.png" />
 A complicated cellular automata where each cell contains detailed state, including food, size, and rules for how to interact with other cells in the grid.
 &lt;div class="actions">
 &lt;a href="https://j3rn.com/goe">See it&lt;/a>
 &lt;a href="https://github.com/J3RN/game-of-evolution">Source&lt;/a>
 &lt;/div>
 &lt;/li>
&lt;/ul></description></item><item><title>Why do you dress that way?</title><link>https://j3rn.com/aesthetic/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://j3rn.com/aesthetic/</guid><description>&lt;h3 id="i-get-asked-this-a-lot-so-i-wrote-a-glorified-faq-page" class="relative group">I get asked this a lot, so I wrote a glorified FAQ page. &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#i-get-asked-this-a-lot-so-i-wrote-a-glorified-faq-page" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h3>&lt;ol>
&lt;li>
&lt;p>The original reason was social engineering lite. Occasionally I would have to dress up for events in high school, and I noticed that when I did people treated me differently. There&amp;rsquo;s a ton of research into subconscious biases that&amp;rsquo;s honestly really fascinating, but suffice it to say that police officers are usually nicer to well-dressed people that they pull over.&lt;/p></description></item></channel></rss>