5/7/2026 at 10:11:59 AM
"Models favor monolithic, single-file implementations that diverge sharply from human-written code."You say! I might have been just an LLM all along without even knowing it since I too prefer single file implementations.
Back in the old VB5/VB6 days Visual Studio had this mode where it showed the different functions in a file almost as if they were separate files. You could not scroll beyond the functions end but you could easily transition between that mode and global file view. I always found that a nice way of working (but admittedly the world was a lot simpler back then).
Also my preference for fewer but longer files is only there when I write the code myself. For working with AI I think smaller files are beneficial for quicker turn around between human and machine.
by weinzierl
5/9/2026 at 1:03:08 PM
This is interesting. I have always preferred to make my personal projects single-file (or at least few-massive-file)[1]. I noticed that teams in general, strongly dislike this style of programming (even before LLM-coding-assistants, as far back as 2020).I wonder how much of the multi-file (and increasingly multi-repo) code-organization is just a manifestation of Conway's Law (https://en.wikipedia.org/wiki/Conway%27s_law).
[1]: It makes navigation and iteration much faster, and obviates the need to use indexers. It also forces you to only put _orthogonal_ programs in external files (I recently had to write a kind of quasi-SAT-solver, and that was code that was complex enough to require its own "namespace", and it was also something that was reusable across projects). One thing I noticed, maybe in 2025, is that LLMs struggled to navigate large single-file programs, but were quite good at navigating multi-file programs. It is interesting that they (according to my 2025 experience and the quote you give) prefer to _write_ code in ways that make it difficult for them to _read_ code.
by nz
5/7/2026 at 5:59:00 PM
How often has there been a HN submission for a project 'in a single C header file'?by tmtvl
5/7/2026 at 7:19:54 PM
This has less to do with natural opinions regarding code organization and more to do with the fact that including, modularizing, and distributing C code has historically been a pain in the ass which is ameliorated by shoving everything into a single file.by kibwen
5/7/2026 at 7:41:24 PM
/? single header https://hn.algolia.com/?q=single%20header/? header-only https://hn.algolia.com/?q=header-only
/? c header https://hn.algolia.com/?q=c+header
by westurner
5/7/2026 at 7:20:54 PM
EDIT: Sorry, I missed the "header" part (and the irony).At least once, here you go:
https://news.ycombinator.com/item?id=48053570
Ok, I just submitted it myself but I could not believe it never had been submitted before. It is from 1997 and was pretty popular for some time. I think it even was built into Google Picasa for sime time.
by weinzierl
5/7/2026 at 12:01:38 PM
This VB feature existed to accommodate programmers coming from the DOS based QB IDE who were used to the one function per screen view there. To my sensibilities, it does not make much sense with the advent of high-resolution desktop environments.by bmn__
5/7/2026 at 12:31:45 PM
I think it's one (but not the only) reason that makes LLMs work very well with Ruby on Railsby rullopat
5/7/2026 at 2:51:53 PM
This has been my preference as well. I build everything in one file until it becomes uncomfortable and only then I start breaking up into multiple files... But even then, I try to keep the main business logic fully visible in the main file.by jongjong