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.

How much you suck as an engineer = 1/(sum(len(n) for n in Nv)/len(Nv))

10 pointsby oneelectronalmost 5 years ago
This is conjecture that programmers should aspire to write self-documenting and expressive code. Terse code is just poor form, in the modern programming world.<p><pre><code> Xc = ds.imgtf(tsf, sz, rm, sc) </code></pre> vs<p><pre><code> &#x2F;&#x2F; normalize the input images processedInput = inputData.processImages(customTransform, finalSize, resizeMethod, maximumScaleFactor) </code></pre> Sample1 is preferred by most people I work with, and the standard for almost anything you&#x27;ll find published in Python or Java. The web world is a little more forward on this, although still behind if you ask me.<p>I have always followed a practice of writing goals as comments first, then comments as pseudocode, and then simply adding in the syntax below that, with variable names that would be obvious at a glance. However, colleagues have found this practice &quot;Nazi-like&quot; and some have even made hard stances against putting comments in production code, at all. It&#x27;s almost a side job for my colleagues to show me that my concerns are unwarranted.<p>Is it acceptable to demand rigor in expressive naming conventions and heavy commenting within my team? I&#x27;m seeking opinions on a team guideline for erring far on the side of readability over conciseness. I argue it has tangible benefits, and would&#x27;ve mitigated problems we&#x27;ve already stumbled on.<p>(edit: I removed a bunch of ranty prose like &quot;What year is it&quot;)

2 comments

tlackalmost 5 years ago
Strongly disagree but upvoted for the conviction of your delivery. :)<p>Writing robust programs relies on unquestionable understanding of the logic. The specific variable and argument names are neither here nor there.<p>It&#x27;s almost impossible to understand program flow when code is extremely verbose and heavily abstracted. Little comments like &quot;add 1 to x!!&quot; are not only useless in practice but they are toxic to code understanding.<p>The code already tells you what it does. As a maintainer, I need to understand why, and to what ultimate purpose. &quot;tmp2 -&gt; temporaryFailedCustomerRecordsCounter&quot; wastes precious space making the obvious infantalizing.<p>It&#x27;s ok to expect people working on your complex, important software to be knowledgeable about the domain and its&#x27; standard terminology. I expect my Lyft driver to have a drivers license.
评论 #24241103 未加载
_drimzyalmost 5 years ago
Google gets rid of this problem (either extremes) by formalizing style guides for the different coding languages people use in its organization. Checkout <a href="https:&#x2F;&#x2F;google.github.io&#x2F;styleguide&#x2F;" rel="nofollow">https:&#x2F;&#x2F;google.github.io&#x2F;styleguide&#x2F;</a>