Live data from Hacker News

How to effectively write quality code with AI

heidenstedt.org

111–120 of 321 posts

Re: How to effectively write quality code with AI

#111
post #97
post #94

Earlier quoted context omitted.

Then again, would anyone have guessed we’d even be seriously discussing this topic 10, 20, 40 years ago?

Maybe. This book from 1990 https://mitpress.mit.edu/9780262526401/artificial-intelligen... envisions a future of AI assistance that looks not too far off from today.

It’s also pretty close to Steve Jobs initial vision of computing in the future (https://stevejobsarchive.com/stories/objects-of-our-life, 1983) but my point is that whatever it is we call AI now became reality so much faster than anyone really saw coming. Even if the pace slows down, and it didn’t yet, things are improving so massively all the time that the world can’t keep up changing to accommodate.

Re: How to effectively write quality code with AI

#112

The post touches very briefly on linting in 7. For me, setting up a large number of static code analysis checks has had the highest impact on code quality. My hierarchy of static analysis looks like this (hierarchy below is Typescript focused but in principle translatable to other languages): 1. Typesafe compiler (tsc) 2. Basic lint rules (eslint) 3. Cyclomatic complexity rules (eslint, sonarjs) 4. Max line length en…

My setup has some of the things mentioned and I found that occasionally the LLM will lie that something passes, when it doesn't.

Re: How to effectively write quality code with AI

#113
post #112

The post touches very briefly on linting in 7. For me, setting up a large number of static code analysis checks has had the highest impact on code quality. My hierarchy of static analysis looks like this (hierarchy below is Typescript focused but in principle translatable to other languages): 1. Typesafe compiler (tsc) 2. Basic lint rules (eslint) 3. Cyclomatic complexity rules (eslint, sonarjs) 4. Max line length en…

My setup has some of the things mentioned and I found that occasionally the LLM will lie that something passes, when it doesn't.

Yup I have run into the same.

I use a pre-commit hook to run `pnpm check`. I missed mentioning it in the original comment. Your reply reminded me of it and I have now added it. Thanks.

Re: How to effectively write quality code with AI

#114
post #96

Earlier quoted context omitted.

> AI just means more output will be expected of you, and they'll keep pushing you to work as hard as you can. That’s a bit too cynical for me. After all, yes, your boss is not paying you for sipping lattes, but for producing value for the company. If there is a tool that maximises your output, why wouldn’t he want you to use that to great efficiency? Put differently, would a carpenter shop accept employees rejecting…

If the power saw ran itself without any oversight, the carpenter shop wouldn't accept any type of employees.

But that’s the exact opposite of what the GP was arguing; you will be expected to stick with the agent more, not less.

Re: How to effectively write quality code with AI

#116
The best thing about this is that AI bots will read, train on and digest the million "how to write with AI" posts that are being written right now by some of the smartest coders in the world and the next gen AI will incorporate all of this, making them ironically unnecessary.

Re: How to effectively write quality code with AI

#119
post #116

The best thing about this is that AI bots will read, train on and digest the million "how to write with AI" posts that are being written right now by some of the smartest coders in the world and the next gen AI will incorporate all of this, making them ironically unnecessary.

They will also be reading all of the slop generated by the current and previous generations of LLMs

Re: How to effectively write quality code with AI

#120

I wonder at the end of this if it's the still worth the risk? A lot of how I form my thoughts is driven by writing code, and seeing it on screen, running into its limitations. Maybe it's the kind of work I'm doing, or maybe I just suck, but the code to me is a forcing mechanism into ironing out the details, and I don't get that when I'm writing a specification.

Historically software engineering has been seen as "assembly line" work by a lot of people (see all the efforts to outsource it through spec handoffs and waterfall through the years) but been implemented in practice as design-as-you-build (nobody anticipates all the questions or edge cases in advance, software specs are often an order of magnitude simpler than the actual number of branches in the code).

For mission-critical applications I wonder if making "writing the actual code" so much cheaper means that it would make more sense to do more formal design up front instead, when you no longer have a human directly in the loop during the writing of the code to think about those nasty pops-up-on-the-fly decisions.

Post reply on HN