3 ms·
Indeed, and the question is why do that? We can count LOCs just fine already.
by exac 2y ago
Indeed, and the question is why do that? We can count LOCs just fine already.
- thrw42A8N 2y agoBecause it'd be very hard to compare short program length otherwise? 5 LoC says nothing.
- ffsm8 2y agoTechnically, it depends on the language. I.e. python doesn't have anything like a semicolon to combine multiple statements and assignments per line But yeah, for C the LOC metric can be gamed to a silly degree
- mattashii 2y ago> python doesn't have anything like a semicolon to combine multiple statements Python does have a "semicolon to combine multiple statements", and has further (lambda f: f(f)) expressions for complex expressions with local names and scopes. (not that using either for those would result in pythonic code, but it is certainly not missing from the language)
- ffsm8 2y agoOh, you're right. I should've tested that before writing my comment. Thanks for calling me out
- stavros 2y agoYeah but lines in anything should be "lines formatted with a standard formatter", not just "one line with ten thousand semicolons in it".
- oneeyedpigeon 2y agoYou also need to define whether the code has to be raw CPU instructions or if it's allowed to use an external library containing all the code humanity has ever produced.
- thrw42A8N 2y agoThe usual with this is "whatever ships with the language compiler and OS".
- CaptainNegative 2y agoWhat counts as a standard formatter? Python one-liners are Turing complete even without semicolons, evals, execs, and with finite stack depth. E.g. some formatters keep this at one line, while others introduce line breaks https://yonatan.us/misc/bf.html https://yonatan.us/misc/bf.html .