Hacker News new | past | comments | ask | show | jobs | submit login

I once was responsible for maintaining code like this:

There were 3 client-side javascript files. They were named something like this:

foo.js foo2.js foo-z.js

Each file was about 4,000 lines long. All 3 were nearly line-for-line identical, save for about 500 lines of differences each, strewn wantonly about. For some of the URLs the app would use foo.js, for some other URLs it would use foo2.js, and for yet more of the URLs it would use foo-z.js.

There were 4 files on the server like this which did the same thing - copied line for line and then changed in various places.

After refactoring these files together and eliminating the duplicate code, I ended up deleting something like 8,000 lines of code. I quit soon after - by then I was already looking for another job.

That code was shit. There is no question about it.




Applications are open for YC Winter 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: