I think comment ratio could be a fairly misleading metric. There are programs out there that requires a lot of context upfront that distills down to just a few lines of code, and especially those that are more academically interesting.
Comment on I didn't want to use AI, so I made something that detects it!
fccview@lemmy.world 3 days agoHey!
Thank you for testing it out, I think in my head, even the most verbose of dev wouldn’t leave >20% of comments in their codebase. The percentage works on a ratio of (commentsCount / linesOfCode) * 100 so it doesn’t just flag “a lot of comments”, it mostly checks for “too many comments”, that said, the “use common sense” at the top needs to be taken quite seriously, for example if there’s a majority of comments but none of the comments feel like written by AI, it’s clearly just the developer being verbose :)
p.s. I find AI is pretty damn good at making docker compose files, it’s probably gonna work just fine <3
Subscript5676@lemmy.ca 2 days ago
fccview@lemmy.world 2 days ago
Hey! Yeah you are right, I may remove the >20% comments to line of code resulting in the code being 100% AI driven
That said, you are obviously referencing a very niche sector, the vast majority of software engineering doesn’t require that absurd amount of comments… I can’t stress enough how verbose a ratio of 20% comments to lines of code actually is lol
Subscript5676@lemmy.ca 2 days ago
I don’t claim it to be common practice, just saying that it exists. That said, it may be “niche” in the grand scheme of things, but by no means do I think it’s small and insignificant. If anything, such codebases are typically foundational libraries in the giant stack of cards most other software engineers build.
See also antirez’s article about code comments www.antirez.com/news/124 You’ll notice how some of the snippets would’ve easily failed your criteria.
fccview@lemmy.world 1 day ago
I don’t claim it to be common practice, just saying that it exists. That said, it may be “niche” in the grand scheme of things, but by no means do I think it’s small and insignificant. If anything, such codebases are typically foundational libraries in the giant stack of cards most other software engineers build.
That’s indeed very valid! As I said, I may have been a bit too harsh on the comment rule, definitely one to review properly <3
irmadlad@lemmy.world 2 days ago
Well, I guess that’s where it’s pretty clear that I’m no dev. LOL Give me a # key and I’ll go nuts. At my age, and with other issues, I need all the help I can get. It’s a pretty cool tool ackchyually. I tested out a few more compose files last night without commenting and they seemed to pass the test. Thanks for sharing. It was a pretty fun experience.
fccview@lemmy.world 2 days ago
Aw thank you for the kindness ♥️ There’s nothing wrong in verbosity btw, I may have been a bit too harsh on my parameters, I’ll tweak it a little :)