3 ms·
AI also loves to explain what code does with stuff like this: // Check if sensor is available if (sensor.isAvailable()) { // Read current angle
by tobyhinloopen 1y ago
AI also loves to explain what code does with stuff like this:
// Check if sensor is available
if (sensor.isAvailable()) {
// Read current angle
double angle = sensor.readAngle();
Which, to me, is a clear indicator of the author (being AI, I hope) not caring about code readability.
- ofrzeta 1y agoYeah, it's typical for LLMs. A comment anti-pattern. I wonder if LLM explainability can deliver and answer on "why" they are doing it.
- numpad0 1y agoThis one is hallmark of Arduino sample code, which consists a majority of materials found on the internet regarding sensors and code. I think the original human intent is to inflate mental share on hardware and/or time domain issues as those are just routine occurences in Arduino projects.
- mort96 1y agoI wouldn't be surprised if it improves the language model's ability to write code. By inserting useless comments like that, its context will contain a very recent "prompt" of what it's trying to do when it actually writes the code.
- bapak 1y agoI need to create an AI agent that comments on any PR when it finds useless comments
- Aurelius108 1y agoOddly enough I find senior engineers at my company demand ridiculous comments like this oddly enough. I've found that a 1:3 comment:code ratio (basically a comment every 2-3 lines with a new line separating each block) is the only thing that will prevent some annoying code review comments asking for clarifications.
- tobyhinloopen 1y agoGive them a copy of Robert C Martin’s Clean Code hah
- walthamstow 1y agoI'm fighting this shit so hard at work every day, every PR review. The LLM writes comments like someone who can't read code is going to read it.
- balamatom 1y agoBold of you to assume the majority of developers can read code.
- jay-barronville 1y ago> Bold of you to assume the majority of developers can read code. Haha. Bold indeed.
- Aurelius108 1y agoUnfortunately staff engineers at my company will demand annoying comments like this so I don't think it's necessarily a sign of vibe coding
- saagarjha 1y agoOne would hope that the principal engineers above them have more sense…
- socalgal2 1y agoI get worse. I write a test TEST(SubSystemABCTest,CheckIfAIsNegativeItThrows) { .... } And I get told all tests need a comment so I copy that line and add spaces between the words. WTF! >:(
- Aurelius108 1y agoI’ve run into this as well, it’s so obnoxious. Now I just go into multiple cursors mode and type the same exact stuff multiple times haha.
- hackingonempty 1y agoWhat if a human wrote all of the comments in the function first then wrote the code? Should they then delete the comments?
- tobyhinloopen 1y agoYes 100%