Live data from Hacker News

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

austinhenley.com

1–10 of 346 posts

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

#2
This 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.

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

#3
A 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

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

#7
The number of lines in a file doesn't necessarily mean anything. SQLite is compiled as a single file: 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.

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

#8
I 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/AAAAAAAAOv...

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

#10
post #7

The number of lines in a file doesn't necessarily mean anything. SQLite is compiled as a single file: 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]
Post reply on HN