←back to thread

331 points willm | 3 comments | | HN request time: 0.469s | source
Show context
traverseda ◴[] No.41216311[source]
My big complaint with textual is that it wants to be react. I can see why it would want to be react, that's a very popular framework that a lot of people are already familiar with, but I don't think it's actually a good way of doing user interfaces. But the basic reactive design is a well trod road, and basing your system design on something that's known to work is a great way to derisk the project. Sure, we'll draw some heavy inspiration from react.

Alright, so we're using some bastardization of CSS as well? That might be going a little bit too far. The react model already breaks the idea of CSS in a lot of ways, preferring standardized components. Sure, developers still use CSS to customize components, but I view that more as a side effect of how react evolved rather than as a justifiable architectural choice. But as long as you don't have to use CSS I suppose it's fine.

Last I tried it, you do have to use CSS. There are no good standard components, so you will be making your own, and instead of having components be one nice self encapsulated Python class the standard docs use things like list components and then style them with an external style sheet.

For those reasons textual just isn't for me yet. In python there should be one, and preferably only one, obvious way to do something. By mirroring react so closely they're also mirroring what I see as the JavaScript communities biggest vice.

replies(5): >>41216510 #>>41217186 #>>41218287 #>>41218552 #>>41218858 #
itronitron ◴[] No.41216510[source]
Can you elaborate on how textual wants to be like the react framework? I don't see React (or react) mentioned anywhere in the article.
replies(1): >>41216720 #
traverseda ◴[] No.41216720[source]
They have a virtual DoM https://textual.textualize.io/api/dom_node/

This includes a lot of what you'd expect from HTML, classes, CSS, etc.

They have reactive attributes https://textual.textualize.io/guide/reactivity/

It has HTML (or at least a DoM), css, and you design widgets the same way.

replies(2): >>41217056 #>>41218052 #
willm ◴[] No.41217056[source]
> They have a virtual DoM https://textual.textualize.io/api/dom_node/

It's not a virtual DOM. It's not technically even a DOM, because there is no Document. The name has stuck, which is why we went with that. Technically, its a tree. One of the most common data structures used to represent a UI, and predates React by decades.

> This includes a lot of what you'd expect from HTML, classes, CSS, etc.

It has CSS in common with HTML. classes are pretty much required for CSS. That's not "a lot". But why shouldn't a UI framework borrow concepts that work for, you know, User Interfaces?

> They have reactive attributes https://textual.textualize.io/guide/reactivity/

Reactives attributes are very useful concept to manage UI complexity. And again, not exclusive to React.

replies(1): >>41217742 #
kragen ◴[] No.41217742[source]
this sounds like you're elaborating on why textual wants to be react rather than rebutting the assertion that textual wants to be react. but nobody was saying that wanting to be react was unreasonable

hmm, well, i guess traverseda was sort of saying that react was bad. i doubt that's a widely shared opinion tho

replies(2): >>41217900 #>>41218026 #
1. willm ◴[] No.41217900[source]
I only meant to rebut the factual claims made in the previous comment. Textual is inspired by web development (and I've always described it as such), but "want to be react" is way overblown. It has things in common with React, but equally many other web and UI frameworks. Heck you could say that Textual wants to be JQuery, and that would be just as apt...
replies(2): >>41218021 #>>41218230 #
2. kragen ◴[] No.41218021[source]
maybe it depends on what the implicit reference class is. if you're comparing it to react, angular, ncurses, s-lang, jquery, vue.js, and php, then sure, things like html and css are hardly react-specific. if you're comparing it to ncurses, s-lang, win32, mfc, the vic in the commodore 64, winforms, whiptail, dear imgui, the tms9918 used in the msx, emacs lisp markers and text properties, gtk, the nintendo ppu, opengl and glut, xlib, xt, tcl/tk, ansi.sys, naplps, ripscrip, turbovision, direct access menu.exe, and react, it's basically exactly the same thing as react

jesus, i sure have built shitty user interfaces on a lot of platforms

3. yunohn ◴[] No.41218230[source]
How is it more like jQuery than React?