27 ms·
And the code is godawful. Just look at this mess for internationalization: https://github.com/i365dev/LetterDrop/blob/main/app%2Fsrc%2Findex.ts#L173-L431 https:
by khold_stare 2y ago
And the code is godawful. Just look at this mess for internationalization: https://github.com/i365dev/LetterDrop/blob/main/app%2Fsrc%2Findex.ts#L173-L431 https://github.com/i365dev/LetterDrop/blob/main/app%2Fsrc%2F... . The code is unmaintainable by a human - there is a ton of unnecessary duplication, a gigantic html string instead of something like tsx, etc etc. I don't know how the OP can trust this output - I certainly don't.
- garylkz 2y agoAren't that basically all those web framework that we've been using (except that it's worse and less maintainable)? The code generated is very hard to be maintained by human unless you're very knowledgeable and knows what specific things to change (since generally we only interact on framework level unless there's some specific requirements, like how the author proposed to "modify the prompt" instead of the generated code) That said, I don't think that the so called "prompt based" cough cough engineering is viable at current state, or anytime soon.
- gavmor 2y agoWow, CSS in a style tag in a string in try block in an anonymous function all declared right there in index.ts—no units, to say nothing of tests! Would be a huge nuisance to maintain.
- Closi 2y agoHuge nuisance to manually maintain, but the suggestion is that you maintain it with an LLM. Is the code bad? Sure. Could I build this in 10 hours without an LLM having no experience with cloudflare workers and typescript? Probably not. Could I build this in 10 hours with an LLM? Probably.
- gavmor 2y agoLook, maybe I'm naive but the "technical debt" this approach generates is appalling. Someone's going to have to shave that yak or you'll trip over it on your way to market. Whatever happened to "write code like it'll be maintained by an axe murderer?"[0] 0. https://wiki.c2.com/?CodeForTheMaintainer https://wiki.c2.com/?CodeForTheMaintainer
- mvdtnz 2y agoYikes. Best of luck adding a new language or updating your templates without introducing bugs or discrepancies.
- anonzzzies 2y agoI am in a (large) project currently that has been running since 2016; it has 100k+ files like this. The team (I am there to write a code quality report ;) of humans has 0 problems maintaining it. This weird ‘all code must be pristine’ attitude on HN is interesting; I do a lot of these types of code audits and more than 80% of mission critical code I encounter at large companies / institutions is like this or worse and is happily maintained by humans. Take some Spring projects started somewhere in the 2000s with the original team gone: I see 10000s of lines added in jsps files because it was faster/easier to do than actually understanding the structure and properly writing the classes etc.
- braza 2y ago> And the code is godawful You would be surprised on how big corporations are running on not so elegant code and generating revenue all over. I used to be more principled around code best practices and having things well written, but with the LLMs I just discovered that unless your in a very critical domain where performance or maintenability is a hard requirement, the LLMs with bad code just solve the problem and everyone can be happy.
- croes 2y agoAre these the same companies we hear about because the got hacked because of security holes in their code?
- braza 2y agoIt’s not a direct relationship as far as I know. The point is that maybe the LLMs gave enablement for the people that thinks about software as a “means to an end” and I think it’s completely fine. I like elegant code, well written and easy to maintain; but for a long time the field of programming started to develop the pristine idea that the programming _was the end_ and not as a way to achieve something. What’s the post author made was to bring it in a more latent way saying that you could use programming to achieve the same results but you do not need.
- latexr 2y agoEveryone, that is, except for the customers dealing with buggy slow products that will eventually be breached and leak their data. And the good developers who now have to hunt for dumb bugs without clues for where to look because the person who generated the code can’t help either.
- phantompeace 2y agoBut good developers can use LLMs to hunt for the dumb bugs ;)