The only times I’ve seen devs do inline comments in their code is when it’s been done by AI, and I can tell it’s AI because the comments are all useless and describing what’s happening, not why.
AI mostly learned it from programming tutorials and things like documentation and Q&A forums like StackOverflow. People often add comments in those cases to explain to somebody not familiar with code what is happening so they can learn from it.
In actual code written by people who write code for a living I’d hope the comments are much more useful and usually not as prevalent.
I actually got really clean, well commented code from Copilot earlier this week.
I have no experience with JavaScript to speak of, but realized a Bookmarklet would be a perfect solution for reformatting a particular web app for printing. I already had a head replacement with CSS to do all the formatting, and I was using a RegEx to strip all script tags.
Anyway, I asked Copilot to write the Bookmarklet to replace the header, with full contents explaining the training behind the code, and an explanation of how the script functions below. When I got an error, I asked if to fix the error and or identified that Bookmarklets work better as single lines, so it fixed it. Then I added the requirement about replacing scripts, and it did that too, but for commented and a clean one-line version.
The one-live versions even up getting truncated, so I need to copy/paste from earlier (correct) endings, but otherwise it was an incredibly smooth experience.
I spent longer writing the guide for how to use it than the time it took to vibe code it and test it. I was super impressed.
You claim no JavaScript experience, declare confident in the comments and include any examples.
All you’ve really said here is you vibed coded a solution to a problem using one of the most common languages without knowing the language. And made claims you do not attempt to prove.
// 🤦 You are totally right! Simply logging the 🚨 error to the console isn't proper error handling. 🫣 We now throw an exception instead. throw new ApplicationException(error);
The only times I’ve seen devs do inline comments in their code is when it’s been done by AI, and I can tell it’s AI because the comments are all useless and describing what’s happening, not why.
// Format user object function formatUserObject(user) {I’ve seen lots of such crap written by humans. I guess AI had to learn it from somewhere.
AI mostly learned it from programming tutorials and things like documentation and Q&A forums like StackOverflow. People often add comments in those cases to explain to somebody not familiar with code what is happening so they can learn from it.
In actual code written by people who write code for a living I’d hope the comments are much more useful and usually not as prevalent.
I actually got really clean, well commented code from Copilot earlier this week.
I have no experience with JavaScript to speak of, but realized a Bookmarklet would be a perfect solution for reformatting a particular web app for printing. I already had a head replacement with CSS to do all the formatting, and I was using a RegEx to strip all script tags.
Anyway, I asked Copilot to write the Bookmarklet to replace the header, with full contents explaining the training behind the code, and an explanation of how the script functions below. When I got an error, I asked if to fix the error and or identified that Bookmarklets work better as single lines, so it fixed it. Then I added the requirement about replacing scripts, and it did that too, but for commented and a clean one-line version.
The one-live versions even up getting truncated, so I need to copy/paste from earlier (correct) endings, but otherwise it was an incredibly smooth experience.
I spent longer writing the guide for how to use it than the time it took to vibe code it and test it. I was super impressed.
(Granted, that’s a pretty easy coding task…)
You claim no JavaScript experience, declare confident in the comments and include any examples.
All you’ve really said here is you vibed coded a solution to a problem using one of the most common languages without knowing the language. And made claims you do not attempt to prove.
// 🚨 Log error to console console.error(error);// 🤦 You are totally right! Simply logging the 🚨 error to the console isn't proper error handling. 🫣 We now throw an exception instead. throw new ApplicationException(error);