top | item 46935310

(no title)

freeopinion | 22 days ago

I think it is pretty indisputable that there is a valuable place for AI. I recently had to interact with a very horrible db schema. The best approach I came up with to solve my challenge involved modelling a table with 300 columns. Converting some sql ddl to a Rust struct was simple but tedious work. A prompt with less than 15 words guided an AI to produce the 900+ loc for me. It took a couple seconds to scan it to see that each field had both annotations I needed and the datatypes were sane.

That is exactly the type of help that makes me happy to have AI assistance. I have no idea how much electricity it consumed. Somebody more clever than me might have prompted the AI to generate the other 100 loc that used the struct to solve the whole problem. But it would have taken me longer to build the prompt than it took me to write the code.

Perhaps an AI might have come up with a more clever solution. Perhaps memorializing a prompt in a comment would be super insightful documentation. But I don't really need or want AI to do everything for me. I use it or not in a way that makes me happy. Right now that means I don't use it very much. Mostly because I haven't spent the time to learn how to use it. But I'm happy.

discuss

order

lokar|22 days ago

I worry that means the bad code / schema / design never gets improved.

I've spent a lot of my career cleaning up stuff like that, I guess with AI we just stop caring?

onehair|22 days ago

I wonder just what goes into someone's mind, when they do not care about who in the future is gonna have to maintain what they've crafted. Nor care about the experience of the user. Nor even feel accountable when they haven't done their due diligence to do things right.

aunty_helen|21 days ago

Never gets prematurely optimised.

If it’s causing issues you can just ask the ai to improve that part. Shit, it will often even identify problematic areas.

And if migrating from a complete dumpster fire to a cleaner working system sounds hard, I’ve got news. AI can do that for you too! Just get it to write the migration files.

This is what it means to be a developer from today onwards…

nijave|21 days ago

It's still possible to script out codegen. Frequently use Python to generate code like that.

Really I'd rather have AI generate a codegen script that deterministically does the struct from schema generation

I've had enough instances where it's slid in a subtle change like adding "ing" to a field name to not fully trust it

krackers|21 days ago

Yup, it feels weird to use LLMs to perform large scale refactors, but LLMs to meta-codegen which you then use to do the refactor works really well. The quality of the generated tool itself doesn't matter so long as it's deterministic and you can reasonably see what it's doing. It the same vein it works nicely for random one-off parsers (either DSL parsing or abstractly as screen scraping): nothing you'd be robustly confident in, but good for throwaway parsing.

tomaskafka|22 days ago

You’d have consumed probably 2+ magnitudes of energy or more just for coffee (and its growth and supply chain) to write that piece of code. Not counting the building, food, transportation…

Us humans are expensive part of the machine.

wtetzner|22 days ago

Yeah, it's addictive in a way similar to scrolling social media shorts or playing a slot machine.