<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Coding on Yet another blog restart</title>
		<link>https://pseyfert.codeberg.page/tags/coding/</link>
		<description>Recent content in Coding on Yet another blog restart</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Wed, 24 Jun 2026 15:26:22 +0200</lastBuildDate>
		
			<atom:link href="https://pseyfert.codeberg.page/tags/coding/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>my paper cuts with rustfmt - and what to do about them</title>
				<link>https://pseyfert.codeberg.page/2026/06/my-paper-cuts-with-rustfmt-and-what-to-do-about-them/</link>
				<pubDate>Wed, 24 Jun 2026 15:26:22 +0200</pubDate>
				<guid>https://pseyfert.codeberg.page/2026/06/my-paper-cuts-with-rustfmt-and-what-to-do-about-them/</guid>
				<description>&lt;p&gt;&lt;code&gt;rustfmt&lt;/code&gt; occasionally fails me. Of cause, the examples are somewhat taken from&#xA;production code, but with all identifiers rendered unrecognizable and all&#xA;strings replaced by random words. Unhelpful comments to all of this would be&#xA;&amp;ldquo;why don&amp;rsquo;t you use shorter identifiers?&amp;rdquo; or &amp;ldquo;use shorter error messages&amp;rdquo;. But&#xA;let&amp;rsquo;s face it:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Naming is hard. And if your &lt;code&gt;foo&lt;/code&gt; function and your &lt;code&gt;bar&lt;/code&gt; function both return a &amp;ldquo;result&amp;rdquo;, but neither can use the &lt;code&gt;std::result::Result&lt;/code&gt; (slightly different semantics, non-binary logic, …) and you can&amp;rsquo;t introduce a common result type (too different needs for a one-size-fits-all, not even with type parameters), then you have to end up with a type name that says &amp;ldquo;result&amp;rdquo; with some more context. And a reader 10 levels up the call tree must not confuse the &lt;code&gt;FooResult&lt;/code&gt; with the &lt;code&gt;BarResult&lt;/code&gt;. Taking a thesaurus to come up with different names would be counter productive. Between a &lt;code&gt;MyResult&lt;/code&gt; and &lt;code&gt;MyOutcome&lt;/code&gt;, a human reader won&amp;rsquo;t remember which one is from &lt;code&gt;foo&lt;/code&gt; and which one is from &lt;code&gt;bar&lt;/code&gt;, what the API differences are, etc. The best name migh just be &lt;code&gt;foo_module::Result&lt;/code&gt; and &lt;code&gt;bar_module::Result&lt;/code&gt; and &lt;code&gt;use foo_module::Result&lt;/code&gt; won&amp;rsquo;t help the reader.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;I suck at naming. That must not be a justification for using poor names, but … should I really spend another week on trying to come up with a better name and then eventually not come up with one? A reviewer might anyways have a different perspective and I could highlight a name with a few suggestions. But at that point in time, I need formatting. (And let&amp;rsquo;s keep in mind that reviewer time and energy are a finite resource)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Same with the strings. By now, I hate &amp;ldquo;no such file or directory&amp;rdquo; with a passion. Was this a &lt;code&gt;cp&lt;/code&gt; call? Does the source file not exist? Does the target file not exist? … Oh, &lt;code&gt;/usr/bin/cp&lt;/code&gt; might not exist! You know what, that&amp;rsquo;s not even the actual error that you&amp;rsquo;re investigating. The &lt;code&gt;cp&lt;/code&gt; call was opportunistic &amp;ldquo;copy the file if it exists, if not that&amp;rsquo;s fine.&amp;rdquo; The &lt;code&gt;libc&lt;/code&gt; author can&amp;rsquo;t know why &lt;code&gt;cp&lt;/code&gt; is trying to access a file. The &lt;code&gt;cp&lt;/code&gt; author doesn&amp;rsquo;t know why you&amp;rsquo;re trying to copy a file. The tool that&amp;rsquo;s invoking &lt;code&gt;cp&lt;/code&gt; might have some context, but it now tries to read its config file to look up error handling and the config file doesn&amp;rsquo;t exist. The config file reader doesn&amp;rsquo;t know that falling back to defaults is desired. What I&amp;rsquo;m saying: With enough layers of indirection, you don&amp;rsquo;t have a complete picture, but you need to do all you can to provide the debugging person enough information. They have no idea that deep down there&amp;rsquo;s a &lt;code&gt;cp&lt;/code&gt; invocation. It&amp;rsquo;s not enough for them to be told that &lt;code&gt;cp&lt;/code&gt; is failing, they need information about why it&amp;rsquo;s called what is even happening, maybe a comment that &amp;ldquo;chances are high that this error message is a red herring&amp;rdquo;. I&amp;rsquo;m not an expert on logging, but with enough experience to know that cutting strings down to 25 characters isn&amp;rsquo;t a solution, either.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Line length limits are still around and somewhat justified. Once you view a &lt;code&gt;git diff&lt;/code&gt; on the web (gitlab, github, codeberg, …), any language support of your editor won&amp;rsquo;t help. You may or may not be able to enable or disable line wrapping. At some point &lt;code&gt;function(argument1, argument2)&lt;/code&gt; must be wrapped one argument per line.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
			</item>
	</channel>
</rss>
