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
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
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
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.
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 ๐ฎ
"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