Message from JavaScript discussions

September 2020

— And names can't be as descriptive

— 

Check the example

var a = -1;
var c = 100;
while (++a < c) {/*do something*/}

vs
let temporaryIntegerIndex = -1;
const unchangeableIntegerCountOfLoopCycles = 100;
while (++temporaryIntegerIndex < unchangeableIntegerCountOfLoopCycles) {/*do something*/}

— Thanks

— I don't see any name reuse in either of these

— Ah, name re-use.. just use comments //

— Also watch the async / await video

— Wat

— You're misunderstanding, or I am

— Show an example of what you mean by name reuse

— (facilitated by using var)

— At the start of new block, you put a short description of what it does, like

// start of the function
var a,b,c,d;// temp
var r1,r2;// results

// block A (uses a,b,c)
// ...
r1 = a

// block B (re-uses a,b,c)
// ...
r2 = a

// end
return r1 + r2

Message permanent page

— Jesus christ