News for hackers. Stuff that matters.
Re:CNET is deleting old articles to try to improve its Googl... by Dalewyn on Wednesday August 09, 2023 @10:38PM (#37071247)
The minified HTML (and, god forbid, JavaShit) is the source from which the browser ultimately renders a page, so yes that is source code.
Re:CNET is deleting old articles to try to improve its Googl... by naniwaduni on Wednesday August 09, 2023 @10:45PM (#37071310)
"The ISA bytecode is the source from which the processor ultimately executes a programs, so yes that is source code."
Re:CNET is deleting old articles to try to improve its Googl... by hunter2_ on Wednesday August 09, 2023 @11:24PM (#37071559)
I suppose the difference is that someone debugging at that level will be offered some sort of "dump" command or similar, whereas someone debugging in a browser is offered a "View Source" command. It's just a matter of convention and expectation.

If we wanted browsers to be fed code that for performance reasons isn't human-readable, web servers ought to serve something that's processed way more than just gzipped minification. It could be more like bytecode.

Re:CNET is deleting old articles to try to improve its Googl... by panzi on Thursday August 10, 2023 @01:04AM (#37072173)
If you need to use prettiefy to even have a chance to understand the code, is it still source code?

About the byte code: You mean wasm? (Guess that's what you're alluding to.)

Re:CNET is deleting old articles to try to improve its Googl... by flusensieb on Thursday August 10, 2023 @06:22AM (#37074201)
If you need syntax highlighting and an easy way to navigate between files to understand a large code base, is it still source code?
Re:CNET is deleting old articles to try to improve its Googl... by phatskat on Thursday August 10, 2023 @01:10AM (#37072206)
> It could be more like bytecode.

Isn’t this essential what WebAssembly is doing? I’ll admit I haven’t looked into it much, as I’m crap with C/++, though I’d like to try Rust. Having “near native” performance in a browser sounds nice, curious to see how far it’s come.

Re:CNET is deleting old articles to try to improve its Googl... by Dalewyn on Thursday August 10, 2023 @02:00AM (#37072473)
>If we wanted browsers to be fed code that for performance reasons isn't human-readable,

Worth keeping in mind that "performance" here refers to saving bandwidth costs as the host. Every single unnecessary whitespace or character is a byte that didn't need to be uploaded, hence minify and save on that bandwidth and thus $$$$.

The performance difference on the browser end between original and minified source code is negligible.

Re:CNET is deleting old articles to try to improve its Googl... by hnlmorg on Thursday August 10, 2023 @02:41AM (#37072731)
Last time I ran the numbers (which admittedly was quite a number of years ago now), the difference between minified and unminified code was negligible once you factored in compression because unminified code compresses better.

What really adds to the source code footprint is all of those trackers, adverts and, in a lot of cases, framework overhead.

Re:CNET is deleting old articles to try to improve its Googl... by hunter2_ on Thursday August 10, 2023 @02:36AM (#37072683)
I was thinking transfer speed, although even then, the difference is probably negligible if compressing regardless.
Re:CNET is deleting old articles to try to improve its Googl... by Dalewyn on Thursday August 10, 2023 @02:41AM (#37072737)
The way I see it, if someone needs to minify their JavaShit (and HTML?! CSS?!) to improve user download times, that download time was horseshit to start with and they need to rebuild everything properly from the ground up.
Re:CNET is deleting old articles to try to improve its Googl... by notpushkin on Thursday August 10, 2023 @06:16AM (#37074153)
I find myself using View Source sometimes, too, but more often I just use devtools, which shows DOM as a readable tree even if source is minified.

I'm actually all for binary HTML – not just it's smaller, it can also be easier to parse, and makes more sense overall nowadays.

Re:CNET is deleting old articles to try to improve its Googl... by hnick on Thursday August 10, 2023 @06:47AM (#37074388)
Let's be honest, a lot of non-minified JS code is barely legible either :)

For me I guess what I was getting at is that I consider source the stuff I'm working on - the minified output I won't touch, it's output. But it is input for someone else, and available as a View Source so that does muddy the waters, just like decompilers produce "source" that no sane human would want to work on.

I think semantically I would consider the original source code the "real" source if that makes sense. The source is wherever it all comes from. The rest is various types of output from further down the toolchain tree. I don't know if the official definition agrees with that though.

Re:CNET is deleting old articles to try to improve its Googl... by regular_trash on Wednesday August 09, 2023 @11:28PM (#37071585)
Turrles all the way down