Live data from Hacker News

A project with a single 11,000-line code file

austinhenley.com

41–50 of 346 posts

Re: A project with a single 11,000-line code file

#41

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

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

Re: A project with a single 11,000-line code file

#43

TypeScript's checker.ts is a 2.65 MB file containing 44,932 lines at the moment. https://github.com/microsoft/TypeScript/blob/main/src/compil... Does anyone know why and how they maintain it?

Unlike 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/...

Re: A project with a single 11,000-line code file

#46
It 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.

Re: A project with a single 11,000-line code file

#47

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

You sound like you should read this: [removed]

apparently jwz decided not to be linked from here :/

there's an archive.org link below.

Re: A project with a single 11,000-line code file

#49
post #17

It 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

That's like running down the side of a very steep mountain and calling it a successful endeavor before you've reached the bottom

Depends on your measure of success. Given a steep enough slope, you are almost guaranteed to reach the bottom one way or another.

Re: A project with a single 11,000-line code file

#50
post #47

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

You sound like you should read this: [removed] apparently jwz decided not to be linked from here :/ there's an archive.org link below.

Heads 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.
Post reply on HN