←back to thread

-2000 Lines of code

(www.folklore.org)
499 points xeonmc | 1 comments | | HN request time: 0.204s | source
Show context
impostervt ◴[] No.44386164[source]
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.

replies(2): >>44386217 #>>44386712 #
motorest ◴[] No.44386217[source]
> 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.

replies(3): >>44386293 #>>44386392 #>>44387307 #
1. williamdclt ◴[] No.44387307[source]
I mean, you can get basic implementations of Vue and state management libs in a few hundred (maybe thousand?) LOCs (lots of examples on the interweb) that are probably less "toyish" than whatever this person had handrolled