Informative Comments (1) - Deepstash
Informative Comments (1)

Informative Comments (1)

It is sometimes useful to provide basic information with a comment. For example, consider this comment that explains the return value of an abstract method:

/ Returns an instance of the Responder being tested. protected abstract Responder responderInstance ();

A comment like this can sometimes be useful, but it is better to use the name of the function to convey the information where possible. For example, in this case the comment could be made redundant by renaming the function: responderBeingTested.

Here's a case that's a bit better:

// format matched kk:mm:ss EBE, MMM dd, yyyy

10

18 reads

CURATED FROM

IDEAS CURATED BY

codingharry

Aspiring full stack developer

Learning to write clean and descriptive comments inside your code requires skill, but you should avoid it! Learn how important (or not) are comments within your code through the first part of the clean code book

The idea is part of this collection:

How To Become A Digital Nomad

Learn more about books with this collection

How to build a network while working remotely

How to work remotely

How to manage finances while working remotely

Related collections

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Personalized microlearning

100+ Learning Journeys

Access to 200,000+ ideas

Access to the mobile app

Unlimited idea saving

Unlimited history

Unlimited listening to ideas

Downloading & offline access

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates