News for hackers. Stuff that matters.
Re:React and D3.js by sfvisser on Tuesday March 30, 2021 @02:03AM (#26631609)
All of the above can be done with a super clean declarative interface using functions/methods without JSX.

JSX vs normal JS code has nothing to do with imperative vs declarative.

Re:React and D3.js by Chris_Newton on Tuesday March 30, 2021 @05:23AM (#26632590)
As Vinnl suggested, I interpreted dvt’s comment as disliking the declarative style rather than imperative. If the comment was instead intended just to object to the JSX/SVG syntax, then the objection seems rather superficial. It’s just an entity type and some named parameters, plus a bit of punctuation that will be immediately familiar to anyone working in front-end web development. If the alternative in dvt’s comment was meant to be a declarative specification of a circle and not an imperative call to draw one, then the biggest difference between

    <circle cx="150" cy="77" r="40" />
and

    draw.circle(150, 77, 40)
is that the former uses named parameters and the latter does not, and I suspect a lot of us would consider the former to be the more explicit, less error-prone choice in that case.
Re:React and D3.js by sfvisser on Tuesday March 30, 2021 @07:18AM (#26633264)
Yeah, I think I misinterpreted the intent of your answer, because of a different read of dvt's comment you replied to.
Re:React and D3.js by Vinnl on Tuesday March 30, 2021 @02:17AM (#26631669)
They weren't arguing JSX vs no JSX, they were describing arguments for using React ('s declarative interface) over D3's imperative approach, which GP expressed surprise about.
Re:React and D3.js by sfvisser on Tuesday March 30, 2021 @02:23AM (#26631698)
Top comment was clearly complaining about the syntax as an argument against a declarative approach.
Re:React and D3.js by Vinnl on Tuesday March 30, 2021 @04:11AM (#26632220)
Looks like I and the person you're replying to interpreted "despise (..) React's clunky long-form declarative style" differently from the way you did, then.