JUST WONDERING…
Why you folks AVOID writing GOOD READABLE CODE while writing EDITORIALS ?
That will significantly improve the reading time & experience.
I appreciate the team's effort of posting quality content & resource material as the editorials.
I would like to know how the community thinks about it.
The Editorial ’ s Code are:
- Not Readable Code at All
- Somewhat Readable Code
- Highly Readable Code
0 voters
Problem can be fixed with :
- Better Explanation in the Post
- Writing More Maintainable Logic in the Code
- Writing Clear Variable Names
0 voters
I created this thread to know the thoughts of the community. And Perhaps do our part to uplift the platform.
All Thoughts are Welcomed!
EDIT 1
Take this as an Analogy ( with a grain of salt )
Consider there is a Magical Problem of Finding MAX element.
Followed by really well explanation on how to approach this…
After reading a little, I might wonder how the solution looks like.
And, after Clicking on a solution, I get the following.
console.log([5,4,3,9,7,4,15,].reduce((x,y) => y > x ? y : x));
For those familier with it, might know what it is. Even if the post is very detailed, after looking at it, some people (including me also ) will be like, "WAIT, WHAT? HUH ?"
Just because it is well detailed, won’t it be kind of really helpful to have really a much readable version AS EDITORIAL ? For example,
let array = [5,4,3,9,7,4,15,]; //initialization
function findMax(firstNumber,secondNumber) {
if ( firstNumber > secondNumber) {
return firstNumber;
}
return secondNumber;
}
let maxValue = array.reduce(findMax); // iterate over the array &
// Reduce it to only max Value in that array
console.log(maxValue); // Print the Max
At this point the code is self explanatory, compared to the previous one.
Quick Example Reference : CODING TRAIN YOUTUBE CHANNEL
As always, All Thoughts are Welcomed!