4 ms·
Reducing the number of lines isn't important. Unless you're code golfing or otherwise competing to fit within a certain code/binary size, you should never care
by just2n 14y ago
Reducing the number of lines isn't important. Unless you're code golfing or otherwise competing to fit within a certain code/binary size, you should never care about line count at all.
The only thing it will do is cause you to crush your lines wherever possible and code horizontally instead of vertically, which generally conflicts with readability. In fact, I'd actually impose a limit on line length to prevent just that.
Instead, write code that makes sense when you read it. Avoid cleverness, and DRY. Repeating yourself in the way that violates DRY principles can often make reading code more difficult because you're essentially forced to re-read repetitive code because you can't assume it's all identical.
The only exception to this is code standards for consistency in the code base that make sense, such as use a '{' on the same line as the definition or omit the '{}' block if the body is just 1 statement in cases where you won't violate a width constraint, etc. Anything that isn't completely reasonable as a code standard is optimizing for line count and is probably the wrong thing to do.
- jack9 14y ago> Reducing the number of lines isn't important. This is statistically false. It is the ONLY thing, we know, in CS, that is relevant to accuracy. The confounding effect of class size on the validity of object-oriented metrics - Subscribe by email Your email: Contributors Christoph Treude Felienne Hermans Greg Wilson Jorge Aranda Leif Singer Neil Ernst Recent Tweets profile Never Work in Theory neverworktheory neverworktheory Comments on Firefox Available for Analysis: wp.me/p1FcBp-8c 13 days ago · reply · retweet · favorite neverworktheory Halving Fail Rates using Peer Instruction: wp.me/p1FcBp-87 29 days ago · reply · retweet · favorite neverworktheory Experimental Assessment of Software Metrics Using Automated Refactoring: wp.me/p1FcBp-7S 53 days ago · reply · retweet · favorite neverworktheory MSR 2013 – Call for Papers: wp.me/p1FcBp-7E 67 days ago · reply · retweet · favorite Join the conversation Categories Announcements Book Reviews Case Studies Code Ownership Code Review Code Smells Collaboration Controlled Experiments Documentation Education Estimation Experience Reports General Literature Reviews Meta Metrics Mining Noticed Open Source Organizational Studies Pair Programming Practices Programming Languages Qualitative Studies Quality Quantitative Studies Questions Refactoring Reproducibility Scientific Computing Survey Testing Tools Uncategorized Usability Verification Video Recent comments Geert Bollen on Why We Need Evidence Graham on Experimental Assessment of Software Metrics Using Automated Refactoring Willem van den Ende on Experimental Assessment of Software Metrics Using Automated Refactoring FelienneHermans on Experimental Assessment of Software Metrics Using Automated Refactoring Willem van den Ende on Experimental Assessment of Software Metrics Using Automated Refactoring The Confounding Effect of Class Size on the Validity of Object-Oriented Metrics July 7, 2011 gvwilson 3 comments Khaled El Emam, Saida Benlarbi, Nishith Goel, and Shesh N. Rai: “The Confounding Effect of Class Size on the Validity of Object-Oriented Metrics“. IEEE Transasctions on Software Engineering, 27(7), July 2001. Jesus, how do you comment (weakly) on a well-understood topic, without any understanding of the domain? I dunno, ask just2n.
- just2n 14y agoDownvotes on this? Be thankful downvotes are anonymous. You are very likely incredibly incompetent, and I fear for anyone who has to read your code or worse, use it.