+ 4

[OFF-TOPIC] Program line count vs Readability, clarity and/or speed

I feel like line counts matter more in programs than anything else on SoloLearn. The first language I have learned is Java and here I am focusing on Python and there is no arguing that the same algorithm will often need less lines in Python than in Java. However, it seems that oftentimes both clarity and speed are overlooked in the benefit of line count. Corner cases and errors are no longer addressed. Does line count really matter that much? Or do most people just have it backward around here?

25th Mar 2018, 4:30 PM
cyk
cyk - avatar
2 Answers
+ 3
I think people here (me included) like oneliners and alikes, not because they’re good codes, but because you get some training on syntax by writing shorter codes. Also, you’re not very likely to maintain your SL codes, so extreme readability isn’t always fundamental. But yes, readable and sparse code is better than short code, usually.
25th Mar 2018, 4:55 PM
Pedro Demingos
Pedro Demingos - avatar
+ 2
I often do the refactoring. I try to keep a balance between readability and a lot of code. Often this can be done in Android programming and Java. For example, when I once changed the common code on the interface
25th Mar 2018, 4:39 PM
Aidos Zhakupov
Aidos Zhakupov - avatar