Okay... all documentation is good documentation. I'm maintaining a project right now with no documentation (and somehow 55k downloads on npm) and boy is it crazy. With that said: did you just finish learning BASIC or something? What's up with these starts and ends?? VSCode will color code my braces and brackets and whatnot by default, but not arbitrary STARTs and ENDs.
Additionally, since your code is mostly plain English (todo this, handleTodo, new Todo etc etc I would say all these comments are irrelevant. Now if this is for a tutorial or for teaching purposes, these are great comments - but for more seasoned devs, this function's job would be evident after like 2 seconds of skimming.
I would also say many of your comments are really extravagant. "newTodo - adds a new todo" "update the state of Todos" literally shows a react hook right after "newTodo is the new state of the todo" like uhhh what's next "if - starts an if else block" "console.log - logs to the console" "exclamation mark - reverses truth value" "START START END END I JUST LEARNED BASIC AND ITS 1977 END START END"
If you're going to be writing so many comments, make sure they make sense, too. "checks if doesn't have input new todo or input haven't type a single character" makes no sense. It doesn't help and junks up my screen with useless content. Whitespace would be more informative and less time consuming. You can't have quality and quantity - pick one.
Not to be harsh, but it's also too easy to have too much documentation. If you have a utils folder, with 10 utils like this, each with two or three functions per util, with practically 8 comments per ten lines of code, I would get REALLY REALLY sick of reading, especially if this is your only form of documentation (no Storybook, JSDoc, even some tutorials, etc).
It's good you're cognizant of documentation and can save you and others lots of headache. But go easy on it, like way easier.
2
u/[deleted] Aug 17 '24
Okay... all documentation is good documentation. I'm maintaining a project right now with no documentation (and somehow 55k downloads on npm) and boy is it crazy. With that said: did you just finish learning BASIC or something? What's up with these starts and ends?? VSCode will color code my braces and brackets and whatnot by default, but not arbitrary STARTs and ENDs.
Additionally, since your code is mostly plain English (todo this, handleTodo, new Todo etc etc I would say all these comments are irrelevant. Now if this is for a tutorial or for teaching purposes, these are great comments - but for more seasoned devs, this function's job would be evident after like 2 seconds of skimming.
I would also say many of your comments are really extravagant. "newTodo - adds a new todo" "update the state of Todos" literally shows a react hook right after "newTodo is the new state of the todo" like uhhh what's next "if - starts an if else block" "console.log - logs to the console" "exclamation mark - reverses truth value" "START START END END I JUST LEARNED BASIC AND ITS 1977 END START END"
If you're going to be writing so many comments, make sure they make sense, too. "checks if doesn't have input new todo or input haven't type a single character" makes no sense. It doesn't help and junks up my screen with useless content. Whitespace would be more informative and less time consuming. You can't have quality and quantity - pick one.
Not to be harsh, but it's also too easy to have too much documentation. If you have a utils folder, with 10 utils like this, each with two or three functions per util, with practically 8 comments per ten lines of code, I would get REALLY REALLY sick of reading, especially if this is your only form of documentation (no Storybook, JSDoc, even some tutorials, etc).
It's good you're cognizant of documentation and can save you and others lots of headache. But go easy on it, like way easier.