3 ms·
I think the idea of reducing lines of code as a means of success can go too far. Sure, you can squeeze that block of code down a few dozens of lines of code, b
by talmand 11y ago
I think the idea of reducing lines of code as a means of success can go too far.
Sure, you can squeeze that block of code down a few dozens of lines of code, but then how hard is it to follow along behind you and deduce your intentions? You may be saving something today to just be needlessly spending it tomorrow.
- mod 11y agoIt's almost never taken too far, so generally speaking, this argument doesn't carry much weight. Also, at a few dozen lines per block, you could keep going a long way!
- talmand 11y agoThe fact that it's almost never taken too far is a good example that it actually does carry a great deal of weight, it's just one of those things that people respect.
- brlewis 11y agoYes, reduced spending in any area can go too far. There's such a thing as justifiable spending. Calling it spending merely illustrates that it isn't automatically a good thing.
- vlunkr 11y agoThis is true, I've seen one-liners in ruby that will make your eyes bleed. As I've matured as a developer I've felt the need to write less lines to code, but also to be very clear and explicit. I think there's an appropriate balance somewhere.
- xg15 11y agoI think it makes more sense if you see lines as an indicator for the thing you'll really want to minimize, which is the complexity of the model and/or instructions you describe in the lines. To use a somewhat skewed analogy, imagine you want to tell directions to a foreigner. One possible answer could be "Go 200 meters west, then go 100 meters east, then go 100 meters south". The route that this answer describes is needlessly complex. The simpler route "Go 100 meters east, then go 100 meters south" will bring you to the same destination in less time. You could try to further simplify you answer and just tell "Use the old road". But while that reads even shorter, you have not reduced the complexity of the actual route. It's just hidden behind an abstraction.
- talmand 11y agoI'm not against reducing complexity, I don't think that's necessarily going too far. I'm speaking more about what happens when you go too far and someone else has to deal with it. Let's say the simplest, and still descriptive, directions are: go down Main Street turn left at Oak Street turn right at Acorn Lane fifth house on the left versus: go that way, left at Smith's, right at Taylor's, brick house The second is an example of refactoring to reduce line count but actually increases complexity to someone not familiar with the area.