<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Parse-Dont-Validate on cekrem.github.io</title><link>https://cekrem.github.io/tags/parse-dont-validate/</link><description>Recent content in Parse-Dont-Validate on cekrem.github.io</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 12 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://cekrem.github.io/tags/parse-dont-validate/index.xml" rel="self" type="application/rss+xml"/><item><title>Canonicalise, Don't Remember — Smart Constructors in Kotlin</title><link>https://cekrem.github.io/posts/canonicalise-dont-remember-kotlin/</link><pubDate>Tue, 12 May 2026 00:00:00 +0000</pubDate><guid>https://cekrem.github.io/posts/canonicalise-dont-remember-kotlin/</guid><description>&lt;p&gt;Story time! What follows is a slightly simplified and transposed-to-another-domain version of what I experienced this week. Ish.&lt;/p&gt;
&lt;p&gt;In our app, we had a shopping cart (not really, though, but stay with me), where adding the same product twice should collapse into one line with the quantities summed. A colleague had recently shipped &lt;code&gt;mergeBySku()&lt;/code&gt; to do exactly that. The &amp;ldquo;add to cart&amp;rdquo; code path called it. The &amp;ldquo;restore the user&amp;rsquo;s cart from the server&amp;rdquo; code path called it. Then a third construction site landed in the repo (someone&amp;rsquo;s &amp;ldquo;re-import items from a previous order&amp;rdquo; feature, or some such) without first making the call to normalise the line items. Then, lo and behold: a support ticket showed a customer&amp;rsquo;s cart with the same product appearing four times.&lt;/p&gt;</description></item></channel></rss>