News for hackers. Stuff that matters.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by camgunz on Friday March 24, 2017 @04:07AM (#13947410)
The answer to all this is: "use Qt".

"But camgunz, I only know JavaScript"

That's cool! Look into QML.

"But camgunz, I only know X"

That's cool too! Qt4 has a truly ludicrous number of language bindings: https://en.wikipedia.org/wiki/List_of_language_bindings_for_.... Qt5 has a fair number too: https://wiki.qt.io/Language_Bindings.

"But camgunz, I need an embedded browser"

I agree, separate windows are for savages. Qt has you covered with Qt WebBrowser.

"I need a native look and feel across all platforms"

Well, that's a pipe dream. BUT, you can get closer with Qt than anything else. Google for some screenshots.

"I need a bananas style but I don't want to write any code"

Qt supports CSS-like stylesheets!

---

The web isn't a good application platform. Sure we could (and have been) spend billions of engineering hours and years to get it up to speed with exactly what we have now, but that's obviously a bad idea. We can figure out zero-install and sandboxing, but we just don't need to shoehorn everything into JS, weird APIs like localstorage and webrtc, and the DOM. We just don't need to.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by kasabali on Friday March 24, 2017 @06:19AM (#13947873)
> use Qt

It has only been few years since a bug in file copy animation in systray that caused 100% cpu utilization in KDE Plasma 4 has been fixed. It wasnt the first bug in this regard nor it was the last one (IIRC. I saw a similar one in Plasma 5 too, though I didn't check it). Qt is old but cant say it is efficient or optimized. Qt5 programs that use classical QtWidgets have significantly more memory consumption than the programs written in other toolkits, and the newfangled Qt quick widgets is a fucking disaster as can be seen from the aforementioned bug they couldnt even get a simple screen animation straight, so not at all different than Electron ( only few years ahead of them)

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by camgunz on Friday March 24, 2017 @07:48PM (#13953182)
I'm not arguing Qt is perfect; no software is. But you can't argue that a platform built on JS and the DOM will ever perform as well as a native toolkit unless the native implementor makes unbelievable mistakes, or we put a vastly disproportionate amount of work into the JS platform. If you really have a thing against Qt, GTK has a bunch of bindings too (including JS!); go wild.

Or to put it another way, if you can switch your stack and get a "few years" of progress, that actually sounds amazing.

(Plus, and this applies to Electron too, you're free to fix bugs in open source dependencies that impact your project).

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by Kamgunz on Friday March 24, 2017 @05:23AM (#13947651)
In what do you prefer to write cross platform apps? Is there a more productive platform?

The thing with the web, is that it's very easy for those familiar with it to try and shove into everywhere, I do it too.

The amount of code that does things that are useful that one can just steal for his project is very high, with all the fiddles and bins and even more importantly, very accessible and, sometimes, when the gui code, it looks really good too, so people use Electron.

BTW, they use Electron because they run the same editor in their Azure platform, as an online editor for files in servers, so knowing this, I'd say picking Electron is a reasonable choice.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by camgunz on Friday March 24, 2017 @07:39PM (#13953142)
If I need to throw together a GUI app I usually use Python and PySide. I've had co-workers use Qt Creator and they built way better and better looking apps than I did. There are tons of Qt examples and the docs are pretty good.

Electron is almost never a reasonable choice. As a platform it's one of the slowest and most limited. You have a choice of a single, pretty bad language. It only works on a few platforms, and in practice it's limited to even fewer because of its poor efficiency.

I'm sympathetic to devs that don't want to venture outside of JavaScript, but in the same way we shouldn't pretend that C is a great language to write web backends in, we shouldn't pretend JavaScript is a good choice for anything but the most basic of web scripting. Writing apps in JS, you're going to experience poor performance, high memory usage, a lack of portability, difficulty scaling to a large codebase, and problems with concurrency.

You can usually tell when devs choose the wrong tool. If you write a DB in Java, you'll have problems with the GC impacting your latency (Cassandra). If you build a desktop app in JS you'll have weird problems with resource usage (Atom). If you build a web app in C it'll take 4 times as long, be unstable, and have weird restrictions. We should recognize that every tool has its use, and stop wildly spending resources making one tool passable at everything.

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by demarq on Friday March 24, 2017 @05:40AM (#13947714)
but but camgunz isn't the commercial license like a new house, three kidneys, and your cat?

3,540.00 USD to be exact :P ... each year to be exact :P

Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by jhasse on Friday March 24, 2017 @08:30AM (#13948433)
You don't need the commercial license to use Qt commercially.
Re:VS Code uses 13% CPU when idle due to blinking cursor ren... by camgunz on Friday March 24, 2017 @07:11PM (#13952989)
Just don't link your app statically.