Hacker News new | ask | show | jobs
by kretaceous 1616 days ago
Slightly tangent but one thing that these code practices languages often miss is using the language to its fullest. Most beginner developers who are not very used to the language reinvent the wheel for a lot of in-built functions. For example, I've seen stuff like:

` const arr = []; for (let i = 0; i < anotherArray.length; i++){ arr.push(someOperationOnEachElement(anotherArray[i])) } `

instead of

`const arr = anotherArray.map(someOperationOnEachElement)`

Not knowing what your tool/PL can do can lead to hard-to-maintain code. One should really leverage the expressiveness and syntactic sugar wherever relevant.

1 comments

EDIT:

code practices languages -> clean code practices articles* can do can lead -> can lead

(There's no edit option for me, so replying:)