10 ms·
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
by freeopinion 8mo 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.
- tomaskafka 8mo agoYou’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.
- lokar 8mo agoI 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 8mo agoI 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.
- lokar 8mo agoAnd each time you do this, you make it worse. Now, if anyone ever wants to fix this, they have to fix your code as well.
- freeopinion 8mo agoYou could say that. The schema in question was not mine nor in any way within my control. I could start up a business and write an entire app to replace the one in question. Maybe I could even get you to donate some money to fund that endeavor. Or I could spend an hour one time to code an external work around so I don't have to spend two hours a cycle fighting with that stupid app. This is how ridiculous workflows evolve, but it really isn't AI's fault.
- aunty_helen 8mo agoNever 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…
- skzizjj 8mo ago[dead]
- wtetzner 8mo agoYeah, it's addictive in a way similar to scrolling social media shorts or playing a slot machine.
- nijave 8mo agoIt'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 8mo agoYup, 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.