News for hackers. Stuff that matters.
Re:Qt for WebAssembly by pjmlp on Tuesday June 19, 2018 @03:51PM (#17349777)
CSS3 hackary better than native frameworks?! Not really.

Maybe when I get to see Blend implemented with WebComponents.

Re:Qt for WebAssembly by dimgl on Tuesday June 19, 2018 @03:59PM (#17349857)
Hackery*, and I'm not sure why the hate towards CSS3. With a few lines of code I can build a pretty good looking responsive UI that doesn't take hours to polish.
Re:Qt for WebAssembly by sireat on Wednesday June 20, 2018 @07:27AM (#17354328)
I'd give my left toe to learn to do this in a few lines of code in HTML/CSS3.

Desktop centric UI toolkits provide a set of widgets which lets me build up a UI in a predictable way that respects my sanity.

Windows Forms, WPF, Qt, vxWidgets, tkinter, Java AWT, SWT etc they all have warts but ALL of them feel faster than building UI for the web.

The problem with web is that there are no consistent set of widgets.

Let's take a stupid date picker. A year ago for a project I thought I'd use the HTML5 <input type="date"/> way no Javascript needed!

Sadly I couldn't figure out a way to keep the calendar in an always on state so had to resort to jQuery datepicker. So jQuery widgets was an attempt to do what desktop UI does but now that is no longer in vogue.

Today on the web there is no consistency, there is no agreed upon toolkit. How many different approaches to widgets does React have?

Ideally you would be able to import a web component into your project and use it without worrying about any abstractions leaking.

Re:Qt for WebAssembly by pjmlp on Tuesday June 19, 2018 @04:20PM (#17349993)
Yeah, when running on a specific browser version targeting a single OS.
Re:Qt for WebAssembly by pcwalton on Tuesday June 19, 2018 @07:30PM (#17351153)
That's hardly true when it comes to CSS3 stuff that's been around for a decade.

Moreover, it's unfair to insist on portability when comparing native vs. Web without doing the same on the native side.

Re:Qt for WebAssembly by pjmlp on Wednesday June 20, 2018 @02:02AM (#17352950)
Only if the only browsers one cares about are latest version of Chrome and Safari.

There plenty of deployment scenarios with other kinds of browsers.

Of course it is fair, using something like Qt, wxWidgets, or even roll our own was never as complicated to get pixel perfect UI across OSes.

Re:Qt for WebAssembly by crzwdjk on Thursday June 21, 2018 @12:37PM (#17366698)
Is pixel perfect UI really what you even want these days? With high-DPI screens and screen scaling being a thing, not everyone's pixels are the same. And that's not even talking about accessibility for people with low vision who want text to be big and readable.
Re:Qt for WebAssembly by littlestymaar on Tuesday June 19, 2018 @08:31PM (#17351442)
«native frameworks» => if you want a true native framework, you need one specific development per platform. Or more realistically, you end up developing for Windows only, unless you target a specific niche where MacOS is somewhat relevant, and never Linux.

Or you use a cross-plateform (not so native then) UI toolkit, like Qt. You have a sub-part UI experience and you still need to write C++. Why would you do that ? (And that's why the vast majority of software isn't developed this way).

CSS and JavaScript have quirks, but I mean, we're talking about C++ as an alternative …

Re:Qt for WebAssembly by pjmlp on Wednesday June 20, 2018 @01:58AM (#17352941)
No, you develop like we did on the 16 bit days.

Either do a new one for platform, which was the case when Assembly ruled.

Or make a proper application architecture suited to the applications being done in-house, that wraps the native APIs into general ones.

C++ is strongly typed and compiles to native code, a much saner alternative than "anything goes JS".

And CSS + JS are miles away what something like VB, Delphi or Smalltalk allowed in the early 90's.

Yes I know they weren't responsive and whatever.

There were layout managers already available, it was just a matter of actually using them.

Vast majority isn't developed that way, because it is cheaper to pay to young inexperience JS developers that are re-inventing the idioms of the 90's desktop UIs[0], than experienced C++ developers aware of what actually takes to make a good UI/UX.

[0] - https://bitquabit.com/post/the-more-things-change/

Re:Qt for WebAssembly by littlestymaar on Wednesday June 20, 2018 @04:20AM (#17353499)
> Vast majority isn't developed that way, because it is cheaper to pay to young inexperience JS developers […], than experienced C++ developers

I think you just nailed the essential point: in 2010+, the young and cheap developers are JavaScript ones, and not C++ ones. Maybe that tells something about which one is the most accessible, don't you think?

Re:Qt for WebAssembly by martin_ky on Wednesday June 20, 2018 @03:28PM (#17358857)
I think, this goes way beyond just companies preferring to hire cheaper developers and beyond software engineering as such. There is a larger, universal force at play here. Examples of poorly designed, engineered and built things are everywhere in the world. It is seemingly cheaper to do it this way. But what may be saved upfront on production quality, is usually spent many times over on usage, maintenance and subsequent rebuilding, making the total cost higher.

For example, a road built with cheaper materials will break and need to be patched more often. A poorly engineered application will be slower, consume more CPU power, more data bandwidth and require more storage space, will be buggier and waste more users' time.

With only a very basic understanding of economic theory, I would imagine that market forces at scale would optimize these inefficiencies and ultimately work to reduce total costs. Perhaps this unconscious, natural process would even work, were we not consciously optimizing against it on the wrong variables, such as the next quarter's profits.

Re:Qt for WebAssembly by pjmlp on Wednesday June 20, 2018 @04:27AM (#17353529)
I can also go to craigslist and get someone that does repairs on the side, or pay for someone that costs twice as much but actually does the job only once.
Re:Qt for WebAssembly by hajile on Wednesday June 20, 2018 @05:03PM (#17359753)
> C++ is strongly typed and compiles to native code, a much saner alternative than "anything goes JS".

C++ (though statically typed) is weakly typed.

Re:Qt for WebAssembly by pjmlp on Thursday June 21, 2018 @08:30AM (#17364471)
C++ is not C, if that is what you are getting at.
Re:Qt for WebAssembly by hajile on Thursday June 21, 2018 @11:08AM (#17365827)
C++ is not C, but is still weakly typed. I think even Rust is weakly typed in unsafe mode (I'm open to correction about that). This makes sense when you think about the CPU which is weakly typed and dynamically typed (it's also dynamically scoped unlike all the modern lexically scoped languages running on top of it).
Re:Qt for WebAssembly by steveklabnik on Thursday June 21, 2018 @01:46PM (#17367493)
"weakly typed" is not well-defined, however, I don't think that Rust is, even in unsafe. If you can provide a C or C++ example, I can tell you what that looks like in Rust.
Re:Qt for WebAssembly by pseudalopex on Tuesday June 19, 2018 @10:53PM (#17352195)
Qt has bindings for many languages, including JavaScript. It's capable of delivering experiences much closer to native than any Electron app I've ever seen. The catch is that a minimum-effort Electron app feels like a web page but a minimum-effort Qt app feels like a bad native app. There are also frameworks like wxWidgets that use actual native controls.
Re:Qt for WebAssembly by htor on Tuesday June 19, 2018 @05:26PM (#17350402)
...and what do you think is used to style webcomponents?
Re:Qt for WebAssembly by pjmlp on Tuesday June 19, 2018 @05:49PM (#17350545)
Lots of CSS hacks to make them work properly across all browser versions and OSes.
Re:Qt for WebAssembly by littlestymaar on Tuesday June 19, 2018 @08:38PM (#17351478)
What year do you live in? 2010? The most wanted features from CSS3 have been supported everywhere for years!

Look at the support for (flexbox)[https://caniuse.com/#search=flexbox] for instance.

Re:Qt for WebAssembly by pjmlp on Wednesday June 20, 2018 @04:16AM (#17353479)
In the year where not all deployment targets are using the latest Chrome and Safari.

Where there are devices beyond computers and smart phones with browsers on them, the majority of them without any kind of update system in place and based in some kind of browser implementation.

Re:Qt for WebAssembly by hesarenu on Wednesday June 20, 2018 @04:03AM (#17353435)
You are not familiar with web are you?
Re:Qt for WebAssembly by pjmlp on Wednesday June 20, 2018 @04:13AM (#17353470)
Doing web projects since 1997, coding across multiple platforms since 1986.
Re:Qt for WebAssembly by hesarenu on Wednesday June 20, 2018 @04:52AM (#17353632)
So not familiar with modern development? Since you don't need much CSS hacks now.
Re:Qt for WebAssembly by pjmlp on Wednesday June 20, 2018 @05:37AM (#17353811)
So not familiar with the fact that not everyone runs the very latest Chrome or Safari on their desktop computers, and there are other kind of devices on the field?
Re:Qt for WebAssembly by imtringued on Wednesday June 20, 2018 @10:47AM (#17355876)
That's too generous. Even the things that work properly on every browser are usually hacks because HTML and CSS were made for documents rather than applications.