DEV Community

Discussion on: Should comments in code be considered failures in coding?

 
rossdrew profile image
Ross • Edited

Yes, code comments. Any comments in the code block or any comments which explain specific low level implementations in the code block.

Thread Thread
 
stereobooster profile image
stereobooster

To be fair most of my examples can be put in the top of a function, including definitions, explanation of business rules, explanation of code optimizations, etc. So I don't see any contradiction anymore

/* This is classical implementation of Dijkstra algorithm, except that we skip allocation of heap in ... which makes it a bit slower, but take less memory */
const traverseGraph = () => {}

It seems we can agree on this