Example Block Comments for Code

Scenario

We are writing an algorithm and we need to make sure we are doing each step correctly.

Approach

Lets just assume that a step adds two number.

//==============================================
// We add the first number to the second number
// So if the first number is 1 and the second number
// is 2 the sum is 3.
//==============================================
let sum = a + b

This example is simple. I find that for more advanced logic this is very helpful. I also find that my variable names become better and more meaningful.

Related

--

--

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
Ole Ersoy

Ole Ersoy

Founder of Firefly Semantics Corporation