5 ms·
The current winner seems to be HTML at 23 bytes, though I would argue it doesn't meet the requirements of the question, which call for a "full program".
by square_usual 6y ago
The current winner seems to be HTML at 23 bytes, though I would argue it doesn't meet the requirements of the question, which call for a "full program".
- corytheboyd 6y agoBecause it requires rendering by a browser? You could make the same argument that the interpreted language answers are also not “full programs” But stepping back even further why are we talking about this, it’s just a fun exercise against a hello world. The only thing being solved for is fun.
- rileymat2 6y agoIf you are going down that route you could claim that assembly's use of a bios interrupt to print are not full programs either.
- hamburglar 6y agoWould have to be a terminal-based browser, since the rules do specify that the message and nothing else must be printed to stdout. Presumably 'links' can do that. It is slightly disappointing that all the solutions I see for various languages are just different ways to trigger pretty much the same multi-line comment parsing problem in sloc.
- jerf 6y agoThe argument against is that HTML qua HTML is not a programming language, and that it is reasonable in English to say that "0 lines of code" implies the use of something that could have code in it, not something that degenerately contains no code because it is incapable of having any code at all. A text file with "Hello World" wouldn't be a solution either, nor the minimal CSV document with "Hello World", nor a PNG showing "Hello World", etc. These may also have "zero lines of code" in that strict, pedantic sense, but that makes them uninteresting. The argument for including it even so is that if you think of the underlying challenge as "fooling sloc" and that the original challenge phrased it in terms of "code" simply because sloc mostly deals with code, but as it happens, it also tries to count HTML even though it isn't (necessarily) code, then it's reasonable to include. I have to qualify HTML qua HTML because once you include Javascript, it goes from trivially not code to trivially being code, or at least capable of carrying code. But it is important not to blur the lines between a document format and code. There are real and important differences. HTML qua HTML is not a programming language. Edit: Oh, the solution to the other debate going on is that programming languages ALWAYS execute in the context of a virtual machine of some sort, or in the case of assembly, a real machine (at least in potential). The distinguishing characteristics of a programming language is something along the lines of being at least one of "Turing complete" and "able to read input, change behavior based on it, and write output", although I'm not getting too far down the weeds on that one on purpose. You can't use "whether or not they need a specialized execution environment to function" as a distinction for whether or not something is a programming language, because they all do.
- alexfrydl 6y agoThis is way too much to write on the topic of what should and should not count for this goofy code golf challenge.
- jerf 6y agoThe much more important point is what is and is not a "coding" at all.
- esrauch 6y agoThe very straightforward counterargument is that sloc counts non-comment html lines as code-lines. The challenge is "trick sloc into considering something that it counts as code to not counting it as code".
- marcianx 6y agoOh, in that case, I have an even shorter "program": Hello world Run it with `cat`. ;)