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.

Asserts as Comments

1 pointsby thevivekpandeyabout 7 years ago

1 comment

ergothusabout 7 years ago
&gt; Writing comments explaining your motivation<p>This. Comments saying what you are doing is a code smell - not always wrong, but always worth a second look as to why the code wasn&#x27;t clear by itself. Comments saying WHY code just did something are great because they convey the real info future me will need.<p>Despite the quoted statement, the article proceeds to give assertions&#x2F;comments that don&#x27;t fulfil that purpose. Assertions are fine, but (unless I misread) this is solving a different problem than good comments solve.