17 ms·
A project with a single 11,000-line code file
- mgaunard 5y agoI don't understand why people complain about such things. A seasoned programmer should have no problem navigating a multi-million-line codebase, that's just routine. There isn't anything that special about a 10k file.
- leros 5y agoThis reminds me of an app we had at work for static content, written in JSP of course. It was made so designers and UI developers could make mostly static content pages. Someone had a good idea to make a header.jsp template for common header stuff. But it was hilarious. The file essentially became a giant if-else condition with a few hundred conditions like "if path == 'some_page'" followed by CSS and sometimes JavaScript for that page. Absolutely horrendous.
- neurocat123 5y agoA brilliant tool I once worked with is TetGen; it takes a hollow 3D shape and creates a volumetric, space-filling mesh of the inside using tetrahedra. Most of what is TetGen is in once giant C++ file, clocking in at 36,566 raw SLOC. https://github.com/libigl/tetgen/blob/master/tetgen.cxx https://github.com/libigl/tetgen/blob/master/tetgen.cxx
- mtoddsmith 5y agoBut it’s a class with lots of small methods. Maybe not the same as the single large VB script the OP described.
- invalidname 5y agoWe got many of these including a 13k LoC file in our OSS project. Yes, it isn't ideal but sometimes for performance and practical reasons these things grow over time.
- albertopv 5y agoIn 2012 I worked on a jsp web app project, we replaced another consultant, so the project was inherited. A monstrous jsp page, of 13k lines IIRC, once traspiled to pure java hit the max length for a class method, 65535 bytes.
- thenipper 5y agoI once refactored a 15k plus line sql file. Fun times
- pfraze 5y agoI'm guessing / hoping there was a lot of data in there as INSERT statements. My horror story was being asked to do maintenance on PHP sites written in the early days of PHP. Hundreds - maybe thousands - of PHP files with copy-pasted HTML and intermingled logic. As far as I can tell, the idea of instantiating a whole MVC framework from a single entrypoint file came after that particular site was created, so every possible page was its own entrypoint with its own boilerplate. Source control also seemed to predate this project, so you had plenty of .old.php and .old.v2.php files. Programming at webdev agencies is a challenging experience.
- thenipper 5y agoNope. It was a crazy stored procedure. When all you know is SQL… you’ll solve some crazy problems using sql. Oof. That tbh sounds worse
- henning 5y agoThe number of lines in a file doesn't necessarily mean anything. SQLite is compiled as a single file: https://www.sqlite.org/amalgamation.html https://www.sqlite.org/amalgamation.html . It depends on the structure that is in that file. If this app was factored into 300 different files, it would still be an impossible mess. The redundant and buggy logic would just be in different files.
- deleted 5y ago[deleted]
- bedatadriven 5y agoSQLite concatenates its sources into a single file to ease distribution, but it is developped in many seperated and well organized .c and .h files.
- thedanbob 5y agoI once inherited a mission-critical PHP project which had no version control, no tests, and no development environment (all edits were made directly on the server). It used a custom framework of the original author’s own devising which made extensive use of global variables and iframes and mostly lived in several enormous PHP files. I was able to clean it up somewhat, but there was one particularly important file that was so dependent on global variables and runtime state that I never dared touch it. When I was finally able to retire the project several years later, I first replaced the home page with this picture: http://2.bp.blogspot.com/-6OWKZqvvPh8/UjBJ6xPxwjI/AAAAAAAAOv4/PNw87jBmeL0/s1600/ding-dong-the-witch-is-dead-5.png http://2.bp.blogspot.com/-6OWKZqvvPh8/UjBJ6xPxwjI/AAAAAAAAOv...
- k__ 5y agoHaha, same! The first project I inherited was PHP app that used a custom UI framework created by an agency that didn't work with us anymore. One file had 7000 LoC and it would generate hundreds LoC of with-sprinkled JS code and send it to the browser on every click. Debugging that thing was a nightmare.
- lucb1e 5y agoMy first thought when reading this description was that step one is to make a local copy, get a development environment setup where you can toy around, see how things fit together. The 'stupid'er the setup (like using plain old files instead of a database), the easier that actually gets (apt install apache2 php; rsync da:files /var/www). Wouldn't that have helped solve this particularly important but untouchable file?
- thedanbob 5y agoIf I remember correctly, the file was processing global state from other parts of the system, and it was such a Byzantine bit of code that I had almost no hope of understanding what it was actually doing without being able to observe state in the production system as it was being used. Plus at the time I wasn’t a particularly competent programmer myself (this was my first programming job). In the end I figured it wasn’t worth risking breaking it when its replacement was on the way.
- ben_w 5y agoThat beats the 1000 lines inside a single if {} block that I once found. (The conditional in that if {} always evaluated to true).
- moralestapia 5y agoLol, reminds me of the meme: var a = true; if(a == true) then return true; else if(a == false) then return false; Or something like that.
- hibbelig 5y agoI once looked at 30 lines of code, analyzed them and found out that they always computed true, never false. My background knowledge told me that Zeit was the correct value. But I did not dare to eliminate it in the main branch, only in a refactoring branch that I think got never merged. I am not proud.
- asddubs 5y agoi hate to say that I've definitely written code like that. not any time recently, thankfully (at least I think)
- tonyedgecombe 5y agoThe thing is it’s easy to imagine a situation that leads to this. It’s five o’clock on Friday, your partner is hassling you to get home because you have visitors, you are exhausted because you worked 60 hours this week and your boss is breathing down your neck because they want their pet feature finished right now. This is why I’m always loathe to criticise stuff I see on WTF.
- moralestapia 5y agoI could totally conceive places where "you have to write at least N lines of code per day" and then this kind of thing explains itself.
- 5y ago
- whatever1 5y agoDebugging a single file is much easier compared to debugging a tangled mess of interconnected .h, .c, .tcc files with include directives that only work in a specific sequence and with a specific compiler. Fix your include/import systems before preaching for modularity.
- deleted 5y ago[deleted]
- thriftwy 5y agoAn early 2000s web analytics tool awstats was a 500kb Perl file. It was surprisingly easy to modify and hard to break - I spent a lot of time adding SEO goodies to it.
- rvnx 5y agoIt depends how you see it: I see a project that is quite successful since it's running in production for mission-critical needs and the code is solid enough that even non-programmers can do improvements to it
- semitones 5y agoThat's like running down the side of a very steep mountain and calling it a successful endeavor before you've reached the bottom
- doubled112 5y agoDepends on your measure of success. Given a steep enough slope, you are almost guaranteed to reach the bottom one way or another.
- m1ckey 5y agoThe .NET runtime GC is a 47k C++ file. https://github.com/dotnet/runtime/blob/main/src/coreclr/gc/gc.cpp https://github.com/dotnet/runtime/blob/main/src/coreclr/gc/g...
- TimTheTinker 5y agoSomeone please tell me this is transpiled from a separate project.
- phyrex 5y agoIf I remember correctly it was in fact written in Common Lisp; the output was originally that file but it may have been modified since. You can probably google the truth with those breadcrumbs :)
- liversage 5y agoIt's originally written in LISP and this is why it's a single C++ file. However, I believe that it's now being maintained in its C++ form.
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- rahimiali 5y agoPython's main interpreter loop is a single 4k line function. https://github.com/python/cpython/blob/main/Python/ceval.c#L1586 https://github.com/python/cpython/blob/main/Python/ceval.c#L...
- ohCh6zos 5y agoMy company has REST client that is a single 9,000 line Go file that I have nightmares about. By my estimate it is really a ~300 line program written by someone who hated DRY.
- sargstuff 5y agoObviously Sam from accounting did this before Excel was t urning complete. https://www.felienne.com/archives/2974 https://www.felienne.com/archives/2974 https://www.microsoft.com/en-us/research/blog/lambda-the-ultimatae-excel-worksheet-function/ https://www.microsoft.com/en-us/research/blog/lambda-the-ult... No metion of a cell-u-lite version.
- matsemann 5y agoThat's me when I use languages that don't support circular imports. Can't have circular imports if everything is in the same file. Taps head.
- _benj 5y agoFor me the limitation of circular imports forced to drastically rethink how I architected my software (golang, rewrote the whole mvp 3 times be the first two I was either completely blocked by no-circular-imports or the structure felt so hacky that I didn’t even wanna touch it… then I learned about interfaces!!)
- tuyiown 5y agoJust in passing, generally you can break circular import by isolating the coupling that triggers the circle chain in a file dedicated to that. Bonus : each coupling use case gets to be explicit
- heavenlyblue 5y agoPython allows for circular imports as long as you don’t directly import things you use but instead their modules for example. Is that the same for all languages?
- holoduke 5y agoBetter one good organized file than 100s of folders and subfolders and files and symlinks. I have worked on projects where even after 2 years I didn't grasp the folder structure and just used search to locate files.
- civilized 5y agoPeople love to complain about things that are simple, fast, and easy to complain about, without regard to whether the complaint is insightful or useful. It's sort of the dark twin of bikeshedding. If you divide the single 11k-line file into a thousand 11-line files, it may become objectively much harder to understand, but it'll also receive much less flak, guaranteed. I suspect this is also why Architecture Astronaut-ery can be so successful within a company. If code is chock-full of superficial signs of order and craftsmanship, such as hierarchy, abstraction, and Design Patterns(TM), it takes a lot of mental effort to criticize it, and most people won't.
- smegsicle 5y ago> dark twin of bikeshedding is it different from regular bikeshedding? or are you saying that the dark twin is the evolutionary process of eg. architecture gaining complexity until it becomes difficult to criticize..
- civilized 5y agoBikeshedding is usually more about how something should be done than how it should not be done. But, yes, you could think of them as basically one thing.
- aaronchall 5y agoIf you divide a single 11k-line file into 20 files averaging 550 lines per each, by semantics and levels of abstraction, your code will quite possibly be easier to read, maintain and add to. Maybe. Perhaps.
- 5y ago
- lordnacho 5y agoNo doubt dozens of devs will throw in their own 10k LOC story here, and yes it's painful to watch so many people having professional cramps over it. But don't forget society itself if governed by OOM larger bits of text with no referential integrity, no machine to tell you if it's inconsistent, and no way to test anything, other than making humans write more text to each other and occasionally show up in court. The law itself, even parts of it like the tax code, and regulations on various areas, are a melange of text and cultural understandings between lawyers, judges and government. We collect the data for this machine in the form of contracts and receipts, and it piles up in mountains. As with code, it's not just legal professionals who have to deal with law. It spills into everyone's life, and there's nothing to do about it other than either guess what to do or pay a pro to tell you what to do.
- cormacrelf 5y agoYou are wrong to say there's no way to test anything. Imagine an enormous AI generating test cases for you constantly, in an adversarial fashion, with built-in rewards for advancing a more correct understanding of the text. Lawyers call this "testing", rightly so. If you are interested in efficiency / cost-effectiveness, it's got lots to be desired. But if you are interested in the internal integrity of the document etc, then this is better than almost anything developers have. I hate these words as I type them but the law is also "agile" (ugh). It gets modified as it's used. It does not need high-assurance machine-verified "referential integrity". In my entire course of studying the law I don't think I've seen a single legal dispute over a problem of referential integrity. Mistakes, especially drafting mistakes, are corrected on the fly pretty much everywhere they appear, and then they disappear. For a dev, using the wrong variable name in a bad language could mean you introduce a huge security vulnerability and massive loss of trust. (Or if you write smart contracts, $100M down the drain.) For lawyers, referring to the wrong section has essentially zero consequences. Nobody cares. Maybe you get a funny look from a senior. Finally re the 10k LOC tangent that this is supposed to be connected to, I'm not really sure what you're complaining about. You get "10kLOC" cases, but you also get well-organised practice guides & bench books. Laws in statute are typically very well organised, in my experience about 5-10x better than the average codebase. Laws are organising large swaths of the sum total of human endeavour, just as code does. I would say developers are behind overall, which makes sense for a discipline that's less than a century old.
- scoresmoke 5y agoTypeScript's checker.ts is a 2.65 MB file containing 44,932 lines at the moment. https://github.com/microsoft/TypeScript/blob/main/src/compiler/checker.ts https://github.com/microsoft/TypeScript/blob/main/src/compil... Does anyone know why and how they maintain it?
- razh 5y agoUnlike the OP's file, there's a rather substantial test suite and massive corpus of TypeScript code to work with, so at the very least, you'd have some grumpy people knocking on your door if you did something that negatively impacted the greater ecosystem. Some documentation from Orta Therox on the checker: https://github.com/microsoft/TypeScript-Compiler-Notes/blob/main/codebase/src/compiler/checker.md https://github.com/microsoft/TypeScript-Compiler-Notes/blob/...
- mtoddsmith 5y agoconst anon = "(anonymous)" as __String & string; What does that even mean? It seems that typescript uses an alias for string as __String in the source but then a bitwise operator with string?
- Fwirt 5y agoThe payroll check printer for my employer was once a couple thousand lines that generated raw PCL to be sent to a LaserJet that used magnetic toner to produce checks that had a working MICR number. It was rendered into spaghetti by multiple GOTOs that jumped to helpful labels like "666", and calls into other helper programs to generate more PCL that did things like change fonts and draw graphics. Of course none of it was commented, so you had to have a copy of the PCL spec on hand to know what any of it did. It was the product of a retired cowboy that had also written the rest of our custom payroll system over a number of years. I attacked it by printing out and taping together each program into "scrolls" and tracing control flow with highlighters and sharpies. Had them all taped up on my office wall so I could refactor the whole thing from scratch, coworkers found that entertaining. Got a much more readable replacement working nicely. Then a couple years later HR bought a new system and we stopped printing our own checks. I was not sorry to see the whole thing go.
- Lev1a 5y agoReading your process I have that stereotypical TV series image in my mind of a person so deep into the subject matter that plaster every wall with notes and pull string all across the room at head height to hang up ever more notes kinda like that one NCIS episode (S8 E6 "Cracked"): https://img.sharetv.com/shows/episodes/standard/616591.jpg https://img.sharetv.com/shows/episodes/standard/616591.jpg (although that image is only a small part of that whole view).
- drdec 5y agoA printout of a one-file spaghetti code with gotos is the only case where I can imagine that trope of the wall of connected strings actually being a useful tool.
- gnat 5y agoWe call that a Murder Board in my office. Here's a TV Tropes article on the cliche: https://tvtropes.org/pmwiki/pmwiki.php/Main/StringTheory https://tvtropes.org/pmwiki/pmwiki.php/Main/StringTheory
- victorcharlie 5y ago
- 11235813213455 5y agohttps://github.com/SheetJS/sheetjs/blob/master/xlsx.js https://github.com/SheetJS/sheetjs/blob/master/xlsx.js with its 24500 LOC, the author is cool
- cosmiccatnap 5y agoI see people do this all the time with terraform and it's madness.
- bbkane 5y agoTerraform is declarative, so it's much easier to refactor.
- coldcode 5y agoI worked on untangling a 29,000 line single .c file MacOS app in the mid-1990's that featured a 14,000 line event loop function. Fun.
- choletentent 5y agoIf well done, single file projects are not bad. They save a lot boilerplate code. It is also easier to find things, since it is all in the same file. EDIT: I'll go even further. Programmers who don't like long files are probably using the scrollbar to navigate around the file. Vim saves me from that bad habit.
- bo0tzz 5y agoWhat programming language requires 'a lot' of boilerplate code to use multiple files? That sounds awful. I don't think the argument for things being easier to find goes up either, with a tool like grep.
- rwmj 5y agoPerl XS (the system used to interface with C) requires module == file, so if you have a particularly large module then it just has to live in a single file. Here's one: $ wc -l perl/lib/Sys/Guestfs.xs 11930 perl/lib/Sys/Guestfs.xs Worse still, this expands to C which can be large and takes a noticable time to compile: 30019 perl/lib/Sys/Guestfs.c
- choletentent 5y agoYou don't need to go far. In C, function prototypes in header files are boilerplate ;)
- lkrubner 5y agoI've never written a file with 11,000 lines of code, but I have often built Clojure projects like this, with everything in one file. I think I might have once had a file with 4,000 lines of code. Maybe 5,000? A complete system might be 5 apps, working together, each made of one large file. It does help with some things. Especially if I try to on-board another programmer, if they don't know Clojure very well, using one file means they don't ever get tripped up by name spaces, instead, they just open one file, and then they can load it into the REPL and start working. I would not recommend this style for every project, but it does offer a kind of simplicity for the projects I work on.
- kevin_thibedeau 5y agoWolfSSL has this 50K SLOC doozy: https://github.com/wolfSSL/wolfssl/blob/master/src/ssl.c https://github.com/wolfSSL/wolfssl/blob/master/src/ssl.c
- kbrannigan 5y agoSo afraid to write bad, spaghetti code, I ended up writing no code at all. This thread made me realize that it's better to have a working profitable project with bad code, than a perfect unfinished project, with meticulously chosen design patterns. Afraid of being judged for bad code, I could not start until I had the right architecture. I'm glad I read this. This is developers therapy.
- deleted 5y ago[deleted]
- knome 5y agoYou sound like you should read this: [removed] apparently jwz decided not to be linked from here :/ there's an archive.org link below.
- GranPC 5y agoHeads up: jwz.org redirects Hacker News visitors (via "Referer") to an image of a slightly-hairy testicle sitting inside an egg cup. So maybe don't click the link at work.
- AlexCoventry 5y agoSafe link: https://web.archive.org/web/20220318220659/https://www.jwz.org/doc/worse-is-better.html https://web.archive.org/web/20220318220659/https://www.jwz.o...
- sillysaurusx 5y agoThat’s friggin’ hilarious. What a boss.
- Jaruzel 5y agoOk, So I wanted to see it. Quick hack of the link tag in sibling comment, and this is what you see: NOT SFW! https://cdn.jwz.org/images/2016/hn.png https://cdn.jwz.org/images/2016/hn.png It's funny. Why does he hate us so?
- 5y ago
- maxnoe 5y agoCORSIKA, current Version 7, is a program to simulate extensive air showers, ie particle physics in the atmosphere. It's main file is 88kloc Fortran 77, started in the eighties, still actively developed. https://www.iap.kit.edu/corsika/index.php https://www.iap.kit.edu/corsika/index.php Currently a rewrite in c++ is underway.
- atoav 5y agoWriting long files is okay, but u less a languages module system gets in your way seperating different aspects of your code into different files does no harm. There is no need — at all — to be evangelical about it one way or another.
- voakbasda 5y agoIt really speaks to the state of software engineering when there are ample comments here defending this practice. This is virtually indefensible in my book, as it screams technical debt and strongly suggests that there are much deeper issues hiding in that codebase. Personally I would not be willing to work on it without first addressing those issues.
- chillingeffect 5y agoThis more of a "rubber hits the road" than a theoretical forum. There is a time and a place fir stuff like this. It's not a reflection of the bigger picture of sw.
- avar 5y agoIt speaks to the state of software engineering that people are complaining about file length, instead of something meaningful like cyclomatic complexity. A 10k single line program can be easier to understand and better organized than an overly abstracted mess strewn across multiple files, but which checks all the "best practice" checkboxes.
- dj_mc_merlin 5y agoDo you think the people who wrote this were measuring cyclomatic complexity? Obviously you can have >10k LOC file that is well-maintained and useful.. but there's ample evidence in the post that this was _not_ one of those, but a machine held together by duct tape, spit, and hope.
- recursive 5y ago> Do you think the people who wrote this were measuring cyclomatic complexity? As a first-order guess, I would guess that no code has its cyclomatic complexity measured. As a fraction, I'm probably not too far off.
- postalrat 5y agoAnd that's fine. Nobody is qualified to work on every piece of software.
- pkrumins 5y agoAll software projects should be a single, self-contained file.
- unfocussed_mike 5y agoOne of the things I often tell people is that if you hear someone say "Yes! It broke!" that person is probably an engineer. But the moral of the story in the article is that unfortunately some things break much less easily than we'd like.
- activitypea 5y agoI don't get the obsession with file length. What's the benefit of having 100 files with one 50-line function per file, over having a 5000 file with 100 functions? Obviously not counting extreme cases where the file size would break some editors' buffers
- montenegrohugo 5y agoTry debugging a single 10k loc file versus fifty small modules where each takes care of a distinct part of the logic.
- userbinator 5y agoAs someone who did a bit of enterprise Java, I much prefer the former. Jumping around between lots of tiny files and not being able to see where the actual work happens because it's spread everywhere is a debugging nightmare.
- vonseel 5y agoI think you need a better IDE.
- tedunangst 5y agoBut what's the difference between file1.c ... file50.c vs cat file*.c > onefile.c?
- timando 5y agoI imagine the 50 files have meaningful names. Just kidding, no-one knows how to name anything.
- jokethrowaway 5y agoI'm not too bothered by the single 10k loc file (and I've seen plenty of files with thousands of lines). I would aim at files in the range of 200-300 LOC If you split it, it's crucial that you're splitting the logic in the right way (if the modules are too small, they'll just waste your time) and that you're making sure references can be easily traced (eg. if you have modules with some DI system which prevents references from being recognised, as it happens frequently in certain node.js enterprise applications).
- shakna 5y agoI learned that not all text editors go to the effort of loading the file data very carefully with careful underlying data structures when I tried to open a 67K LOC COBOL file on a 32bit system, a while back. (Sidenote: COBOL has a 999,999 LOC hard limit in the compiler spec.) So very many editors just couldn't open it. Some would use so much memory that the system would either freeze, or the OS would kill them. Some would silently truncate at 65,535 lines. Some would produce a load error. Some would pop up with an error indicating the developer thought it was an unreachable state. e.g. "If you're seeing this error... Call me. And tell me how the fuck you broke it." Others would manage to open it, but were completely unuseable. Where moving the cursor would take literal minutes. There were exactly three editors I found at the time that worked (none of which were graphical editors). And they worked without any increased latency, letting you know that the developers just thought through what they were doing: vim, emacs, nano. (A few details because people are probably curious - the vast majority of that single file project was taxation formulae. It was National Mutual's repository of all tax calculations for every jurisdiction that they worked in, internationally, for the entire several hundred years of the company. They just transcribed all their tax calculation records into COBOL.)
- bbkane 5y agoWhat editors ended up working?
- shakna 5y ago> There were exactly three editors I found at the time that worked (none of which were graphical editors). And they worked without any increased latency, letting you know that the developers just thought through what they were doing: vim, emacs, nano.
- aasasd 5y agoEmacs is actually quite poor at opening large files, at least comparatively—depending on the machine, 65K lines may be enough. However, there's an addon, i.e. a ‘mode’, that implements editing of large files somehow. Vim, on the other hand, does it splendidly: it keeps only a chunk of the text in memory, and iirc the ‘swap file’ that it creates for every opened file, keeps the changes in some kind of a sparse structure, so they can be tracked at various places in the original file. This ‘swap file’ also serves as a savepoint of the editing session, so the changes can still be recovered even if the machine crashes while the user never saves. Alas, editors still tend to deal badly with very long lines (just in the low thousands characters). IIRC both Emacs and Vim drop into a big think if the user attempts to put the cursor further down that line.
- User23 5y agoIs it weird that I think that, armed with a modern editor, this would be basically easy and practically pleasant compared to the FooFactoryFactory “best practices” crap I’ve had to deal with?
- foxhop 5y agoJust so you know awstats was a 25k+ line Perl script which i maintained as an internal fork for employeer once. It was epic & as hard to work with as you'd expect.
- kazinator 5y ago> Once I dared to clean this up and reuse the authentication response, but it broke everything. Yet! Those non-programming people somehow managed to add their little requirements over the years, without breaking the other forms? There is probably more to the story. Like that, I suspect, users who needed to produce a certain form probably had private, years-old copies of the program that they used, impervious to subsequent changes.
- Jtsummers 5y agoI'd wager they did break those other forms, the whole thing had its own long list of bug reports per the writeup. They just didn't break it for themselves.
- lars-b2018 5y agoWell, this is not necessarily a bad thing. If it was approachable by a non-IT person in HR, and business rules could be updated without contacting IT and waiting, then more power to them. I have seen this sort of thing developed as a coping mechanism because the official IT team could not be used, either due to time, cost, priority, or whatever. Also, even being in IT, 1 multi thousand line file can be a lot more manageable to work in vs. a dozens of smaller files where it's not clear where to look without being in an IDE.
- cookiengineer 5y agoBack in the days at Zynga, there was this ritual that new members of the STG (Shared Tech Group, which developed the game engine stack) had to try to refactor the road logic code. Suffice it to say, it's a 28k LOC file that was so bad, it could even hold up in court as evidence that a South American company stole the code of Zynga's -ville games. We could reproduce each and every single bug and its effects 1:1 in their games, with all the crashing scenarios that were easy to reproduce, hard to debug, and almost impossible to fix. Once you dig into the hole of depth sorting and being smart by "just slicing" everything into squared ground tiles on the fly, there's no way out of that spaghetti code anymore. Fun times, was always a joy seeing people give up to a single code file. The first step to enlightenment was always resignation :)
- WalterBright 5y agoIt's impossible to refactor spaghetti code without a comprehensive test suite. But you can do it with a test suite - I've done it with large code bases.
- lanstin 5y agoYou sometimes can. Maybe for any legacy code base someone could, but I have tried and failed on more than one occasion. Some people’s thought process is just perversely different to mine and I keep feeling, oh, this is the layer where that happens, but no every time I have an aha moment I am disillusioned.
- WalterBright 5y agoIf you don't have a test suite, you can't know if you're making progress or making things worse. Learned repeatedly from painful experience.
- manquer 5y agoTo develop a comprehensive test suite can sometimes be hard, especially for code that deals with say concurrency, multi threaded code , locks , 2d/3d physics , video , analog , hardware related , procedurally generated or ML (meta-language ) and the other ML (machine learning) etc. A lot of edge cases and race conditions would easily slip through, also a different set of edge cases or race conditions you never considered and therefore never tested for in your first version could pop up in your rewrite.
- antirez 5y agoCode quality, internal modularity and clean interfaces between the parts don't have anything to do with how it is split into files.
- throwaway71271 5y agoi used to work on 40-50k line files with one function and a bunch of gotos in perl, in a multi billion dollar company its fine you just binary search your way into it, put print "AAAA" in the middle, see if its printed, then put it in the half of the half and try agian. emacs couldnt even find the bracket ending of the if condition (not the block, the condition..), have you ever seen if conditions(again, not the block) that spans your whole screen? its not as bad as you think, it made me realize we take code very seriously, but its actually ok, 10k line file 100k line file, whatever.. its all the same
- veltas 5y agoThis is the right attitude, sometimes you really do need the duct tape approach.
- ICodeSometimes 5y agoThe scariest part of this isn't the 11K lines of code, it's the lack of automated tests. It IS impossible to make any sort of substantial change without breaking another part of the darn thing. My favorite quote has got to be: "Unit tests aren't meant for you now, it's insurance against a future developer".
- honkycat 5y agoFile length is a bit of a bike shed in my opinion. My main concern here would be separation of concerns and code quality. I prefer many short files and folders structured hierarchically and grouped semantically. I have no proof this is better so I would probably just leave it to a vote with the team. In the end I think they is how a lot of this should be viewed until we get proper research. How do you WANT to code? TDD? No tests? One giant file? It should be a team and executive decision. If you don't like the style on your team, and nobody wants to change it, move on or adapt. Technical debt is like a superfund site. It renders the real estate worthless and poisons the rest of the company. It does matter. My current gig is hemorrhaging money because we can't keep devs even though the pay and benefits are great. We cannot execute on mission critical initiatives. We cannot adapt our product to meet the needs of the market in an agile way. This is due to people saying "a working product is more important blah blah.." for years. I would argue there is a balance to strike and you can do both with a good team and realistic planning. But there is always the nay-sayer who is willing to step in and say whatever product wants to hear. It is so bad we cannot train people to use the software anymore. It is too poor quality and were can't on-board them before they decide to go elsewhere. Everyone who knew anything has left and there is too much of it. So the remaining devs get overwhelmed, they leave... It is a vicious cycle. The funny thing is the money machine works, but it is so frustrating to see all of the extra money we could be making and having to leave it on the table.
- briantkelley 5y agoI worked on Word for years. Office has thousands of files over 10,000 lines with, uh, various degrees of test coverage and comprehensibility. After some time and experience, your mental model of the architecture ends up being way more important than simple metrics on source code organization. IMO, organizing source code in files seems archaic. E.g. tracing the history of a function moved across files can be tedious even with the best tools. I’d like to see more discussion around different types of source storage abstraction. There are benefits of large source files... When compiling hundreds of thousands of files (like Office), the overhead of spawning a compiler process, re-parsing or deserializing headers, and orchestrating the build is non-trivial. Splitting large files into smaller ones could add hours of just overhead to the full build time.
- rc_mob 5y agoI love how much this questions the status quo.
- woah 5y agoWhat's an alternative to files that doesn't just have all the same attributes of files anyway? If it involves breaking code into multiple chunks of related functions, and possibly having these chunks act as namespaces, that sounds like what a file does.
- squeaky-clean 5y agoMaybe it's the editors that need updating. It would be pretty neat to have the chunks of functions / namespaces model as lots of tiny separate files on the disk, but a sort of view-layer so that you can view all the related ones in one virtual file. You could even then have multiple virtual files that include the same raw files. For example in a video game your player, monsters, health potions, and attacks could all have the code for HealthComponent as a part of their virtual file. And updating the HealthComponent would affect the raw file so the virtual files would have the updates automatically. Yeah you can open dozens of editor tabs or always use jump-to-definition, but just being able to scroll around or ctrl+f within a restricted set of limited files would be nice.
- saulrh 5y agoAt my first job out of college, there was a "utils" file with IIRC over 100k LoC. Nearly every file in the codebase imported it. This was in Perl. That single import statement would increase the time to start anything by upwards of three seconds. One of the best things I did for my efficiency was to factor out subsets of functionality that didn't need any of those utils, since those subsets would run unit tests in a tenth of a second instead of three to five seconds. All of which is to say, by all means argue about whether colossal files are acceptable software engineering, sometimes that fight takes a back seat to "a double-digit percentage of the company's CPU and memory are wasted on parsing and loading this file in literally every new process".
- Jtsummers 5y agoMost of the comments here seem to be focusing on Austin's reference to it as an 11k line of code file, but if you read the article it sounds a lot more like it's both an 11k line of code file and an 11k line of code procedure. That is, that there are no sub-procedures, just one straight execution through the whole thing. If you've only encountered large-ish source files like this but with reasonable sets of functions inside, that's a far cry from finding an 11k line of code procedure itself. The former is often justifiable (though perhaps a stretch), the latter is almost never justifiable. It's just garbage.
- userbinator 5y agoI remember many years ago coming across a reimplementation of the server side for a popular MMORPG of the time, reverse-engineered from the client (which was Flash) by what was likely a teenager --- it was over 100k lines in a single file, written in Visual Basic. Global variables everywhere, short names, and not even indentation. All the account data was stored in flat files, there was no actual DB. No "best practices" at all. Yet, not surprisingly, it worked pretty well and was actually not difficult to modify --- Ctrl+F would easily get you to the right place in the code. I guess the moral is, never underestimate what determination and creativity can do, and always be skeptical when someone says there's only one best way to do something.
- gofreddygo 5y agoFunnily enough, I have recently had great success by reversing the "best practices" on a distributed "micro services" architecture application into a single big Java file. Best practices were the usual suspects DRY, IOC, SQL + NoSQL, separation of concerns, config files over code, composition over inheritance, unexplainable overlapping annotations, dozens of oversimplified components doing their own thing, and some $something_someone_read_on_a_medium_post The Single Java File was around 500 lines no db, lots of globals, a dozen or so classes and some interfaces, Threads for simulating event based concurrency, generous use of Java queues and stacks but i specifically made it static with Zero dynamic hashmaps. It actually runs in my IDE, I can understand what the hell the product is supposed to do what component is doing more than it should and more valuable was to predict what could break if I change that value in the helm chart from 5.0 to 5.1. It is quite useful and pleasing, I can actually reason about things and I have new found use and appreciation for Type Systems and compile errors. And I can write tests that run in under 3seconds.
- teaearlgraycold 5y agoHaving the whole project actually in one project is critical. I think some of these “best practices” are actually very useful when applied with caution. But you sometimes need to break the rules. Everything should be optimized for developer convenience. Convenience in deployment. Convenience in debugging. Convenience in refactoring. Only do what HN and FAANG says is “right” when you need to.
- alpb 5y agoObligatory "Do not try to simplify this code" reference here https://github.com/kubernetes/kubernetes/blob/ec2e767e59395376fa191d7c56a74f53936b7653/pkg/controller/volume/persistentvolume/pv_controller.go#L54-L86 https://github.com/kubernetes/kubernetes/blob/ec2e767e593953... (https://news.ycombinator.com/item?id=18772873 https://news.ycombinator.com/item?id=18772873) from Kubernetes persistent volume manager code.
- ChrisMarshallNY 5y agoI can beat that. One of my first jobs was as a maintenance programmer for a 100KLoC (or more) single-file FORTRAN IV (1970s vintage) application (a proto-email server). Three-character variable names, no documentation, and having been stepped on by every junior programmer that went before me. My best debugger was a Ouija board. The original author was a ringer for Donald "Duck" Dunn. Interesting chap. It taught me the value of writing good code. It sucked. It was great (because of the lesson learned).
- deleted 5y ago[deleted]
- cameronperot 5y agoMagboltz [1] is a single >95k line Fortran file (although, I'm not sure if it's multiple files combined into one before upload). [1] https://magboltz.web.cern.ch/magboltz/ https://magboltz.web.cern.ch/magboltz/
- yk 5y agoThe most strangely maintainable code, though I should probably put maintainable in scare quotes, I have ever seen was a astrophysics code that calculated the changes to spectrum during interactions with background fields. That thing hat two loong nested loops, in the outer loops it calculated local backgrounds, and the inner loop was basically a Euler solver that used the backgrounds from the outer loops. The outer loop was something like 4 kLOC, and consisted of blocks where there were first 20 lines of loadTable(filename) calls, then a call to calculateLosses( <all the tables just loaded> ) and then freeTable( <just loaded tables> ) calls. The inner loop was a little bit of setup and then a very long part where all those losses would be subtracted from the spectra. The funny thing was, that once you got the structure, that code was actually not that bad. However, I told my boss several times that the second something comes along and doesn't exactly fit into that pattern the entire thing will blow up, and was always told that they maintain that code for 15 years and that didn't happen yet.
- gwbas1c 5y ago> What is the moral of the story? Either figure out how to improve the situation, or leave.
- quickthrower2 5y agoThink of all your code as a single file with line separators, file separators and a special UI that considers both to present these in a text editor. The existence of large files is mostly just a style issue. Text editors with different or lets say more semantic interfaces to the code would not care about file size. You could then happily have 1M loc in a single file. You would care about it as much as you care about how the code was laid out on sectors and pages on your HDD.
- rc_mob 5y agoman i really love the look and feel of that guys website. its perfectly simple.
- tonyedgecombe 5y agoGuilty. I wince wrote a win32 app in a single 30,000 line C++ file. It was an interesting exercise but I’d never do it again.
- deleted 5y ago[deleted]
- seancoleman 5y agoMoral of the story: no engineer worth their salt wants to work on a "codebase" like this, so as an independent contractor, you can virtually name your price if you're willing to wade through the mess and solve acute problems.
- beckingz 5y ago> What is the moral of the story? > I have no idea. Sometimes successful software just grows.
- prpl 5y agoI encountered the QGSJET-II model which we used for modeling cosmic ray showers in the atmosphere. At one point I was asked about finding a way to parallelize the code, but the 17k+ line fortran file for the model, which I recall also included self modifying code, was too deep for an undergrad to penetrate. https://gitlab.iap.kit.edu/AirShowerPhysics/crmc/-/blob/master/src/qgsjetII-04/qgsjet-II-04.f https://gitlab.iap.kit.edu/AirShowerPhysics/crmc/-/blob/mast...
- unnouinceput 5y agoQuote: "There was no test environment. If I made a change, I had to test it in "production"." What year is this? 70's and mainframes? Because no way in hell you cannot, on large organization that had "Jeff in marketing", since 80's and PC's, duplicate the environment. Especially given this was used by almost everybody in the organization. And once you're done duplicating the production, and create proper test environment, you can start actually refactoring and creating a beautiful app out of it instead of just "To this day I sometimes lie in bed wondering what could have caused this". Conclusion - article's author is a whiner instead of a solver, no better than the ones before him that "copy and pasted at some point then later diverged"
- hyperman1 5y agoIf the author was the only person editing the file, and had a reasonable expectation of owning it for at least 6 months, then yes, start building a second environment. But one antipattern might be that the file is being modified by other people, even if on paper he is the only owner. So while you create a test, someone you don't even know exists modifies prod right under you. Another antipattern is forever-changing ownership. You own it for 2 weeks. Then someone anonymous in some layer above you decides something else, and of it goes. Maybe they did bother to tell you you're not the owner anymore, maybe they only told the new owner. In these 2 weeks, you've got ownership of 3 new programs and lost it for 2 others. I've seen it happen. There is no way to build something stable in these circumstances. Management will need to provide some stability before the underlings can do any work. If you're living there, run away, you can't save them.
- unnouinceput 5y ago"There is no way to build something stable in these circumstances" Yes, there is. Since he clearly stated that started as a job assigned to his team, he could've version it right there where it was officially staying. Then it would've be very easy to see changes done to it by somebody else, even if who was that somebody else was unknown to him. "Then someone anonymous in some layer above you decides something else" He also stated in the article that he had a lot of time in his hands and tried a refactoring. You don't have time to do a refactoring of a file with 11k lines of code in only 2 weeks, so he clearly had at least several months. My conclusion still stands.
- profile53 5y agoIt's worth an honorable mention toward the 47,000 line file containing the entire garbage collector for the C# runtime. It was originally written in lisp, then automatically translated to C++ by a script before .net was released. It's been hand maintained since and the folks at Microsoft have rejected attempts to refactor the code.
- irrational 5y agoI once wrote a sql query that was (well, is, since it is still in use) 5,000 lines long. It still ran in less than a millisecond, but I was surprised how long it really was once it was finished and tested.
- hahamrfunnyguy 5y agoI worked on a project like this once. If I remember correctly, it was even larger than 11,000 lines. ASP classic project with VB-script. We tried to get the company to do an overhaul, but it was more cost effective to try building it into the existing system. After the better part of a week becoming acquainted with the code, I found a suitable integration point. Luckily for me, the new feature being requested didn't depend too much on the existing code so I didn't have to make too many modifications to the existing code. I added the entry point to the new section along with some comments describing how things worked and some ascii art of a dragon. In the end, the new feature worked great and the customer was very happy with the results. Some years later, I was working for a different consulting firm and that project surfaced again. This time it was being re-written in ASP .NET after being passed around to a couple of different off-shore development teams. My coworker was working on it and asked me if I had written a specific piece of code in index.asp. I took a look and we both had a laugh, because my ascii survived after all those years!
- tambeb 5y agoOne can develop* what serves as the edifice[1] of a $1B hedge fund that handles signals, orders, trades, positions, and p&l, among other things, using a system not unlike this one.[2] [1] Merriam Webster definition of edifice: a large abstract structure [2] Source: Me * Or inherit and maintain
- sedatk 5y agoThis was common with Delphi/Pascal because units were designated per file, and nobody wanted to type hundreds of "uses" statements to import every one of those. So, people leaned towards keeping code in as few files as possible. For example, TurboVision had units named "Objects", "Views". I'm sure they were thousands of lines long. It was possible to use include files to split up a single unit, but that wasn't used much either because lack of cross-file navigation features in IDEs of the era made it really difficult to manage many files.
- commandlinefan 5y ago> what is the moral of the story Your boss will still expect you to be able to fix bugs in an hour or two without introducing any new issues.
- JoeAltmaier 5y agoI've refactored monolithic code several times in my career. It starts with a thorough going-over, making notes, identifying the state machines and drawing what was handled and what was not. Then, reimplement as a simple state machine but this time, fill in all the transitions (event+state => new state + action) One was an Infiniband code base from the vendor - a 'computer scientist' had written several layers to do what one or two could accomplish. Another, the Windows CE DHCP client (went from seconds to choose an address to milliseconds). Then there was an HDLC modem protocol - I got done, that was sped up a multiple and no longer crashed. I can't understand them by just reading. I had to make a road-map of all the states, events, actions and interfaces. Design a new code. Then make sure every function of the 'old' code was represented in the new code - line by line. So nothing got dropped. Satisfying. But more like turning the crank and making sausages than design or architecture.
- mbrodersen 5y agoI like your approach. Having a clear understanding that all software is just state machines is a great way to solve hard problems.
- georgiecasey 5y agoSurprised nobody's mentioned the Telegram Android app yet. Their ChatActivity.java is 27, 720 lines! https://raw.githubusercontent.com/DrKLO/Telegram/master/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java https://raw.githubusercontent.com/DrKLO/Telegram/master/TMes... Thing is, there's a great knowledge of the Android OS in there and the app works great when I use it. I think the OP blog post is correct 'Users don't care about the technologies or code.'
- tomcam 5y agoShort and sweet article. Worth it just for the last line.
- hzhou321 5y ago> Once I dared to clean this up and reuse the authentication response, but it broke everything. I never figured out why. To this day I sometimes lie in bed wondering what could have caused this. Is it just me that get piqued by the sound of it? I often spend my night figuring something intriguing and chasing that aha moment. I also like play puzzle games, and to me, its one way or another to spend the time. Then if I get to clean the mess up, usually that's another rewarding effort. However, I definitely understand the frustrations if one's hands are tied or there is a deadline that you just want it disappear. I love to clean up my own mess as well. We all make messes, at different levels and at different perspectives. Just like playing a game, it is just boss fight at different level. Novices make mess, veterans make mess as well. Usually novice's mess are easy mess.
- vonwoodson 5y agoI one rewrote one of these programs and translated ten-thousands of lines to a well unit tested 500-line purging script. Got a spot-award and then the program was never used again… choosing to keep the “working original version”
- syngrog66 5y agoI always start a new project with all code in a single file then only split it out when I feel I gain more than I lose. Judgment call, and a tad subjective. One factor in favor of mono-file is its often easier to navigate around fast and do search/replace in a single file then across many. Believe me, I understand all the benefits of mutiple files too -- not my first rodeo -- but under right conditions not always a sin to have a "fat" file. generally after a project has left its prototype stage and become more of a stable thing, primarily under maintenance, it should certainly be split out into smaller files with sensible module boundaries. Best in long term, and plays with version control better, and large teams doing concurrent mutations on the source tree.
- __d 5y agoMy $DAYJOB task this week is beginning the process of splitting up a 14554 line C++ file. It's basically the implementation of a single class, but by way of comparison, the header file is only 743 lines, so there's a lot of code in some of those methods. It'd be pretty unmanageable without Visual Assist (a plugin for Visual Studio that does fairly fast searching for symbols and files).
- pkrumins 5y agoChoose one: Perfect code you never shipped. Single 11,000 file code you shipped.
- flamesofphx 5y agoThose are rookie #'s, I have had php code doing mostly sql migration work in PDO twice that length in a single file :)
- phs318u 5y agoModularity applies at different levels and the purpose of modularity varies according to the level. Code can be modular at one level and not modular at another. Functional, domain knowledge, deployability, organisational alignment (e.g. operational support and maintainability), etc I see lots of people getting confused these days about modularity and people missing the point altogether. What is it you're after? What's most important to you? That's where you need to focus your modularity efforts.
- mbrodersen 5y agoThe size of a code file doesn’t matter. What matters is the amount of state the code in the file manipulates. For example, a 100k line code file with 500 pure functions not using any global state is fine. It is simple. However a 100k line code file with 500 functions that all manipulate 1000+ global variables is extremely complex and hard to maintain because of the undocumented global state invariants and hidden side effects.
- mhaberl 5y agoThose are rookie numbers. About 10 years ago I was shorty working on an app for bank tellers. The app was in production for 2-3 years at that point, 4 people where implementing new features. The whole app was 4 Java files/classes. 2 files had about 1.000LOC, 1 had about 15.000LOC, and last one had 80.000+ LOC. The big one did it all, UI, db calls, forms for printing, network calls. Most of the variables where named something like “c12”, “bkf22” etc.
- lcuff 5y agoWhen I learned to write FORTRAN IV for the CDC 6400 in 1974, I was told the standard compiler was written as a single routine. Didn't see the code myself, sadly. My, how our knowledge of how to do things has changed!
- xyst 5y agoThe horrors of working at a place that treats IT staff as second class citizens is an interesting one.
- insaider 5y agoThis one time, working at a country's state electricity provider, I was tasked with drawing all the power stations in the country on a map. I was stumped, I couldn't figure out why the markers weren't showing up. Then I zoomed out and saw them being drawn on the other side of the world. The latitudes and longitudes were the wrong way around. The data was from a government-maintained database. lol.
- xrd 5y agoI worked at a large ecommerce company on their Android app. I was tasked with using the Sonar tool to analyze the source code of their app. A bad cyclomatic complexity is 30, at which point it is difficult for an experienced engineer to follow the code paths. There was a file in that source that had over 900 cyclomatic complexity. The reason was that at that point Android had a limit on their method count. Called the dex limit. You could only have 64k methods, before multidex was introduced. The engineers couldn't add more methods, so they had to jam code into existing methods. No DRY. No refactoring. It was fucking impossible to understand at the code level. You had to just use the app for years to understand it. That analysis got a bunch of us targeted by the senior developers because it made them look bad. They fired multiple people, including me, who pointed this out. We said it made it impossible for new engineers on the project to succeed, and the incumbents didn't want that to be known, less they lose their bonuses.
- dudeinjapan 5y ago10 years back when I was first starting my company, we wanted to build a phone IVR system with Twilio to book tables at restaurants. It was fairly complex; it to track many different aspects of call state, including client being able to enter things like date/time/party size etc. with push-dial, and call our internal APIs. I assigned a recent college grad to the task. In a week, she came back and said "OK I've finished the prototype." I thought no way and I asked her to demo. Try X, try Y, try X + Y, etc. -- it all worked. Then I looked at the code. She had written the API handler as a one gigantic function, presumably because Twilio gives you a single API callback on an incoming call. It was a maze of nested if-statements going 10+ levels deep, subroutines relentlessly copy-pasted inline throughout the whole thing. Then she manually tested by dialing the phone 100s of times, putting in hacks throughout the if-tree. Her prototype ended up being pretty easy to refactor and was ultimately the basis (at least logic-wise) of what we put into production.
- gregopet 5y agoHad one like that, too. The previous programmer didn't believe in constants and the code was interpreting a binary protocol. Globals all over the place, too - I refactored a variable once and got a message that production is down; it was, the database was busy deleting customer history on all its connection pool threads. To this day I don't know how that refactor could've caused it. Fun times.
- bjarneh 5y agoI worked one year with "accounting software". The single-file-VBS-approach was almost all I ever saw. Anyone who knows anything about software development quits, and those who don't stay there and fiddle more with the incomprehensible 11.000 line VBS script to try to figure out why nobody born before 1981 didn't get their salary paid out last month...
- mikej1000 5y agoReminds me of an article about the code that Neil Ferguson's Imperial College team used to model covid. Though I think the Imperial code sounded worse.
- cbanek 5y agoI'll never forget the compiler bug we found once. We had a precompiled header file that was over 65,536 lines, and for some reason, it would just stop reading after that many lines. Of course we had some interesting compiler errors, but we never expected that it was a compiler bug.
- jve 5y ago> What is the moral of the story? Countless non-software developers, ranging from IT support to business analyst able to implement business requirements. Good for business if you ask me.
- lizardactivist 5y agoI've seen a complete high-level language compiler in a single file of around 250k lines. Granted, it was assembly language, but it was entirely hand written.
- imdhmd 5y agoIn my first company i quickly established myself as a good programmer. As a result i was awarded with a tough project on a tough client. What i came across in the code base astounded me. It was a java based code base with everything happening in the constructor of a class. A 3000 line long constructor. I didn't stay with the company for long after that.
- monkeycantype 5y agoA lot of what we call best practices, are good practices when collaborating. When I do things just for me - 10000 lines in a file isn’t a problem. I can see the whole thing in a minimap and know every comma
- blunte 5y agoIn the 90s I was given the task to make some changes to a shell script which provided a complete systems-engineer configuration management tool for country scale network management systems. This shell script was 9,000 lines long. Each new "menu" after entering a number corresponding to your selection from a previous menu took 60-120 seconds to appear. Needless to say, configuring systems was a painfully slow process. I quickly found it practically impossible to extend this tool to meet the new requirements, so I quietly rewrote it (also still in shell script, because of host limitations). The new version was 1,000 lines, and menu changes took < 2 seconds in most cases (thanks to appropriately placed caching). Management was not happy that I decided to rewrite (since the manager had written it himself originally), but the users were ecstatic about the performance increase. I would not be surprised if that tool was still in use today.
- benibela 5y agoIn Pascal that is really common, since the files are the modules. You publish your library as one file, and the user can import it by the file name. I ran wc on FreePascal to search for some. There are a few, but not as many as I expected. 9k file, data structures for the compiler itself: https://gitlab.com/freepascal.org/fpc/source/-/blob/main/./compiler/symdef.pas https://gitlab.com/freepascal.org/fpc/source/-/blob/main/./c... 30k file: Pascal parser/scope resolver: https://gitlab.com/freepascal.org/fpc/source/-/blob/main/packages/fcl-passrc/src/pasresolver.pp https://gitlab.com/freepascal.org/fpc/source/-/blob/main/pac... And the record: 119k file, Sharepoint API (but it seems to be autogenerated): https://gitlab.com/freepascal.org/fpc/source/-/blob/main/packages/odata/src/sharepoint.pp https://gitlab.com/freepascal.org/fpc/source/-/blob/main/pac... As far as libraries go, this is one of my favorites: 23k file, regular expression library: https://github.com/BeRo1985/flre/blob/master/src/FLRE.pas https://github.com/BeRo1985/flre/blob/master/src/FLRE.pas I searched my own files and found a 197k file to parse HTML entities. But that was an autogenerated trie (one switch/case for each letter)
- pkrumins 5y agoThere are two types of people in the world: 1. Who blog about how bad a 11,000 line project is 2. Who shipped the 11,000 line project
- _hcuq 5y agoThis is normal.
- KSPAtlas 5y agoYou can fit the plan9 kernel into that multiple times (and its not a microkernel)