News for hackers. Stuff that matters.
Re:Nazca – New GUI for the Web by fao_ on Wednesday November 03, 2021 @08:34AM (#29093721)

   <html id="b">
      <head id="c">
           <title id="d">
Ok, those ids are viscerally disgusting and immediately turned off any curiosity I had. My own HTML generator managed to generate meaningful IDs, why can't they?

Generated HTML should look like handwritten HTML for the sake of the poor sod who has to open up the generated files and figure out why they do not work, or debug using web dev tools, IMO.

Re:Nazca – New GUI for the Web by naasking on Wednesday November 03, 2021 @09:59AM (#29094621)
> Ok, those ids are viscerally disgusting and immediately turned off any curiosity I had.

Seems like a totally proportional response to a relatively minor issue that's probably easily fixed if someone created an issue for it.

Re:Nazca – New GUI for the Web by fao_ on Thursday November 04, 2021 @12:07PM (#29108889)
It says a lot about how they approach code generation that makes it a giant waving red flag, for me personally. A rule of code generation is "don't output internal structures unless it's necessary for runtime functioning". This isn't necessary, since no reference is being made to them, which it knows in advance. It tells me that they don't care about the output, which means that if I use it for a long term big project the output is likely to not be human readable, which actually means a whole lot when you are debugging it in-browser!
Re:Nazca – New GUI for the Web by HelloNurse on Wednesday November 03, 2021 @12:34PM (#29096961)
It's a major issue, and not easily fixed unless the design is implausibly suitable (raw IDs in the input imply the absence of any ID management).
Re:Nazca – New GUI for the Web by davidmurdoch on Wednesday November 03, 2021 @09:22AM (#29094217)
These short IDs are likely generated for performance reasons. Meaningful IDs would increase page size quite a bit (not just in the HTML, but in the CSS and JavaScript that references them as well).

Developers sometimes optimize their critical HTML to fit within a tuned initial TCP congestion window to improve performance, so this stuff can make a difference.

Re:Nazca – New GUI for the Web by ape4 on Wednesday November 03, 2021 @09:44AM (#29094446)
In that case, I hope they'll use esoteric Unicode characters for id names to save bytes /s
Re:Nazca – New GUI for the Web by Narishma on Wednesday November 03, 2021 @11:04AM (#29095695)
Those will to take more bytes than plain ASCII characters.
Re:Nazca – New GUI for the Web by jcelerier on Wednesday November 03, 2021 @02:16PM (#29098396)
Don't both gecko and blink store those as UTF-16 anyways ? if so, "à" would take less storage than "aaa" when all of [a-zA-Z0-9]+ have been covered
Re:Nazca – New GUI for the Web by zamadatix on Wednesday November 03, 2021 @04:37PM (#29099948)
In decoded memory perhaps, the data format in bytes over the network is going to be whatever the server/page says it is encoded in (utf8 overwhelmingly these days).
Re:Nazca – New GUI for the Web by michaelmior on Wednesday November 03, 2021 @11:32AM (#29096071)
These could of course be generated as longer IDs during development and shortened for production.
Re:Nazca – New GUI for the Web by spoiler on Wednesday November 03, 2021 @09:20AM (#29094194)
I don't understand why they didn't do something like this instead:

    div.foo#thing {
      text: "Foo"
    }
Generates this:

    <div class="foo" id="thing">Foo</div>
I realise that there's issues with css name collisions, but there's different ways that can be resolved by the compiler.
Re:Nazca – New GUI for the Web by rowanseymour on Wednesday November 03, 2021 @09:36AM (#29094326)
Was thinking the same thing. Or just copy HAML which would be...

   %div.foo#thing
     Foo
Re:Nazca – New GUI for the Web by cabalamat on Wednesday November 03, 2021 @09:28AM (#29094265)
That makes sense -- only give a tag an id if it needs one. It only needs one if ti's being referred to somewhere, and when that happens the user can give it a name, such as "thing" in this example.
Re:Nazca – New GUI for the Web by fao_ on Thursday November 04, 2021 @12:06PM (#29108880)
See, that's exactly what I thought when I said about this.

I mean, worst case, give everything an id but don't _output_ it!

Re:Nazca – New GUI for the Web by LastMuel on Wednesday November 03, 2021 @11:18AM (#29095896)
This is how JADE/PUG handled it. And, for anyone that's used css, querySelector or jQuery, it seems quite natural.

I also wonder why the author didn't pick up these standard methodologies and continue from there.