I can't help but think that some of the arguments here apply equally well to writing _code_ as they to to other substantive writings.
Writing code is thinking, AI code is often vague and wrong in hard-to-notice ways, and the (human) reader of code is the one that pays the cost for this later.
The cost/benefit analysis may still work out differently for code though...
I never use AI for writing but do so regularly for code. They are quite different to me.
My reason: code can be checked objectively. I can run it and confirm it works. I don't get attached to it. I don't feel pride in it (even when I write it by hand). Code just is. It's lifeless, inert, and entirely replaceable.
How do I do the equivalent for prose? How can I tell if my words "work"? Do they clearly convey my ideas to the intended audience? There's an element of subjectivity here forces me to identify personally with the prose.
Code has no such personality. I don't tie my identity or ego to code the same way I would an essay.
> My reason: code can be checked objectively. I can run it and confirm it works.
Running the code only confirms that it works with the precise input, in the precise environment, under the precise circumstances you run it under. It doesn’t ensure that the code is correct. Thinking through the code, on the other hand, lets you consider all possible cases. It’s the difference between experiment and (mathematical) proof.
For an objective correctness proof, using a formal language is indispensable.
Even thinking through the code is not complete because our brains make mistakes. They also make assumptions, thousands of them, that you don’t know about. It’s tricky, because every thought you have has an entire sea of preconceived notions and knowledge behind it, which you can’t identify. In that way, it’s similar to an LLM.
In practice, for code, testing code is the way to go. Formal proofs work, too, but the barrier to entry is high and it’s overkill for most business applications. LLMs can be very good at writing tests, if you read the test thoroughly and analyze them.
vanschelven · · focus · HN ↗
Writing code is thinking, AI code is often vague and wrong in hard-to-notice ways, and the (human) reader of code is the one that pays the cost for this later.
The cost/benefit analysis may still work out differently for code though...
perrygeo · · focus · HN ↗
My reason: code can be checked objectively. I can run it and confirm it works. I don't get attached to it. I don't feel pride in it (even when I write it by hand). Code just is. It's lifeless, inert, and entirely replaceable.
How do I do the equivalent for prose? How can I tell if my words "work"? Do they clearly convey my ideas to the intended audience? There's an element of subjectivity here forces me to identify personally with the prose.
Code has no such personality. I don't tie my identity or ego to code the same way I would an essay.
layer8 · · focus · HN ↗
Running the code only confirms that it works with the precise input, in the precise environment, under the precise circumstances you run it under. It doesn’t ensure that the code is correct. Thinking through the code, on the other hand, lets you consider all possible cases. It’s the difference between experiment and (mathematical) proof.
For an objective correctness proof, using a formal language is indispensable.
preg_match · · focus · HN ↗
In practice, for code, testing code is the way to go. Formal proofs work, too, but the barrier to entry is high and it’s overkill for most business applications. LLMs can be very good at writing tests, if you read the test thoroughly and analyze them.
xiaoyu2006 · · focus · HN ↗