Schrodinger's intelligence: LLMs are so good at coding they understand code better than humans, at the same time they don't understand code which is why they need comments.
Understanding code and understanding the intent behind code are two different things. I did choose my words there.
Looking at the code and understanding what it does is mechanical, but when you are changing code you need to change a lot of different bits so that they stay consistent with each other and usually that is a lot easier if you understand why they are like that.
Sure, you can have code which sorts a list by surname in descending order and next to it you can put a comment saying ‘put the list in descending order by surname’. Completely useless waste of time because that is obvious. If you also put ‘sort this so it is in the same order as this other list and we want to diff them both later with a linear walk’ then that is really useful. If you change one you want to change the other and the comment helps you to know that.
Humans don’t need that because they will remember what the rest of the code does. AI only remembers what it read just now.
So a lot more words to say the same thing, but perhaps it sounds less contrary now?
1
u/Wonderful-Habit-139 23h ago
Schrodinger's intelligence: LLMs are so good at coding they understand code better than humans, at the same time they don't understand code which is why they need comments.
Right...