Live data from Hacker News

Deleting 50k Lines of Code in 3 Days

aakashns.com

11–20 of 62 posts

Re: Deleting 50k Lines of Code in 3 Days

#12
post #5
post #2

I accidentally imported a 3rd party library twice. Deleted the extra. Got a nice badge for deleting over 500k lines of code.

Is it a common practice to commit dependencies into the project repo? If so what type of projects do that?

It’s not unusual to do it in C or C++, just because the dependency management story sucks so bad (there’s a lot more options than there used to be, but still no one defacto standard like pip or cargo).

Re: Deleting 50k Lines of Code in 3 Days

#13
Not sure what kind of company they work for, but if it is a legitimate business with real customers then higher ups should be horrified that a developer is randomly deleting in-use production features under the guise of "code cleanup". Whether it is accessed by 50% or 0.5% of users is irrelevant. That is not a measure of how important something is in the codebase or the product.

We have a data export form on our website (which is a requirement under GDPR and several other similar regulations) that has been used by under 0.01% of users throughout its existence. If a new hire decided to "clean it up" without approval and then bragged about how many lines of code they were able to reduce...

Re: Deleting 50k Lines of Code in 3 Days

#14
post #5
post #2

I accidentally imported a 3rd party library twice. Deleted the extra. Got a nice badge for deleting over 500k lines of code.

Is it a common practice to commit dependencies into the project repo? If so what type of projects do that?

The type of projects where you want to be able to run them in 20 years.

Re: Deleting 50k Lines of Code in 3 Days

#16
post #7

> While I knew that some pages were less frequently visited than others, I was surprised to see that there were modules that accounted for less than 0.1% of page visits. This meant I could remove them entirely without affecting 99.9% of users. I could delete entire directories containing dozens of files and thousands of lines of code. I don't know about the author's application, but a data driven approach is not goin…

If you could somehow track the frequency spectrum of usage, then you could mostly handle that problem. "Oh, the frequency spectrum strongly peaks at about once a week? I guess users regularly need to use this feature. Probably important somehow." vs "Huh, the frequency spectrum isn't strongly peaked anywhere, but is substantially lower at high frequencies. We can probably remove this."

Imagine a time keeping system where employees regularly enter their hours and schedule time off. But somewhere is a button or screen that gets used once a week called "run payroll". Aside from being periodic and not available to everyone, no metrics can capture how important it is.

Never the less, my favorite thing to do with code is running over it with the delete key. Just be careful about what gets it ;-)

Re: Deleting 50k Lines of Code in 3 Days

#17
Huh, this is exactly how Evernote ported their application. Removed a bunch of features that paying customers only used "sometimes".

After a couple of years the feature set has mostly returned.

I cancelled my subscription and mostly moved to other apps. I still utterly despise everybody at Evernote.

Re: Deleting 50k Lines of Code in 3 Days

#18
post #6

> modules that accounted for less than 0.1% of page visits. This meant I could remove them entirely without affecting 99.9% of users. No it doesn't, these are different metrics, same user that does those 99.9% visits could once in a blue moon want to visit a very important page, and be negatively affected. And this could (in theory) be the case for every single user The Word screenshot is another illustration of the…

Yeah, I'm thinking about the apps I use all the time and the features that I rarely use but would miss.

Like reset password... or account cancellation ... stuff like that.

Re: Deleting 50k Lines of Code in 3 Days

#20
post #5

Earlier quoted context omitted.

Is it a common practice to commit dependencies into the project repo? If so what type of projects do that?

It’s not unusual to do it in C or C++, just because the dependency management story sucks so bad (there’s a lot more options than there used to be, but still no one defacto standard like pip or cargo).

There's this concept of a shared library, you should check it out.
Post reply on HN