TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Thy code shalt be boring

26 pointsby bitfieldabout 2 years ago

4 comments

OkayPhysicistabout 2 years ago
While I sympathize with the avoidance of &quot;clever&quot; code, it&#x27;s worth pointing out that there is an opposite direction: don&#x27;t re-implement standard abstractions.<p>There are many standard abstractions that it is safe to assume that literally everyone qualified to touch code will know. If they don&#x27;t, your priority should be either replacing them teaching them, not replacing the code.<p>Different languages and paradigms have different examples of such abstractions, but a trivial example is loops:<p><pre><code> while(i &lt; itt.length) x = itt[i] i = i + 1 for(i=0;i&lt;itt.length;i++) x = itt[i] foreach(x in itt) </code></pre> There is a decreasing amount of mental overhead in reading each one of those, because I know what a foreach loop does, and I don&#x27;t need to be on the lookout for strange behavior.<p>IMO, Go overcorrects on the &quot;don&#x27;t get clever&quot; ideology to the point of needlessly increasing the amount of mental overhead required to read some code. The entire language was designed to solve a problem that should have been solved at the hiring level.
评论 #35743914 未加载
mattpallissardabout 2 years ago
&gt; think for thyself<p>Ok.<p>&gt; Resist the temptation to be creative, stylish, or (worst of all) clever.<p>I&#x27;ve spent a good chunk of my career coming in and cleaning up and optimizing codebases, avoiding complete re-writes . Coming across a genuinely clever and novel approach to a tricky problem that someone else wrote is something I enjoy immensely.<p>I&#x27;m tired of hearing from the &quot;is unneeded complexity&quot; bandwagoners. There is a difference between clever and convoluted. I&#x27;ll trade a few more minutes of grokking for more performance, less boiler plate, etc, all day.<p>That and in my experience with large codebases, most time spent understanding code is spent on the business logic anyway.
评论 #35736489 未加载
评论 #35761285 未加载
erik_seabergabout 2 years ago
Boring, repetitive code should be generated. Devs are a lot more expensive than compilers, and bored devs start seeing patterns that aren’t quite there.
habitueabout 2 years ago
&gt; Thou shalt be boring<p>I keep hearing this stuff but... you only live once, you spend most of your life working, so, sorry no thanks.
评论 #35738174 未加载