Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm assuming 3000 bytes refers to the uncompiled minified code


Indeed, and the question is why do that? We can count LOCs just fine already.


Because it'd be very hard to compare short program length otherwise? 5 LoC says nothing.


Technically, 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


> 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)


Oh, you're right. I should've tested that before writing my comment. Thanks for calling me out


Yeah but lines in anything should be "lines formatted with a standard formatter", not just "one line with ten thousand semicolons in it".


What 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 .


You 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.


The usual with this is "whatever ships with the language compiler and OS".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: