3 ms·
> The best way you can contribute to an open source project is to remove lines of code from it. Deleting code doesn't necessarily mean you're making it simpler
by root_axis 9y ago
> The best way you can contribute to an open source project is to remove lines of code from it.
Deleting code doesn't necessarily mean you're making it simpler. Compressing a 5 line function into a snazzy 1-liner is almost certainly making the code worse, not better.
> Every line that you write costs people time.
This kind of mantra is how you end up with nested ternary expressions and tightly wound functional compositions in imperative languages.
- Dreami 9y agoI don't think he meant compressing 5 lines of "normal code" into a one-liner. He meant, actually removing it. Maybe the logic it provides is not needed anymore, or you could do it somewhere else in a far more readable way (I'm thinking about abstraction levels)
- root_axis 9y agoSure, and I think we can all agree that this type of refactoring is useful, but I have worked with many developers that really take this anti-LoC idea to heart and end up producing difficult to read code because they are so focused on finding the most terse way to express logic.
- rumcajz 9y ago> Deleting code doesn't necessarily mean you're making it simpler. Compressing a 5 line function into a snazzy 1-liner is almost certainly making the code worse, not better. What about using something like gofmt? That way you can't get rid of lines by just rearranging the code.