Code boilerplate: Is it always bad?
&gt;<i>In Python (and many other languages), it’s very easy to unintentionally hide tons of work in a single line of built-in syntax. Some lines do almost no work, other lines do a moderate amount of work, other lines do what I’d describe is tens of lines worth of work—a lot of work. It varies a lot, even in beginner code. In Go, I’ve found that this variability is much more diminished.</i><p>I call BS. Consider these 2 Go lines:<p><pre><code>  heck_if_I_know_what_this_does()
  heck_if_I_know_what_this_does_either()
</code></pre>
Just because Go has less powerful primitives, it doesn&#x27;t mean that you don&#x27;t use opaque code, libs, etc. all the time. Sure, you can look into what each function does -- but then again, you can also immediately tell that a list comprehension in python is doing at least O(N) work compared to a simple addition, without even having to open any other source file.<p>&gt;<i>Is this good? I believe it is. I believe this code is more proportional to the complexity of the work that it’s doing.</i><p>We invented programming languages on top of machine code so that our code can be LESS proportional to the &quot;complexity of the work that it’s doing&quot;.<p>&gt;<i>When reading proportional code, it’s easier to notice where the interesting bits are.</i><p>Not really. It&#x27;s the inverse: the terse code only keeps the interesting bits. The &quot;proportional code&quot; gives you all the non-interesting, and getting in the way, mechanics.<p>&gt;<i>When a friend was reading through the source code for ssh-chat, he was surprised that I implemented my own Set type. I explained that while Go doesn’t have a built-in Set, it’s just a few lines of boilerplate to make your own on top of a map. In fact, I noticed that my version of Set evolved to be fairly specific to how it was being used. In retrospect, I’m glad that I was tweaking my own implementation iteratively rather than spending time working around whichever limitations a generic library might have had.</i><p>Pray tell, what &quot;limitations&quot; a generic Set would have?<p>And why does those kinds of post remind one of Stockholm Syndrome?