|
|
|
|
|
by w0utert
3817 days ago
|
|
>> Less code is not really that important anymore (within sensible bounds) Clarity to whatever poor shmo has to maintain it is often much more important than saving 5 lines with some clever bit twiddling hack. I don't think many people will advocate reducing line count by stuffing the same processing into fewer lines using clever tricks. What should always be considered a good thing though, is cutting down on the line count by changing the algorithm/strategy, using better suited data structures, by trying to 'do less' and get the same result, not trying to support every thinkable corner case you will never run into, by preferring multiple simple implementations of the same thing for different corner cases, over one single complex kitchen-sink solution, by not re-inventing the wheel and using tried & tested libraries/frameworks, etc. I know it sounds like a terrible cliche, but any line you don't write, is a line that can't contain bugs ;-). Over the years I've learned that almost always, simplicity is preferred over complexity, even if it implies a little bit of duplication, or an implementation that is 'less awesome' because it 'only' does what is needed for the application. |
|