News for hackers. Stuff that matters.
Re:CNET is deleting old articles to try to improve its Googl... by SahAssar on Wednesday August 09, 2023 @08:14PM (#37070153)
In my experience SEO experts are the most superstitious tech people I ever met. One guy wanted me to reorder HTTP header fields to match another site. He wanted our minified HTML to include a linebreak just after a certain meta element just because some other site had it. I got requests to match variable names in minified JS just because googles own minified JS had that name.
Re:CNET is deleting old articles to try to improve its Googl... by cde-v on Wednesday August 09, 2023 @09:36PM (#37070814)
Considering their job can be done by literally anyone, they have to differentiate somehow
Re:CNET is deleting old articles to try to improve its Googl... by Dalewyn on Wednesday August 09, 2023 @09:57PM (#37070988)
>our minified HTML

Unreadable source code is a crime against humanity.

Re:CNET is deleting old articles to try to improve its Googl... by hnick on Wednesday August 09, 2023 @10:25PM (#37071184)
Is minified "code" still "source code"? I think I'd say the source is the original implementation pre-minification. I hate it too when working out how something is done on a site, but I'm wondering where we fall on that technicality. Is the output of a pre-processor still considered source code even if it's not machine code? These are not important questions but now I'm wondering.
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
Re:CNET is deleting old articles to try to improve its Googl... by gmerc on Thursday August 10, 2023 @12:57AM (#37072142)
and does an LLM care … it feels like minification doesn’t stop one form explaining the code at all.
Re:CNET is deleting old articles to try to improve its Googl... by throwaway290 on Thursday August 10, 2023 @02:46AM (#37072777)
Source code is what you write and read, but sometimes you write one thing and people can only read it after your pre processing. Why not enable pretty output?

Plus I suspect minifying HTML or JS is often cargo cult (for small sites who are frying the wrong fish) or compensating for page bloat

Re:CNET is deleting old articles to try to improve its Googl... by robertlagrant on Thursday August 10, 2023 @07:16AM (#37074636)
It does stuff like tree shaking as well; it's quite good. If your page is bloated, it makes it better. If your page is not bloated, it makes it better.
Re:CNET is deleting old articles to try to improve its Googl... by throwaway290 on Thursday August 10, 2023 @11:02AM (#37077054)
Tree-shaking is orthogonal to minification tho.
Re:CNET is deleting old articles to try to improve its Googl... by robertlagrant on Thursday August 10, 2023 @11:19AM (#37077276)
That's true.
Re:CNET is deleting old articles to try to improve its Googl... by dgb23 on Thursday August 10, 2023 @01:29PM (#37079055)
It doesn't compensate bloat, but it reduces bytes sent over the wire, bytes cached in between and bytes parsed in your browser for _very_ little cost.

You can always open dev tools in your browser and have an interactive, nicely formatted HTML tree there with a ton of inspection and manipulation features.

Re:CNET is deleting old articles to try to improve its Googl... by throwaway290 on Thursday August 10, 2023 @02:45PM (#37080114)
In my experience usually the bigger difference is made by not making it bloated in the first place... As well as progressive enhancement, nonblocking load, serving from a nearby geolocation etc. I see projects minify all the things by default while it should be literally the last measure with least impact on TTI
Re:CNET is deleting old articles to try to improve its Googl... by henriquez on Wednesday August 09, 2023 @10:14PM (#37071102)
It’s also a crime against zorgons from Planet Zomblaki.
Re:CNET is deleting old articles to try to improve its Googl... by vasco on Thursday August 10, 2023 @12:38AM (#37072014)
Nobody tell this guy about compilers.
Re:CNET is deleting old articles to try to improve its Googl... by midoridensha on Thursday August 10, 2023 @01:35AM (#37072354)
So I guess you think compiled code is even worse, right?
Re:CNET is deleting old articles to try to improve its Googl... by Dalewyn on Thursday August 10, 2023 @01:47AM (#37072417)
I mean, isn't that precisely why open source advocates advocate for open source?

Not to mention, there is no need to "minify" HTML, CSS, or JavaShit for a browser to render a page unlike compiled code which is more or less a necessity for such things.

Re:CNET is deleting old articles to try to improve its Googl... by hunter2_ on Thursday August 10, 2023 @02:39AM (#37072706)
If someone releases only a minified version of their code, and licenses it as free as can be, is it open source?
Re:CNET is deleting old articles to try to improve its Googl... by naniwaduni on Thursday August 10, 2023 @08:14AM (#37075209)
The popular licenses for which this is a design concern are careful to define source code to mean "preferred form of the work for making modifications" or similar.
Re:CNET is deleting old articles to try to improve its Googl... by zauguin on Thursday August 10, 2023 @10:29PM (#37084394)
According to the Open Source Definition of the OSI it's not:

> The program must include source code [...] The source code must be the preferred form in which a programmer would modify the program. Deliberately obfuscated source code is not allowed. Intermediate forms such as the output of a preprocessor [...] are not allowed.

Re:CNET is deleting old articles to try to improve its Googl... by midoridensha on Thursday August 10, 2023 @03:42AM (#37073173)
Minifying code for browsers greatly reduces the amount of bandwidth needed to serve web traffic. There's a good reason it's done.

By your logic, there's actually no reason to use compiled code at all, for almost anything above the kernel. We can just use Python to do everything, including run browsers, play video games, etc. Sure, it'll be dog-slow, but you seem to care more about reading the code than performance or any other consideration.

Re:CNET is deleting old articles to try to improve its Googl... by Dalewyn on Thursday August 10, 2023 @04:28AM (#37073490)
I already alluded[1] to the incentives for the host to minify their JavaShit, et al., and you would have a point if it wasn't for the fact that performance otherwise isn't significantly different between minified and full source code as far as the user would be concerned.

[1]: https://news.ycombinator.com/item?id=37072473

Re:CNET is deleting old articles to try to improve its Googl... by midoridensha on Thursday August 10, 2023 @05:07AM (#37073722)
I'm not talking about the browser's performance, I'm talking about the network bandwidth. All that extra JS code in every HTTP GET adds up. For a large site serving countless users, it adds up to a lot of bandwidth.
Re:CNET is deleting old articles to try to improve its Googl... by bee_rider on Thursday August 10, 2023 @10:42AM (#37076779)
Somebody mentioned negligible/deleterious impacts on bandwidth for minified code in that thread, but they seemed to have low certainty. If you happen to have evidence otherwise, it might be informative for them.
Re:CNET is deleting old articles to try to improve its Googl... by mannerheim on Thursday August 10, 2023 @10:52AM (#37076908)
>JavaShit

Glad to see the diversity of HN readers apparently includes twelve year olds.

Anyway, you do realise plenty of languages have compilers with JS as a compilation target, right? How readable do you think that is?

Re:CNET is deleting old articles to try to improve its Googl... by Dalewyn on Thursday August 10, 2023 @06:22PM (#37082507)
>Glad to see the diversity of HN readers apparently includes twelve year olds.

The abuse of JavaScript does not deserve the respect of being called by a proper name.

>Anyway, you do realise plenty of languages have compilers with JS as a compilation target, right? How readable do you think that is?

If you're going to run "compiled" code through an interpreter anyway, is that really compiled code?

Re:CNET is deleting old articles to try to improve its Googl... by mannerheim on Friday August 11, 2023 @11:14AM (#37089622)
>In computing, a compiler is a computer program that translates computer code written in one programming language (the source language) into another language (the target language).
Re:CNET is deleting old articles to try to improve its Googl... by filcuk on Thursday August 10, 2023 @09:53AM (#37076186)
Well, no, but it can speed up loading by reducing transfer.
Re:CNET is deleting old articles to try to improve its Googl... by mrguyorama on Thursday August 10, 2023 @01:22PM (#37078961)
Is that still true with modern compression?
Re:CNET is deleting old articles to try to improve its Googl... by SahAssar on Thursday August 10, 2023 @01:19PM (#37078926)
Minifying HTML is basically just removing non-significant whitespace. Run it through a formatter and it will be readable.

If you dislike unreadable source code I would assume you would object to minifying JS, in which case you should ask people to include sourcemaps instead of objecting to minification.

Re:CNET is deleting old articles to try to improve its Googl... by CharlesW on Wednesday August 09, 2023 @10:45PM (#37071302)
> In my experience SEO experts are the most superstitious tech people I ever met.

And some are the most data-driven people you'll ever meet. As with most people who claim to be experts, the trick is to determine whether the person you're evaluating is a legitimate professional or a cargo-culting wanna-be.

Re:CNET is deleting old articles to try to improve its Googl... by edmundsauto on Thursday August 10, 2023 @12:01AM (#37071793)
I’ve always felt there is a similarity to day traders or people who overanalyze stock fundamentals. There comes a time when data analysis becomes astrology…
Re:CNET is deleting old articles to try to improve its Googl... by andirk on Thursday August 10, 2023 @01:40AM (#37072379)
> There comes a time when data analysis becomes astrology.

Excellent quote. It's counterintuitive but looking at what is most likely to happen according to the datasets presented can often miss the bigger picture.

Re:CNET is deleting old articles to try to improve its Googl... by reacharavindh on Thursday August 10, 2023 @05:38AM (#37073931)
This. It is often the scope and context that determines logic. It is easy to build bubbles and stay comfy inside. Without revealing much, I asked a data scientist whose job it is to figure out bids on keywords and essentially control how much $ is spent on advertising something at a specific region about negative criteria. As in, are you sure you wouldn’t get this benefit even if you stopped spending the $ and his response was “look at all this evidence that our spend caused this x% increase in traffic and y% more conversions” and that was 2 years ago. My follow up question was - okay, now that the thing you advertised is popular, wouldn’t it be the more organic choice in the market, and we can stop spending the $ there? His answer was - look at what happened when we stopped the advertising in this small region in Germany 1.5 years ago! My common sense validation question still stands. I still believe he built a shiny good bubble 2 years ago, and refuses to reason with wider context, and second degree effects.
Re:CNET is deleting old articles to try to improve its Googl... by robertlagrant on Thursday August 10, 2023 @07:15AM (#37074627)
The people who spend on marketing are not incentivised to spend less :)
Re:CNET is deleting old articles to try to improve its Googl... by philsnow on Thursday August 10, 2023 @05:13AM (#37073771)
> There comes a time when data analysis becomes astrology...

or just plain numerology

Re:CNET is deleting old articles to try to improve its Googl... by bee_rider on Thursday August 10, 2023 @10:29AM (#37076601)
Leos are generally given the “heroic/action-y” tropes, so if you are, for example, trying to pick Major League Baseball players, astrology could help a bit.

Right for the wrong reasons is still right.

Re:CNET is deleting old articles to try to improve its Googl... by edmundsauto on Thursday August 10, 2023 @01:32PM (#37079107)
Right for the wrong reasons doesn't give confidence it's a sustainable skill. Getting right via randomness also fits into the same category.
Re:CNET is deleting old articles to try to improve its Googl... by josefx on Thursday August 10, 2023 @02:53AM (#37072833)
My data driven climate model indicates that we could combat climate change by hiring more pirates.
Re:CNET is deleting old articles to try to improve its Googl... by JohnFen on Thursday August 10, 2023 @11:16AM (#37077237)
Some of the most superstitious people I've ever met were also some of the most data-driven people I've ever met. Being data-driven doesn't exclude unconscious manipulation of the data selection or interpretation, so it doesn't automatically equate to "objective".
Re:CNET is deleting old articles to try to improve its Googl... by SahAssar on Thursday August 10, 2023 @01:24PM (#37078986)
The data analysis I've seen most SEO experts do is similar to sitting at a highway, carefully timing the speed of each car, taking detailed notes of the cars appearance, returning to the car factory and saying that all cars need to be red because the data says red cars are faster.
Re:CNET is deleting old articles to try to improve its Googl... by brendank310 on Wednesday August 09, 2023 @11:51PM (#37071726)
I think you're largely correct but Google isn't one person so there may be somewhat emergent patterns that work from an SEO standpoint that don't have a solid answer to Why. If I were an SEO customer I would ask for some proof but that isn't the market they're targeting. There was an old saying in the tennis instruction business that there was a bunch of 'bend your knees, fifty please'. So lots of snakeoil salesman but some salesman sell stuff that works.
Re:CNET is deleting old articles to try to improve its Googl... by adrianmsmith on Thursday August 10, 2023 @04:07AM (#37073359)
One SEO expert who consulted for a bank I worked at wanted us to change our URLs from e.g. /products/savings-accounts/apply by reversing them to /apply/savings-accounts/products on the grounds that the most specific thing about the page must be as close to the domain name as possible, according to them. I actually went ahead and changed our CMS to implement this (because I was told to). I'm sure the SEO expert got paid a lot more than I did as a dev. A sad day in my career. I left the company not long after...
Re:CNET is deleting old articles to try to improve its Googl... by ElongatedMusket on Thursday August 10, 2023 @06:12AM (#37074122)
But that's wrong... Do breadcrumbs get larger as you move away from the loaf? No!
Re:CNET is deleting old articles to try to improve its Googl... by oneshtein on Thursday August 10, 2023 @06:23AM (#37074209)
It's just a URL rewrite rule for nginx proxy.
Re:CNET is deleting old articles to try to improve its Googl... by SahAssar on Thursday August 10, 2023 @07:46AM (#37074896)
If you want all your canonical urls to be wrong and every navigation to include a redirect, sure.
Re:CNET is deleting old articles to try to improve its Googl... by raxxorraxor on Thursday August 10, 2023 @09:47AM (#37076107)
Even if that measurably improves the ranking of your website, it still would be a bullshit job. Also cries for side effects, especially on the web.
Re:CNET is deleting old articles to try to improve its Googl... by pembrook on Thursday August 10, 2023 @07:30AM (#37074738)
Unfortunately though, this was likely good advice.

The yandex source code leak revealed that keyword proximity to root domain is a ranking factor. Of course, there’s nearly a thousand factors and “randomize result” is also a factor, but still.

SEO is unfortunately a zero sum game so it makes otherwise silly activities become positive ROI.

Re:CNET is deleting old articles to try to improve its Googl... by tyingq on Thursday August 10, 2023 @10:47PM (#37084525)
That's a bit out there, but Google has mentioned in several different ways that pages and sites have thousands of derived features and attributes they feed into their various ML pipelines.

I assume Google is turning all the site's pages, js, inbound/outbound links, traffic patterns, etc...into large numbers of sometimes obscure datapoints like "does it have a favicon", "is it a unique favicon?", "do people scroll past the initial viewport?", "does it have this known uncommon attribute?".

Maybe those aren't the right guesses, but if a page has thousands of derived features and attributes, maybe they are on the list.

So, some SEO's take the idea that they can identify sites that Google clearly showers with traffic, and try to recreate as close a list of those features/attributes as they can for the site they are being paid to boost.

I agree it's an odd approach, but I also can't prove it's wrong.