<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>dasein</title><link>https://dasein.dev/</link><description>Recent content on dasein</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 18 May 2025 04:56:12 -0300</lastBuildDate><atom:link href="https://dasein.dev/index.xml" rel="self" type="application/rss+xml"/><item><title>Designing a database interface with postgres schemas</title><link>https://dasein.dev/posts/f74dabae/</link><pubDate>Sun, 18 May 2025 04:56:12 -0300</pubDate><guid>https://dasein.dev/posts/f74dabae/</guid><description>&lt;p>&lt;img src="https://dasein.dev/../imgs/Military-Art-Italy-097.jpg" alt="">&lt;/p>
&lt;p>I&amp;rsquo;m currently working on a project — a highly customizable logbook with analytics tools — and part of the design process was defining the communication between my app and the database.&lt;/p>
&lt;p>I wanted to apply some ideas I&amp;rsquo;ve been cooking for a while and that I don&amp;rsquo;t see very often in the industry, that is using schemas for separation of concerns and functions for the contracts. This setup provides a clear interface while omitting implementation details, &lt;em>which is what we do in everything else, right?&lt;/em>&lt;/p></description></item><item><title>Exhaustive pattern matching in C#</title><link>https://dasein.dev/posts/b22d646e/</link><pubDate>Sat, 15 Jun 2024 17:47:14 -0300</pubDate><guid>https://dasein.dev/posts/b22d646e/</guid><description>&lt;p>&lt;img src="https://dasein.dev/../imgs/roman_pantheon.jpg" alt="">&lt;/p>
&lt;p>Although C# has assimilated many functional features along the years, its framework is still mostly imperative and object-oriented; things like switch statements and switch expressions haven&amp;rsquo;t adopted a safer and more consistent behavior, giving leeway to unwarranted flexibility.&lt;/p>
&lt;p>That said, it&amp;rsquo;s pretty simple to add this behavior to your project through the EditorConfig. Just be careful, as these settings change only the development environment!&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-ini" data-lang="ini">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">[*.cs]&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:#6272a4"># CS8509: The switch expression does not handle all possible values of its input type (it is not exhaustive).&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#50fa7b">dotnet_diagnostic.CS8509.severity&lt;/span> &lt;span style="color:#ff79c6">=&lt;/span> &lt;span style="color:#f1fa8c">error&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:#6272a4"># CS8524: The switch expression does not handle some values of its input type (it is not exhaustive) involving an unnamed enum value.&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#50fa7b">dotnet_diagnostic.CS8524.severity&lt;/span> &lt;span style="color:#ff79c6">=&lt;/span> &lt;span style="color:#f1fa8c">none&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>For &lt;strong>CS8509&lt;/strong>, set the severity to &lt;code>error&lt;/code>. This ensures that the code won&amp;rsquo;t compile without the switch handling all possible values.&lt;/li>
&lt;li>For &lt;strong>CS8524&lt;/strong>, set the severity to &lt;code>none&lt;/code>. This is important because any default case will automatically cover any missing values, which would render the first setting useless.&lt;/li>
&lt;/ul>
&lt;p>Unfortunately, I&amp;rsquo;m unaware of a setting that will error out if you &lt;strong>do use&lt;/strong> a default case, but you can solve that by adding a code analyzer, if you want.&lt;/p></description></item><item><title>My introduction to Euclid's Elements: Book I</title><link>https://dasein.dev/posts/409fe13d/</link><pubDate>Thu, 13 Jun 2024 01:29:41 -0300</pubDate><guid>https://dasein.dev/posts/409fe13d/</guid><description>&lt;p>&lt;img src="https://dasein.dev/../imgs/Sanzio_01_Euclid.jpg" alt="">&lt;/p>
&lt;p>This is my first experience with the formal study of mathematics in an attempt to fundamentally understand ideas that feel so dim to me.
As I understand now, in Book I, Euclid introduces three sets of foundational statements that serve as the basis for the geometric principles and proofs that follow.&lt;/p>
&lt;p>&lt;strong>Definitions&lt;/strong> are the first set of foundational statements that clarify the meanings of fundamental geometric terms. This helped me understand the rules behind what seemed previously like obvious conclusions. It struck me that a figure is essentially a description of a set of rules. For example, of the trilateral figures, an equilateral triangle has three equal sides; an isosceles triangle has two equal sides; and a scalene triangle has three unequal sides. However you adjust their lengths, they will always be descriptions of these rules.&lt;/p></description></item><item><title>日本語の最初の投稿</title><link>https://dasein.dev/posts/3d6cad3d/</link><pubDate>Fri, 22 Mar 2024 19:44:00 -0300</pubDate><guid>https://dasein.dev/posts/3d6cad3d/</guid><description>&lt;p>今日は2024年3月22日ですが、これが私の日本語の最初の投稿です。数か月間勉強していますが、これはまだ非常に難しいですよね。&lt;/p>
&lt;p>Note: I had to use jisho.org for a few words..&lt;/p></description></item><item><title>Wrapping C# types with actual domain specific knowledge</title><link>https://dasein.dev/posts/e9c2ce81/</link><pubDate>Tue, 27 Feb 2024 21:35:24 -0300</pubDate><guid>https://dasein.dev/posts/e9c2ce81/</guid><description>&lt;p>While implementing the domain for this new feature our team was working on, I felt surprisingly uncomfortable with how we were using C# types to represent texts, two-valued logic, monetary values, etc. If we are going to represent domain specific knowledge, we should also encompass these properties; they have rules that exceed their primitive type&amp;rsquo;s constraints, after all.&lt;/p>
&lt;p>Let&amp;rsquo;s make the case for a system that should only accept documents that have been registered starting from the year 2000, but can accept documents up to 10 years in advance (from the request). First, if we simply use DateTime, we&amp;rsquo;ll be delegating the responsibility of validity to some other part of our application, which will cause either a maintenance problem, or a validation problem. We can solve this by wrapping our DateTime in a custom record type:&lt;/p></description></item><item><title>Introducing domain-driven design to a frontend application</title><link>https://dasein.dev/posts/eb18da4e/</link><pubDate>Sun, 07 May 2023 19:29:57 -0300</pubDate><guid>https://dasein.dev/posts/eb18da4e/</guid><description>&lt;p>After diving into our React.js project at work, experiencing the mysterious ways in which it was built and grappling with the unintended consequences of poor decisions, we decided it was time to shake things up a bit.&lt;/p>
&lt;p>Changes were necessary, and the first major one we implemented was transitioning from Javascript to Typescript. Typescript is a strongly and statically typed language, it allows developers to define types for variables, functions and objects, which helps catch type-related errors during development. It also has neat features like discriminated unions; with them, it&amp;rsquo;s possible to represent a value that can take on different types.&lt;/p></description></item><item><title>An insight into beautiful code</title><link>https://dasein.dev/posts/8a79bd9f/</link><pubDate>Mon, 03 Oct 2022 00:54:05 -0300</pubDate><guid>https://dasein.dev/posts/8a79bd9f/</guid><description>&lt;p>Through my journey as a software developer I have always cared for the aesthetics of my code; be the spacing between lines, naming conventions, or the structure of a project - much like a wordsmith or a sculptor - there is the pursuit of something beautiful, creative and expressive.&lt;/p>
&lt;p>Now that I think about it, though it can be intuitively understood, we struggle to describe beautiful code in a coherent set of qualities.&lt;/p></description></item><item><title>About Me</title><link>https://dasein.dev/about/</link><pubDate>Mon, 04 Oct 2021 21:44:25 -0300</pubDate><guid>https://dasein.dev/about/</guid><description>&lt;p>A work in progress..&lt;/p></description></item></channel></rss>