3 ms·
>>Lots of people have noticed that keeping your code short is extremely important. More surprisingly, many people fail to notice this, probably because "1 line
by billswift 16y ago
>>Lots of people have noticed that keeping your code short is extremely important. More surprisingly, many people fail to notice this, probably because "1 line is better than 5" doesn’t sound that convincing. OK, think about 100K lines vs 500K and you’ll get the idea. Oh, there are also those dirty Perl/shell one-liners that make one doubt about this. I’ve known a Bastard Programmer that used 2K bash one-liners as his weapon of choice. OK then, so the actual rule must be "short code is good unless it’s written by a bastard". But it’s the same core idea.
The key is readability not shortness for its own sake. Generally, shorter helps, but not if it is made too concise for easy understanding.
As for "ad hoc scripting languages" you should read Fred Brooks comments on "The Worst Computer Language Ever", IBM's Job Control Language (JCL) in his new book The Design of Design.