Earlier quoted context omitted.
> and now we're making traditional UI dev like web It's been like that on Windows since 2006 with XAML. In fact, if you squint at typical JSX, it looks like XAML. Disclosure: I work at Microsoft.
Or across multi-platforms with XULRunner from 2006 to 2015.
Proton Native – React Native for the desktop
31–40 of 295 posts
Re: Proton Native – React Native for the desktop
#32Earlier quoted context omitted.
You can “skip” the whole “closing braces” stuff, then it’s definitely shorter. I’m talking about this: ); } }
No, you can’t “skip” them. If you skip them, the code is broken. The lines may well be noise, and arguably that’s even worse, but you certainly can’t skip them – counting or otherwise.
import React, { Component, createElement as e } from 'react';
import { render, Window, App, Button } from 'proton-native';
function Example() {
return (
e(app, {},
e(Window, {title:"Example", size:{{w: 300, h: 300}}, menuBar={false}},
e(Button, {stretch=false}, onClick={() => console.log('Hello)}, 'Button')
)
)
);
}
render();
If you really hate the brackets and parens you could certainly use a dialect of JS that doesn't have them, and you could cut it down to like half the length of the Qt example.But this whole discussion is silly. "Shortness" in code terms has much more to do with the number and complexity of statements, not LOC or characters. The JSX in there adds "noise" and characters, but the whole purpose is to simplify understanding code and make it readable. It's not adding any fundamental length.
The Proton example is doing a bit less than the Qt example, and for me that's a much more useful definition of shorter.
Re: Proton Native – React Native for the desktop
#33This is super cool. Are there any demonstrations comparing performance between electron and your app?
Sidenote as for why a UI library would wrap another UI wrapping library, Gtk is what is considered "native" on Gnome based distros.
So weight-wise, it's basically comes at the cost of native node module which is not bad compared to Electron's crazy IPC bridge back and forth communication nonsense.
Re: Proton Native – React Native for the desktop
#34> It is not only shorter, it is also easier to read and to edit, and can easily utilize the power of the state. Easier to read and edit is obviously subjective, but shorter is not and that front page is just straight up lying. The Qt example is most definitely shorter. What am I missing?
Hey. I'm the author. It's hard to find a simple example that everyone understands but can show capabilities. If you're used to Qt then you're going to like Qt better, but I mainly developed this for people who want to use React. You are obviously free to use whatever you want. But if you have any suggestions let me know!
Re: Proton Native – React Native for the desktop
#35Haven't we moved past writing UIs in code about twenty years ago? I see your code samples, and all they look like is an improved version of the code UI creation we had in OWL, MFC, and other UI frameworks on other platforms.
Starting about 1995 we had a better way: form designers that streamed objects (note: not even auto-generated versions of code, which is not much better, but object streaming.) Your UI is then designed and manipulated largely as a graphical UI -- that's what it is -- and manually written code is reduced to tweaks or state changes.
For example: Delphi (the prototype of all modern UI frameworks); C++Builder; others. WPF may count although the generated text is ugly as :) - but it carries the concept. A NIB file on macOS. You get the idea.
Re: Proton Native – React Native for the desktop
#36Is this created and maintained by a single developer (kusti8?), community, or corporation?
I'm one highschooler with not enough time. Ideally this would come from someone who can maintain this full-time like a corporation, but so far no one has done it.
Re: Proton Native – React Native for the desktop
#37Is this created and maintained by a single developer (kusti8?), community, or corporation?
I'm one highschooler with not enough time. Ideally this would come from someone who can maintain this full-time like a corporation, but so far no one has done it.
Re: Proton Native – React Native for the desktop
#38> You can create a GUI using something like Qt, but the code to make it is messy and unorganized. Having made a very large GUI myself, it gets very cumbersome to manage all of that. Haven't we moved past writing UIs in code about twenty years ago? I see your code samples, and all they look like is an improved version of the code UI creation we had in OWL, MFC, and other UI frameworks on other platforms. Starting abou…
Here's an interesting discussion of Delphi (2013): https://news.ycombinator.com/item?id=7613543
Re: Proton Native – React Native for the desktop
#39> You can create a GUI using something like Qt, but the code to make it is messy and unorganized. Having made a very large GUI myself, it gets very cumbersome to manage all of that. Haven't we moved past writing UIs in code about twenty years ago? I see your code samples, and all they look like is an improved version of the code UI creation we had in OWL, MFC, and other UI frameworks on other platforms. Starting abou…
Using a UI to build UI is slow and clunky. There is no "moving past" it. That's a bad way to develop stuff. We don't do it with HTML, do we? No.