logoalt Hacker News

embedding-shapeyesterday at 7:13 PM1 replyview on HN

> then that would argue for having "modules" between 5,000 and 50,000 loc, depending on which AI model you are using.

FWIW, I set hard limits to 200 LOC for every single source code file in any AI-related projects, also with restrictions on "formatting hacks" and other golf-like stuff.

I think beyond 5000 LOC in a single file and all available models already get lost frequently, even if the "context limit" theoretically is way above that. Maybe aim for like 1K LOC at max unless you want to have lots of misunderstandings.


Replies

zahlmantoday at 9:40 AM

Right; the context window also has to fit chain-of-thought about the code that has been read in, and so on and so forth.

I already preferred to keep source code files under about 200 LOC, so.