Viewing a single comment thread. View all comments

Hyper1on t1_j0m9ui8 wrote

But it is often faster to write in comments a description of the algorithm you want, even if complex, then it is to code it up yourself (especially if coding involves any googling, risk of off by one errors, etc). Besides, it's easier to verify solutions than to write them.

1

kypjks t1_j0nase5 wrote

You don't get the point. In many times, it is much faster to write code itself rather than adding comment to explain it. Adding comment to define precise behavior is not that simple. If you see lots of comments, that code is very unusual. Take a look at serious open source project like linux kernel and android. If you pick up any non trivial code from those and try to define comments to explain what the code is doing, it will take way more efforts. If it is taking more time, why would any serious sw project do that?

1

Hyper1on t1_j0nbs7q wrote

I don't know about the linux kernel source, but having contributed to several major OSS libraries including Pytorch, I think that most PRs in my experience can be more easily described in natural language than in code. When I said comments, I didn't mean like line by line comments of everything, but I was more thinking of docstrings. I am very sceptical of the idea that on average it is faster to write complex code than to describe what you want it to do, which is partly why I think AI code synthesis can achieve significant speedups here.

3