Comment

Comment by cessor

I found this technique to work quite well, but this idea does not mean imply that one should simply "quit writing comments", but rather that comments can most often be replaced with actual structures that improve the code (e.g., extracting long boolean expressions into a function with the same name as the actual comment), but that also depends on the language and aptitude of the developer.

Would you really argue in favor of something like this?

``` class Account { ... /// returns the accountId public int d_nr() { ... } } ```

``` class Account { ... /// returns the accountId public int getAccountId () { ... } } ```

The first comment is obsolete when using a proper method name, the second does that and so the comment is redundant.

May I ask: What did you experience in the wild?

parent cessor 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton