Help with JS Method Commenting (+ Feedback if u want)

Hi, this isn't a question to a specific Problem more a newbie asks veteran for general advise ๐Ÿ˜„ I finished my second javascript homework, a IdeaList. Last time they said we should comment/describe methods that are not self explanatory. Im a little confused since I dont think any of them are not self explanatory? Which methods would u give a comment/discription header? If u got any other feedback hand it right at me. I'm still a newbie and CSS is rly not my strongest I always have to keep asking Copilot on how to do stuff xD CodePen: https://codepen.io/Becii/pen/vEEvzYm
Rebecca
CodePen
IdeaList
...
7 Replies
แผ”ฯฯ‰ฯ‚
from an ux/ui point, you dont have labels placeholders are NOT replacements for labels if i type a character, the placeholder vanishes and i dont know what the field is supposed to be for selecting and deselecting an idea makes it move around because of the change in border size that can make things harder to use, specially if the buttons move around because of the bigger border use an outline instead this is specially important for the editing you just dump the values into fields but the placeholder is gone and the comments suffer from the same issue in terms of colors, seems pretty good to me but the delete and save or edit buttons look too similar that will cause people to click the wrong button by mistake and since you dont confirm if the person wants to delete the idea, then it is just gone that is VERY dangerous
Becii
BeciiOPโ€ข4mo ago
Ty @แผ”ฯฯ‰ฯ‚ for the ui/ux input we didnt learn how to do ui/ex correctly yet so any feedback is great there ๐Ÿ˜Š
แผ”ฯฯ‰ฯ‚
you're welcome your code does need a lot of work, but, the correct place for that feedback is usually in #showcase there are other things to say about it as well, but, #showcase is probably the best place
13eck
13eckโ€ข4mo ago
Which methods would u give a comment/discription header?
Without even looking at your code I can confidently and safely say all of them. Comment everything. Your comments are not for you right now. They're for you 6 months from now. They're for you 2 years from now. If you're on a team they're for the new team members who have never looked at the codebase before. As a bonus, if you use JSDoc then your comments become your documentation! (and type checking, too!) Comments are for you when you come back to this project after doing three other ones and this codebase isn't fresh in your memory. What you think is obvious/self-explanatory now won't be after you've not looked at this code in a long time. So do future-you a favour and comment everything. Now, that being said, it's also on you to update your comments as things change. Outdated comments/documentation is worse than none, so if you do comment your code (and you are, right!?) be sure to update the comments every time you change the function.
Becii
BeciiOPโ€ข4mo ago
okey ty, y thats what we do in java aswell its not that I didnt want to do the comments its more I was confused by the "explainatory" part ๐Ÿ˜„ ty for the time you took to not only tell me to do it but the explain the reasoning behind it ๐Ÿ™‚ oh didnt know that ๐Ÿ˜ฎ
13eck
13eckโ€ข4mo ago
"Telling someone what to do is pointless. Tell them why to do it and they'll have to think" โ€“Some smart person, I'm sure ๐Ÿคท
แผ”ฯฯ‰ฯ‚
lets just say you are mixing 90's style with some bad ideas from the 2010's and yes, document EVERYTHING

Did you find this page helpful?