Hacker News new | ask | show | jobs
by gkdktstjtsjfy 732 days ago
"I used the GPT-4o model to generate the code for LetterDrop. That means the code is generated by the AI model, and I only need to provide the prompts to the model. This approach is very efficient and can save a lot of time. I've also recorded a video to show how to create the LetterDrop project using the GPT-4o model.

That also means you can easily customize the code by changing the prompts. You can find the prompts in the CDDR file."

???????

3 comments

This is from the "How to contribute?" section in readme.

Personally, I found it unbelievable. The author think contribute should change the prompt instead of the code.. To my best knowledge, these kind of code generation are non deterministic. This make it impossible to audit for correctness.

I think code generation is, generally speaking, pretty awful, but contributing to an LLM prompt is kind of an interesting evolution of software design. With that said, I don't really think it saves a lot of time (the author's Youtube videos[1] are literally like 10+ hours of messing with prompts and copy-pasting code), whereas the product in itself isn't particularly complicated.

[1] https://www.youtube.com/playlist?list=PL21oMWN6Y7PCqSwbwesD4...

And the code is godawful. Just look at this mess for internationalization: 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.
I 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.
> 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.

Everyone, 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.
But good developers can use LLMs to hunt for the dumb bugs ;)
Are these the same companies we hear about because the got hacked because of security holes in their code?
It’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.

Aren'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.

At least using a framework like React would expose these HTML blocks to the typechecker.
Hmm, yep you have a point there
Wow, 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.

Huge 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.

Look, 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

Yikes. Best of luck adding a new language or updating your templates without introducing bugs or discrepancies.
This is interesting as an experiment, but a awful way to do production code.
If you cannot program then maybe it helps?
Isn't GPT4 non deterministic?

So the same prompt won't necessarily give the same result

Yes, it is non-deterministic from our point of view, because OpenAI does not let us set the seed.
Sure you can: https://platform.openai.com/docs/api-reference/chat/create#c...

It does not guarantee determinism, though, because of the nature of GPT4o's optimizations.

That was unclear for me too, so I opened an issue (the very first of the project, yay!). The instructions have been updated, they might be a bit clearer now: direct contributions to the code are welcome.
> ???????

Please clarify what ??????? means here? You’ll find us willing to hear out your point of view, but first you’ll have to provide it.

The technique for producing the code is so unconventional, the grandparent commenter is unsure if this is a serious attempt, a joke, or a stunt.