DEV Community

loading...

Discussion on: What are your worst coding habits?

Collapse
pedrommarquesm profile image
Pedro Marques

I work in a small team (2 front-end devs), and my co-worker is a bit picky about documenting every function, class, method, etc etc.
But sometimes all he documents is something a function name tells it upfront, I really think there's no purpose in doing something like:

/** This function transforms lower case string to uppper case **/
function lowerCaseToUpper(str...);

If you declare functions and variables with intuitive names, sometimes there's no need to explain them :)

Collapse
bytenaija profile image
Everistus Olumese

It is called self-documenting functions for a reason right?

Thread Thread
pedrommarquesm profile image
Pedro Marques

yup... unless that function transforms the string using some alien computation, there's no need for that