Example Block Comments for Code

Ole Ersoy
1 min readJun 3, 2020

--

Image by frianett from Pixabay

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

--

--

Ole Ersoy

Founder of Firefly Semantics Corporation