<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Traits on Thunderseethe's Devlog</title><link>https://thunderseethe.dev/tags/traits/</link><description>Recent content in Traits on Thunderseethe's Devlog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 08 Dec 2024 18:48:17 +0000</lastBuildDate><atom:link href="https://thunderseethe.dev/tags/traits/index.xml" rel="self" type="application/rss+xml"/><item><title>Traits are a Local Maxima</title><link>https://thunderseethe.dev/posts/traits-are-a-local-maxima/</link><pubDate>Mon, 18 Nov 2024 00:00:00 +0000</pubDate><guid>https://thunderseethe.dev/posts/traits-are-a-local-maxima/</guid><description>&lt;p>Today we&amp;rsquo;re talking about &lt;a 
 href="https://doc.rust-lang.org/book/ch10-02-traits.html"
 
 
 target="_blank" 
 rel="noopener" 
 data-goatcounter-click="https://doc.rust-lang.org/book/ch10-02-traits.html"
 data-goatcounter-title="Rust traits"
 data-goatcounter-referrer="Traits are a Local Maxima"
 >
 Rust traits
 
 &lt;i class="fa-solid fa-arrow-up-right-from-square">&lt;/i>
 
&lt;/a>
.
As you might&amp;rsquo;ve guessed from the title, we will not be talking about them positively.
Woah woah, hang on, put down your pitchfork.
A local maximum is still a maximum, I love traits as much as anyone.&lt;/p>
&lt;p>Traits are one of the few programming language concepts beloved enough to earn multiple names.
You might have heard about typeclasses in Haskell or protocols in Swift.
Heck, if the teacher&amp;rsquo;s not watching, even interfaces can be considered a kind of trait.
Elm famously left out traits, and it was so requested it spawned an &lt;a 
 href="https://faq.elm-community.org/#does-elm-have-ad-hoc-polymorphism-or-typeclasses"
 
 
 target="_blank" 
 rel="noopener" 
 data-goatcounter-click="https://faq.elm-community.org/#does-elm-have-ad-hoc-polymorphism-or-typeclasses"
 data-goatcounter-title="FAQ"
 data-goatcounter-referrer="Traits are a Local Maxima"
 >
 FAQ
 
 &lt;i class="fa-solid fa-arrow-up-right-from-square">&lt;/i>
 
&lt;/a>
 explaining their absence.&lt;/p></description></item></channel></rss>