News for hackers. Stuff that matters.
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by flohofwoe on Saturday April 08, 2017 @04:55AM (#14066042)
Did you actually give VSCode a try before making such statements? I use both (neo)vim and VSCode (with vim key bindings, sacrilege!) daily. Vim starts up faster (vim is instantly vs about 1 second for VSCode), but once you're in the editor it depends what you do in it. For instance the standard python syntax highlighter in vim is much slower in vim for files with a few hundred to a few thousand lines of code compared to VSCode. Setting up a C++ dev environment and debugger via vim plugins is hit and miss, in VSCode it's just a few seconds to install the extension, and step-debugging is snappier then in 'native tools' (e.g. Xcode).

TL;DR: it's not Electron or Javascript which makes editors slow, it's how the code is written.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by abrkn on Saturday April 08, 2017 @09:23AM (#14066774)
I switched from Atom to VS Code a few weeks ago and find VS Code's performance to be excellent. Haven't used Atom since.
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by swozey on Saturday April 08, 2017 @12:25PM (#14067666)
Were you a heavy Atom plugin user? I'm afraid I'll leave and all of the great plugins won't convert.
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by andrewguenther on Saturday April 08, 2017 @01:52PM (#14068065)
90% of my Atom plugins were built-in for VSCode.

* Terminal built-in

* Sublime style Alt-O for header file switching

* Minimap

* Javascript/Typescript support made a lot of my plugins obsolete

I have language plugins installed for Dockerfiles, protobuf, and a few others, but VSCode felt really complete out-of-the-box. I didn't feel the need to install a ton of plugins to make it useable like I did for Atom.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by F2 on Saturday April 08, 2017 @01:20PM (#14067921)
Which plugins?
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by dolzenko on Saturday April 08, 2017 @11:58AM (#14067523)
Any idea on what exactly VS Code did better to achieve that performance compared with Atom?
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by killercup on Saturday April 08, 2017 @01:43PM (#14068013)
Plugins don't run on the UI thread IIRC
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by Rapzid on Saturday April 08, 2017 @04:46PM (#14068928)
You do. They also have some really smart people(I'm assuming more than one, but at least one has posted on HN about editor optimizations they have made) who seem to pull out all the stops on monaco to produce a very fast "smart" text editor.

Lots of good architecture decisions made. The marriage with TypeScript has also worked out well; it's on fire and coffee is smouldering. This helps with getting people to jump in and contribute.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by tjoff on Saturday April 08, 2017 @05:02AM (#14066067)
"TL;DR: it's not Electron or Javascript which makes editors slow, it's how the code is written."

It would not have been humanly possible to get something like Spotify (we have lists of text and icon-sized images) so resource intensive in any other language.

Now if you want to spend ten (hundred?) times the effort to actually make javascript do something decent I truly hope you get pleasure from that sadistic adventure.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by flohofwoe on Saturday April 08, 2017 @05:13AM (#14066096)
I don't know, writing extensions for VSCode in Typescript is actually quite pleasant. Sure it would be better to have a super-performant, super-small, cross-platform runtime environment. But what would that be? Qt? Java? .NET? Or another roll-your-own UI kit?

PS: I think Spotify should have simply stayed in the browser, the desktop app is redundant.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by tjoff on Saturday April 08, 2017 @05:26AM (#14066131)
Why not Qt? And, since this is Microsoft, why not take this opportunity to develop the backend in .NET core.

But I yes the biggest impact javascript will have on mankind is that noone will ever be bothered to create a good foundation for cross platform applications.

The desktop app is absolutely paramount for Spotify to stay relevant. Not sure if I've seen or heard of anyone using it in the browser (not that that is relevant, but I'd stop using it the very second I can't use it as a standalone app).

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by city41 on Saturday April 08, 2017 @07:16PM (#14069596)
> the biggest impact javascript will have on mankind is that noone will ever be bothered to create a good foundation for cross platform applications

Why isn't Electron a good foundation for cross platform apps? The only possible negative to Electron is that the runtime is gigantic. A decent tradeoff if it means for example the VS Code team can support three OSes and push out rapid updates. I really can't see any downside to this, what am I missing?

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by roblabla on Saturday April 08, 2017 @07:33AM (#14066456)
Because Qt is a huge library. And it's not even really native outside of Linux KDE (though it's the closest we'll get cross-platform wise).
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by mixedCase on Saturday April 08, 2017 @02:48PM (#14068328)
It is huge, but so is Electron.

It's as native as it gets, it imitates native widgets perfectly and allows the designer to easily recreate every element of a particular OS' HIGs with the use of stylesheets and native code.

In before "doesn't look native in my macOS": Because the people writing in cross-plat tools usually don't care about getting every detail right, they just want their app to run well everywhere. But Qt does allow the developer to nail those details without too much effort if he actually cares.

The only problem with Qt is C++.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by roblabla on Saturday April 08, 2017 @08:18PM (#14069794)
Been doing some research about my problems with qt. I found some interesting stuff.

In qt6, there will be "native components" that use the actual underlying OS widgets[0]. They'll be less stylable, but will integrate better with the native look and feel. That should take care of the annoying cross-platform problems.

The other problem left is how big it actually is. As it turns out, it's possible with the LGPL to statically link your program and still comply with the license[1]. Basically, you just need to provide a way to download the .o files so they can be relinked against a different version of Qt.

Thanks to this, it should be possible to create (relatively) lightweight, statically-linked binaries of Qt software.

As far as the C++ is involved... There are qt bindings for just about every other language out there. Just today, bindings for go were released[2].

The future is bright for qt and cross-platform apps.

[0] http://blog.qt.io/blog/2017/02/06/native-look-feel/ [1]: https://news.ycombinator.com/item?id=4302517 [2]: https://news.ycombinator.com/item?id=14068525

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by mixedCase on Monday April 10, 2017 @06:58PM (#14083311)
> As far as the C++ is involved... There are qt bindings for just about every other language out there.

Absolutely not. And the ones that do work are ginormous. The Go bindings are LGPL licensed, meaning they aren't an option for most people until Go plugins are available across the board, at least.

With that said, QML does have plenty of bindings, thankfully. And indeed, Qt's future looks bright, while Gtk's uncertain, so the former is definitely the saner option.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by Johnny_Brahms on Saturday April 08, 2017 @09:27AM (#14066785)
I don't want to be a part of the anti-electron crowd,but for something like a text editor qt will most certainly be smaller than electron.
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by Rapzid on Saturday April 08, 2017 @04:51PM (#14068960)
VS Code didn't start out like you think it did. More akin to life forming in a petri dish vs sitting down to design the Visual Studio replacement.

From what I recall piecing together it came about internally as MS due to monaco and TypeScript. I'm under the impression it was a TypeScript dogfood/dev environment project. It worked out well and they threw it over the fence to the public where it caught fire.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by z3t4 on Saturday April 08, 2017 @01:39PM (#14068003)
What's the user benefit of a (JavaScript) "desktop" (Electron, nw.js) app vs the same app as a web (browser) app , given that the web app has all the features of the desktop app, when the app won't work without the server ? (if you can't run the server yourself)

Benefits for a web app (non-desktop):

  * User don't have to download the "browser" (Electron or nw.js)
  * The user don't need "install" permissions
  * The app can be accessed via an URL
  * The app runs in a VM (a browser) that don't give full (root) access like a Electron/nw.js app does.

btw, I did not know Spotify had a web app. There's only a tiny link to it at the bottom of the page, impossible to find unless you really look for it, witch is probably why no one is using it. P.S I'm now enjoying Spotify via the web app after not using it for years because I don't like "desktop" apps (for the reasons above)
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by yoz-y on Saturday April 08, 2017 @06:53PM (#14069502)
Not à Spotify user but in general: - a native app can have global shortcuts (very important for a media player) - you don't accidentally refresh a native app - native apps don't get purged from memory at random - UI is generally better, keyboard shortcuts are more consistent
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by seangrogg on Saturday April 08, 2017 @06:55PM (#14069517)
As a web developer that has never touched electron I would imagine the benefit is simple: * One API that "just works" * Guaranteed caching of necessary assets * Access to native features (such as simplified access to the file system)

I could totally see all of this on the browser. But then the file system needs to go to the cloud, we need to consider hipster browsers (like k-meleon and omniweb), and we have to deal with the browser determining how our assets are cached and evicted.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by obmelvin on Saturday April 08, 2017 @03:23PM (#14068530)
It is much easier to navigate to the desktop app than to hunt through browser tabs to change the song etc.
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by city41 on Saturday April 08, 2017 @07:17PM (#14069600)
A browser has very limited access to the file system. That's a death knell for a text editor.
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by derefr on Saturday April 08, 2017 @02:48PM (#14068332)
Is Spotify's resource-intensiveness due to things it's actively doing in Javascript (i.e. a lot of procedural code running all the time), or is it due to things it sets up the DOM to do (i.e. a really complicated page that the renderer chokes on)?
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by z3t4 on Saturday April 08, 2017 @05:16AM (#14066103)
use a stepping debugger to see what it does. then remove stuff that dont add value.
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by Razengan on Saturday April 08, 2017 @07:08AM (#14066375)
VS Code uses 13% CPU when idle due to blinking cursor rendering

https://news.ycombinator.com/item?id=13940014

Edit: Ah a bug. I still hate apps that don't use my OS's native UI controls though; even if you can stomach the inconsistencies in look and feel, you DO most definitely lose out on many features that the OS would give you for free.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by flohofwoe on Saturday April 08, 2017 @07:22AM (#14066416)
That was fixed a few days later with the March update: https://github.com/Microsoft/vscode/issues/22900
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by maccard on Saturday April 08, 2017 @07:29AM (#14066440)
That was a bug and can easily happen in native software too.
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by hashhar on Saturday April 08, 2017 @09:15AM (#14066742)
And the biggest point is, it was a Chromium bug. Recently the Chromium team also breaked special keys (Home, PgDown, PgUp, End, Insert etc.) over RDP which caused a lot of issues for people using VSCode.
Re:Visual Studio Code: Shipping One of the Largest Microsoft... by Rapzid on Saturday April 08, 2017 @04:55PM (#14068987)
Wow, how do you even break keys over RDP from inside your app?! Do you have a link; I'm curious about the root cause.

Some here may recall that early VS Code had a but where drag to highlight and menu option highlighting on mouse-over was busted in Virtual Box. So crazy and also a chromium bug.

Re:Visual Studio Code: Shipping One of the Largest Microsoft... by hashhar on Saturday April 08, 2017 @09:02PM (#14069925)
The issue contains a link to the related Chromium bug where I think you can follow up.

https://github.com/Microsoft/vscode/issues/24107

I don't know for a fact that it is RDP but it's the common factor among other people with the same issue.