Live data from Hacker News

AI is forcing us to write good code

bits.logic.inc

51–60 of 229 posts

Re: AI is forcing us to write good code

#51
post #29

Strong agreement with everything in this post. At Qlty, we are going so far as to rewrite hundreds of thousands of lines of code to ensure full test coverage, end-to-end type checking (including database-generated types). I’ll add a few more: 1. Zero thrown errors. These effectively disable the type checker and act as goto statements. We use neverthrow for Rust-like Result types in TypeScript. 2. Fast auto-formatting…

I‘m on the same page as you, I‘m investing into DX and test coverage and quality tooling like crazy. But the weird thing is: those things have always been important to me. And it has always been a good idea to invest in those, for my team and me. Why am doing this 200% now?

Because a) the benefits are bigger, and b) the effort is smaller. When something gets cheaper and more valuable, do more of it.

Re: AI is forcing us to write good code

#52
post #24

Earlier quoted context omitted.

They are retrained every 12-24 months and constantly getting new/updated reinforcement learning layers. New concepts are not the problem. The problem is outdated information in the training data, like only crappy old Postgres syntax in most of the Stackoverflow body.

> They are retrained every 12-24 months and constantly getting new/updated reinforcement learning layers This is true now, but it can't stay true, given the enormous costs of training. Inference is expensive enough as is, the training runs are 100% venture capital "startup" funding and pretty much everyone expects them to go away sooner or later Can't plan a business around something that volatile

You don't need to retrain the whole thing from scratch every time.

Re: AI is forcing us to write good code

#53
post #50
post #44

This is sort of why I think software development might be the only real application of LLMs outside of entertainment. We can build ourselves tight little feedback loops that other domains can't. I somewhat frequently agree on a plan with an LLM and a few minutes or hours later find out it doesn't work and then the LLM is like "that's why we shouldn't have done it like that!". Imagine building a house from scratch and…

It's more like you're installing the dishwasher and the dishwasher itself yells at you "I told you so" ;)

I think of it as you say "install dishwasher" and it plan looks like all the steps but as it builds it out it somehow you end up hiring a maid and buying a drying rack.

Re: AI is forcing us to write good code

#58

Wouldn't a better title be "How we're forcing AI to write good code (because it's normally not that good in general, which is crazy, given how many resources it's sucking, that we need to add an extra layer on top of it and use it to get anything decent)"

Don't forget "we're obligated to try and sell it so here's an ai generated article to fill up our quota because nobody here wanted to actually sit down and write it"

FWIW all of the content on our eng blog is good ol' cage-free grass-fed human-written content.

(If the analogy, in the first paragraph, of a Roomba dragging poop around the house didn't convince you)

Re: AI is forcing us to write good code

#60
I thought that the article would be about if we want AI to be effective, we should write good code.

What I notice is that Claude stumbles more on code that is illogical, unclear or has bad variable names. For example if a variable is name "iteration_count" but actually contains a sum that will "fool" AI.

So keeping the code tidy gives the AI clearer hints on what's going on which gives better results. But I guess that's equally true for humans.

Post reply on HN