The conversation

Lessons learnedExperience excerpt · English

About 1.5 years ago I inherited a project with ~ 250,000 lines of code - in just the web UI (not …

About 1.5 years ago I inherited a project with ~ 250,000 lines of code - in just the web UI (not counting back end). The developer who wrote it was a smart guy, but he had never worked on any other JS project. All state was stored in the DOM in custom attributes, .addEventListeners EVERYWHERE... I joke that it was as if you took a monk, gave him a book about javascript, and then locked him in a cell for 10 years. I started refactoring pieces into web components, and after about 6 months had removed 50k lines of code. Now knowing enough about the app, I started a complete rewrite. The rewrite is about 80% feature parity, and is around 17k lines of code (not counting libraries like Vue/pinia/etc). So, soon, I shall have removed over 200,000 loc from the project. I feel like then I should retire as I will never top that.

Original discussion-2000 Lines of code (2004)246 source comments · at import
2

Community replies 0

No community replies yet. Add your perspective.

Replies from the source 2

Direct replies available in this import. Original-language excerpts.

MO

> The rewrite is about 80% feature parity, and is around 17k lines of code (not counting libraries like Vue/pinia/etc). This is exactly where these comparisons break down. Obviously you don't need as much code to get passable implementations of a fraction of all the features.

Full original
CT

> I joke that it was as if you took a monk, gave him a book about javascript, and then locked him in a cell for 10 years. I've had a similar experience (see other comment), the original author was a junior developer at best, but unfortunately, a middle-aged, experienced developer, one of the founders of the company, and very productive. But obviously, not someone who had ever worked in a team or who had someone else work on their codebase. Think functions thousands of lines long, nested switch/case/if/else/ternary things ten levels deep, concatenated SQL queries (it was PHP because of course), concatenated JS/HTML/HTML-with-JS (it was Dojo front-end), no automated tests of any sort, etc.

Full original
Continue on Hacker News

Respect different perspectives. Share concrete experiences.

Sign in to post, reply, repost, and quote.