←back to thread

196 points yuedongze | 1 comments | | HN request time: 0.305s | source
Show context
blauditore ◴[] No.46195811[source]
All these engineers who claim to write most code through AI - I wonder what kind of codebase that is. I keep on trying, but it always ends up producing superficially okay-looking code, but getting nuances wrong. Also fails to fix them (just changes random stuff) if pointed to said nuances.

I work on a large product with two decades of accumulated legacy, maybe that's the problem. I can see though how generating and editing a simple greenfield web frontend project could work much better, as long as actual complexity is low.

replies(16): >>46195970 #>>46195979 #>>46196044 #>>46196111 #>>46196149 #>>46196181 #>>46196747 #>>46197925 #>>46198024 #>>46198073 #>>46198272 #>>46198478 #>>46199426 #>>46200435 #>>46202288 #>>46207763 #
bob1029 ◴[] No.46196747[source]
I have my best successes by keeping things constrained to method-level generation. Most of the things I dump into ChatGPT look like this:

  public static double ScoreItem(Span<byte> candidate, Span<byte> target)
  {
     //TODO: Return the normalized Levenshtein distance between the 2 byte sequences.
     //... any additional edge cases here ...
  }
I think generating more than one method at a time is playing with fire. Individual methods can be generated by the LLM and tested in isolation. You can incrementally build up and trust your understanding of the problem space by going a little bit slower. If the LLM is operating over a whole set of methods at once, it is like starting over each time you have to iterate.
replies(2): >>46197658 #>>46203878 #
theshrike79 ◴[] No.46203878[source]
"Dumping into ChatGPT" is by far the worst way to work with LLMs, then it lacks the greater context of the project and will just give you the statistical average output.

Using an agentic system that can at least read the other bits of code is more efficient than copypasting snippets to a web page.

replies(2): >>46204568 #>>46205350 #
bob1029 ◴[] No.46205350[source]
> then it lacks the greater context of the project

This is the point. I don't want it thinking about my entire project. I want it looking at a very specific problem each time.

replies(1): >>46210382 #
1. theshrike79 ◴[] No.46210382[source]
But why?

Most code is about patterns, specific code styles and reusing existing libraries. Without context none of that can be applied to the solution.

If you put a programmer in a room and give them a piece of paper with a function and say OPTIMISE THAT! - is it going to be their best work?