<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Trade-Offs on Prateek Sharma</title>
		<link>https://prateeksharma.me/tags/trade-offs/</link>
		<description>Recent content in Trade-Offs on Prateek Sharma</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Wed, 26 Aug 2026 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://prateeksharma.me/tags/trade-offs/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Generic returns can be the right call for a library you maintain alone</title>
				<link>https://prateeksharma.me/opinions/generic-returns-for-a-solo-maintained-library/</link>
				<pubDate>Wed, 26 Aug 2026 00:00:00 +0000</pubDate>
				<guid>https://prateeksharma.me/opinions/generic-returns-for-a-solo-maintained-library/</guid>
				<description>&lt;p&gt;The standard advice for a client library is: give callers typed responses.&#xA;&lt;code&gt;client.Ticker(...) (*Ticker, error)&lt;/code&gt;, not &lt;code&gt;(any, error)&lt;/code&gt;. I went the other way&#xA;in my &lt;a href=&#34;https://prateeksharma.me/projects/wazirx-connector-go/&#34;&gt;WazirX Go connector&lt;/a&gt;&#xA; and I still think it&#xA;was right &lt;em&gt;for that library&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The upstream API&amp;rsquo;s response shapes move around — objects that become arrays,&#xA;fields that appear and vanish across endpoints. With ~25 endpoints and one&#xA;maintainer (me, in spare hours), typed structs would mean 25 things to keep in&#xA;sync with an API I don&amp;rsquo;t control and can&amp;rsquo;t see changes to until they ship. The&#xA;generic return pushed that cost to the call site, where the caller already knows&#xA;which two fields they want and can assert for them.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
