Live data from Hacker News

A Broken Heart

allenpike.com

41–50 of 53 posts

Re: A Broken Heart

#41
post #32

Earlier quoted context omitted.

But it is not really XML like syntax, is it? It is still a string, even if a template string or whatever it is called, no? That still leaves the door open for XSS. A good (proper?) (e?)DSL would have the things that make the DOM as keywords in the language, and then we could ensure, that things which should merely be a text, are really only rendered as text, not injected DOM nodes. And the next failure is, that this…

> It is still a string, even if a template string or whatever it is called, no? No. > That still leaves the door open for XSS. The door for that in React is called `dangerouslySetInnerHTML`, but it's extremely rarely used. > jsx needs to rename HTML attributes, because of overlap with JS keywords like "class" That's not really inherent to JSX, just React's use of it. SolidJS, for example, uses `class` instead. But in…

https://github.com/jquery/jquery/blob/df16f7360d4db41de64589...

Re: A Broken Heart

#42
post #38

Mostly read like a normal article if you skip over the parts about using agents, which I did. There could not possibly be a single thing in the world more boring than listening to someone describe using an AI agent. Might as well describe in arduous detail how you use a gas pump or a grocery store checkout.

Maybe consider that other people are not as au fait with AI. There are plenty of people learning to use AI and this article helps them. A reasonable amount of repetition of "things you should know" is good. The article is well written because you could skip the parts you knew, and learn from the parts you were unfamiliar with.

I think the problem is that the public is often being encouraged to use AI in ways that are not productive, or are misleading... At least at this point in time.

Re: A Broken Heart

#43

> At that point, I reached for an age-old tool that has gotten more useful in the modern age: binary search. That is, you explain the symptom to your coding agent. Then you have it repeatedly remove stuff from your code that might be causing the problem Can someone give me some high level pointers on how to setup this scaffolding?

When I read the first sentence, I expected the author to use `git bisect`. However, what the author seems to have done is used a prompt with claude that probably looked something like this: "Some piece of code is causing the page to load very slowly. To debug this, I'd like to use binary search, where we keep commenting/uncommenting 50% of the remaining code, and then I manually check if the page is still very slow.…

> When I read the first sentence, I expected the author to use `git bisect`.

Exactly the same. I'd first (or have Claude or whatever) use git bisect. Then I'd focus on the commit that is problematic. And why not have the "binary" detective work TFA talks about.

That said... 1600 ms per heart emoji. Unicode strikes again, combined with a fallback to SVG because that font couldn't color a heart emoji. What a rube-goldberg of a kitchen sink world we live in. It's just sad really.

Honestly beam me back up to the late 80s or early 90s: give me a car with pop up headlights, a Hi-Fi stereo with a CD player, an arcade cab, a Commodore Amiga and my ASCII charset. Life was better.

P.S: nice TFA btw, I enjoyed it

Re: A Broken Heart

#44
post #15

> And despite being the least-bad approach for web frontends today, the React ecosystem... As if anyone has seriously tried anything other than the "reactive UI hacked together with callbacks or proxies, with weird XML-like syntax in the JS code" paradigm for the last 10 years. At this point I just have to conclude that anyone who believes this stuff is good is either too indoctrinated into this workflow or just lack…

I'd give people the benefit of the doubt. Personally, having built UI with Win32, WinForms, VisualBasic, Cocoa/Interface Builder, Qt, Tcl/Tk, XSLT, vanilla HTML/JS, jQuery, Backbone, Ember, Knockout, Bootstrap, MooTools, YUI, ExtJS, Svelte, Web Components, and React (including Preact, SolidJS…)… I'll happily choose the React approach. The only other one I would even describe as "good" was Qt. I also don't get why "XM…

Will I ever wake up in a world where Vue is not slept on?

Re: A Broken Heart

#45
post #15

Earlier quoted context omitted.

I'd give people the benefit of the doubt. Personally, having built UI with Win32, WinForms, VisualBasic, Cocoa/Interface Builder, Qt, Tcl/Tk, XSLT, vanilla HTML/JS, jQuery, Backbone, Ember, Knockout, Bootstrap, MooTools, YUI, ExtJS, Svelte, Web Components, and React (including Preact, SolidJS…)… I'll happily choose the React approach. The only other one I would even describe as "good" was Qt. I also don't get why "XM…

Will I ever wake up in a world where Vue is not slept on?

I would much rather use Vue than React too. That said, from a bird's eye view, I would say they're siblings. In a way I would say that Vue inherits the "react approach", and does it much (much) better, but its also not a fundamentally different approach.

Re: A Broken Heart

#46

Mostly read like a normal article if you skip over the parts about using agents, which I did. There could not possibly be a single thing in the world more boring than listening to someone describe using an AI agent. Might as well describe in arduous detail how you use a gas pump or a grocery store checkout.

Coding agent is a category of tools like, say, unit tests. If these days someone attached some random bits about how unit tests helped and how they didn't, everyone would directly agree that it does not help the main point of the article. However, because how relatively new these things are and how wide the spectrum of opinions are, and how it feels like "cheating", many feel the duty to also report the usage of them, even when talking about something completely different. I remember the times when every web developer was talking about how firebug helped them defeat a very elusive bug.

TL;DR: It will pass as AI agents become more boring (a good thing) and there's a standard workflow.

Re: A Broken Heart

#47
post #19

Maybe off topic, but I couldn't help thinking that "we need to show a heart icon" -> "let's use a heart emoji because it's easy" -> "let's use a specific emoji font for consistency across platforms" -> "let's import it from Google Fonts every time" seems like a problematic developer mindset. A better heuristic is always keep in mind not only developer efficiency, but also program efficiency. I'm not saying optimize e…

Not OT at all. Emojis everywere are ridiculous. And coding agents love them! They put emojis in Python log lines which inevitably break the console, and of course in web pages. Logs don't need emojis. Not sure if anything does.

I have a very vague idea about how consoles work (I mean we're talking about terminals, like, terminal emulators right?), so probably that's why I don't understand how the usage of emojis break one.

I use a lot of different OSs, and none of the default terminals seem to have any problems with emojis, even cmd on windows (which isn't even default anymore?).

So detaching from the main theme of if the use of emojis is a good idea from the start, may I get more details on how your console breaks? :)

Re: A Broken Heart

#48
post #38

Earlier quoted context omitted.

Maybe consider that other people are not as au fait with AI. There are plenty of people learning to use AI and this article helps them. A reasonable amount of repetition of "things you should know" is good. The article is well written because you could skip the parts you knew, and learn from the parts you were unfamiliar with.

I think the problem is that the public is often being encouraged to use AI in ways that are not productive, or are misleading... At least at this point in time.

Nothing to do with the public: how is your comment relevant here?

The article explains using AI beneficially for a professional task.

Re: A Broken Heart

#49
post #48

Earlier quoted context omitted.

I think the problem is that the public is often being encouraged to use AI in ways that are not productive, or are misleading... At least at this point in time.

Nothing to do with the public: how is your comment relevant here? The article explains using AI beneficially for a professional task.

You assume professionals are not members of the public.

Re: A Broken Heart

#50
post #32

Earlier quoted context omitted.

But it is not really XML like syntax, is it? It is still a string, even if a template string or whatever it is called, no? That still leaves the door open for XSS. A good (proper?) (e?)DSL would have the things that make the DOM as keywords in the language, and then we could ensure, that things which should merely be a text, are really only rendered as text, not injected DOM nodes. And the next failure is, that this…

> It is still a string, even if a template string or whatever it is called, no? No. > That still leaves the door open for XSS. The door for that in React is called `dangerouslySetInnerHTML`, but it's extremely rarely used. > jsx needs to rename HTML attributes, because of overlap with JS keywords like "class" That's not really inherent to JSX, just React's use of it. SolidJS, for example, uses `class` instead. But in…

Ah, seems a few things either changed in the meantime, while I have not dealt with JSX, or I remembered it wrongly. I thought the syntax was something like the following, which would be a special kind of string:

    return `
        

here some stuff looking almost like HTML, but not really

`
> On the contrary, I'd argue it has way more context. It knows, and will warn you, if you try to do any DOM element nesting that the HTML spec forbids, for example.

I was relating to naming it "className" instead of "class". If it was aware, it would know, that "class" is safe to use here, because it is inside some JSX syntax, not a class definition.

> You are literally describing the output of JSX. Glad you like it ;)

But that's the thing: I don't want to pattern match on the _output_ of JSX. I want to pattern match on the stuff while I am constructing it, shaping it, before I generate any HTML output. But perhaps, if you can show an example, I would know better what you mean. What I mean is something along the lines of:

    expr = heading

foo

return match expr { ...any

...word

: word; _: "no word"; }
The fragment "element" seems unnecessary in general. Just make

    return (
        

)
return a list of 3 items, ready to be spliced into another template with some syntax:

    const my_result_list = that_other_function();
    return @my_result_list;
which results in a div with 3 paragraphs. Here I am using "@" as example, but probably in JS land one would use "...". At no point do I need some or so.
Post reply on HN