Alter Ego
Published in

Alter Ego

JavaScript Comment Methodologies

via unsplash.com

We live with an abundance of libraries, frameworks, and supersets, like React, Redux, and TypeScript. We also have a variety of programming principles, like DRY, KISS, SOLID, and YAGNI. We design our architecture and optimize the code for performance, security, scalability, upgradeability, and clarity, often without a scalable methodology.

A Cambridge professor once told me that the only person who could write directly from their imagination was Shakespeare; everyone else needs to invest time in processing, editing, and communicating their ideas. What holds true for university essays is also true for writing code and code comments. Purpose, intention, and reasoning can be articulated with a commenting framework. Here are a few tools to do just that:

  • RFC 2119: a common vocabulary.
  • JSDoc: A markup language used to annotate JavaScript source code files.
  • Google JavaScript Style Guide: acommon set of rules.
  • ESLint: a code linter to enforce valid comments.
  • ESDoc: a plug-in that automatically generates a documentation template as you code.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store