News for hackers. Stuff that matters.
Re:Disassembling Sublime Text by Zaheer on Sunday December 04, 2016 @02:30PM (#13101345)
I recently installed VSCode just to try and was pleasantly surprised. For Sublime users there's a plugin to remap all keyboard shortcuts to Sublime ones (when available ex. multi-line edit isn't just yet). VSCode is getting updates on a monthly basis it seems and I have no doubt it'll catch up to Sublime in the next 6-12 months.
Re:Disassembling Sublime Text by Jdam on Sunday December 04, 2016 @04:05PM (#13101767)
But it's very slow in comparison to ST. For sure related to the Electron framework beneath VSCode. (Yes, I'm that type of person that opens 25MB logfiles with such an editor)
Re:Disassembling Sublime Text by garaetjjte on Monday December 05, 2016 @08:02AM (#13105066)
Sublime isn't fast either. For opening gigantic log files less works good. (not editor though, but why edit log files?
Re:Disassembling Sublime Text by trishume on Sunday December 04, 2016 @03:58PM (#13101737)
I definitely envy VSCode's nice debugging interface. I wish there was a standalone debugging app that integrated with Sublime (and other editors) to provide multi-language debugging like VSCode.

For now, Sublime's plugin ecosystem is still better. And Sublime has more polish on a ton of little things.

It will never catch up to Sublime on performance though. Not only because it is written in JS but also because a ton of the work that went into Sublime was writing custom systems for fast text editing.

Re:Disassembling Sublime Text by freyir on Sunday December 04, 2016 @04:20PM (#13101840)
> It will never catch up to Sublime...because a ton of the work that went into Sublime was writing custom systems for fast text editing.

Why couldn't the creators of VSCode and the open source community catch up to Sublime's systems for fast text editing -- especially considering Sublime was written by a single developer who seems to not work continuously on the project.

The JS issue is another story.

Re:Disassembling Sublime Text by trishume on Sunday December 04, 2016 @04:39PM (#13101906)
In theory they could do some of them, but they'd have to be done in asm.js or WebAssembly. Both for speed, and because otherwise the lack of statically sized structs will kill you on memory overhead.

For other things (like a very nice minimap that actually renders based on the shape of characters) you are limited by what the DOM is capable of in terms of custom rendering. You can get around this by doing what https://www.figma.com/ does and rendering everything with WebGL from asm.js, but that would be a total rewrite and you lose all advantages of using Electron and you might as well just use C++ and OpenGL directly, and at that point you are just cloning Sublime.

Also Jon Skinner is a performance-obsessed wizard who does things like write a custom regex engine just to make the fastest syntax highlighting engine even faster. Whereas the VSCode team is the kind of team that wrote a text editor in JS. I will hand it to them that they did pretty well at optimizing and VSCode is the fastest JS-based text editor, but they don't seem to have the kind of performance-at-all-costs approach it would take to match Sublime.

It's not so much that it's impossible, just that I'd bet at high confidence that VSCode will never match or exceed Sublime's performance on most text editor operations.

Re:Disassembling Sublime Text by 0xcoffee on Sunday December 04, 2016 @05:02PM (#13102016)
Well Atom and VSCode are both electron based, but Atom already has a minimap-scrollbar implemented so it is possible.

https://atom.io/packages/minimap

Maybe it isn't as 'technically good', but it does the job and imo looks good. 3M+ downloads.

As for performance, they try to keep up with electron, which keeps up with Chrome, which is currently being retrofitted with a new blazing fast javascript engine (https://v8project.blogspot.com), so it will only get better :)

Re:Disassembling Sublime Text by trishume on Sunday December 04, 2016 @05:27PM (#13102121)
Yah I'm aware of Atom's minimap, hence why I wrote "that actually renders based on the shape of characters". Atom's renders with blocks instead of tiny characters because the DOM couldn't handle full rendering. With Sublime on a Retina display I can even read some of the text. Not a huge deal, but I like it better and it's indicative of the kind of things Sublime can do.

As for V8 it gets faster but is still far from C++. The main issue being it's impossible to make memory-efficient data structures, which are super important for editing large files.

Re:Disassembling Sublime Text by pitaj on Monday December 05, 2016 @12:07AM (#13103498)
I'm pretty sure that it's rendered in a canvas, not with the DOM, but I may be mistaken. Either way it's simply because of laziness or complexity-avoidance that the minimap uses blocks, not a restriction of the medium.

The minimap could be on par with sublimes, but for whatever reason the dev who made the plugin hasn't made it so. That doesn't mean that it's impossible or impractical due to some restriction of atom itself.

Re:Disassembling Sublime Text by trishume on Monday December 05, 2016 @05:14PM (#13110231)
You're right that it does use a canvas, but I'm not sure that it could do full rendering at decent speeds. The trick is scrolling at 60fps. I'm not sure JS Canvas can draw 100,000 characters in 16ms. I think you could do it with WebGL but it's gonna be a while/forever before anyone does that, and then the JS preparation of the data might bog your CPU.
Re:Disassembling Sublime Text by rickycook on Sunday December 04, 2016 @05:28PM (#13102129)
if you open even a 10mb file in atom or vscode, they grind to a stand still. sublime can pretty easily handle hundreds of mb, AND can do regex search over them.

on performance, they aren't even in the same league.

Re:Disassembling Sublime Text by nojvek on Sunday December 04, 2016 @08:47PM (#13102874)
Debugging will even get better. Honestly that's one of the major reasons I like vscode. It integrates deeply with the language and runtimes. It has debug adapters and language services for most major languages.

As for performance. When I need to open large log files, I still go for sublime text. If some core parts of sublime were open sourced, it would be a huge.

Re:Disassembling Sublime Text by Nition on Sunday December 04, 2016 @08:54PM (#13102899)
I've found Notepad++ very good with opening huge files. I'm not sure how it compares to Sublime Text, but Notepad++ is already open source: https://github.com/notepad-plus-plus/notepad-plus-plus
Re:Disassembling Sublime Text by patates on Sunday December 04, 2016 @04:15PM (#13101817)
IMHO the performance of VSCode is good enough. At least for most of my coding. Inspecting huge, archived logs from 3rd parties is the exception. I think nothing can beat sublime in that.
Re:Disassembling Sublime Text by sjellis on Sunday December 04, 2016 @04:27PM (#13101869)
It's not mature yet, but xi can apparently already handle files of several hundred MB with no tearing or lag at all: https://github.com/google/xi-editor. It completely separates the (Rust) back-end process that manages the whole file from the front-end windows, which only render the on-screen sections.
Re:Disassembling Sublime Text by trishume on Sunday December 04, 2016 @04:45PM (#13101929)
Part of what you lose other than large files is little features that need high performance to work.

For example Sublime's fuzzy finder previews files behind it as you type, VSCode/Atom/Emacs can't load files fast enough to do that.

Sublime's minimap beautifully renders each character in the correct shape (at small size) using the same renderer as the main body. The DOM memory usage and thrashing when you type an unclosed quote and the whole file gets re-highlighted would kill Atom/VSCode if it did that.

Also the little things just have far lower latency. Opening a file, typing in the fuzzy finding window in a large project, deleting a closing quote that re-highlights the rest of the file, etc...

Re:Disassembling Sublime Text by pitaj on Monday December 05, 2016 @12:11AM (#13103512)
You could use a canvas or an SVG to avoid "DOM thrashing" so there's no legitimate restriction that has led to minimap being implemented in the way it is.
Re:Disassembling Sublime Text by benevol on Sunday December 04, 2016 @03:16PM (#13101579)
From their FAQ:

How to disable telemetry reporting

VS Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more.

If you don’t wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false.

From File > Preferences > User Settings, add the following option to disable telemetry reporting:

    "telemetry.enableTelemetry": false
Note: VS Code gives you the option to install Microsoft and third party extensions. These extensions may be collecting their own usage data and are not controlled by the telemetry.enableTelemetry setting. Consult the specific extension’s documentation to learn about its telemetry reporting.
Re:Disassembling Sublime Text by ChristianGeek on Sunday December 04, 2016 @03:48PM (#13101698)
Serious question: is there a legitimate reason I should care?
Re:Disassembling Sublime Text by satysin on Sunday December 04, 2016 @04:09PM (#13101786)
Well you should always care about your privacy. I think the better question is do you need to worry? My personal opinion is no, not for things like telemetry in VSCode. It is used to make the product better (hopefully) and I can't see the data collected on startup time or crashes are a massive invasion of privacy.
Re:Disassembling Sublime Text by beefsack on Sunday December 04, 2016 @04:39PM (#13101910)
Is there a legitimate reason a _text editor_ developer should be allowed to make their software call home?

I've only seen Electron-based editors doing metrics, perhaps web developers are less offended by the idea thanks to pervasive usage of things like Google Analytics.

Re:Disassembling Sublime Text by Someone on Sunday December 04, 2016 @05:03PM (#13102019)
There's a lot of information developers could use for the benefit of their users, if they had access to it, some of only very mildly privacy invading, some of it extremely so.

Collecting call stacks from crashing threads or executables can be incredibly useful for fixing them.

Measuring what functionality gets used and what not can help direct feature development (should that checkbox be as visible as it is?)

Collecting statistics on Unicode code point usage may direct development of core data structures (UTF-16 might be the best choice for the basic character unit)

Collecting CPU/memory/disk stats similarly may direct development (if most of your users have gigabytes of free RAM, that change that takes 20% more memory but speeds up things may be useful; if they have plenty of idling CPU! But no memory, things are different)

Knowing what percentage of your users run on a 80386 may help making the decision to compile for at least a 80486.

Knowing internet connection speed and amount of free disk space may help make the decision to move all help online.

Knowing the default browser can help direct testing of the help system, if that system uses the default browser.

Knowing the locale of your users may give hints as to what spell checking languages or UI translations to support.

Having access to the custom dictionaries of all your users may be helpful in improving the ones you ship with the editor.

Having access to every edit made (we are deeply into 'extremely privacy invading' territory now) may also be helpful. For example, you may discover that most of your users don't seem to know about a shortcut that combines five other actions.

Etc, etc.

Re:Disassembling Sublime Text by hartator on Sunday December 04, 2016 @06:05PM (#13102259)
Everything here can be solved by an Apple like pop-up whenever something crashes that ask you if it's okay to send the crash informarion plus machine information.

Telemetry doesn't bring anything more to the table. When I see an app with telemtry, I am just thinking they don't know what they are doing.

Re:Disassembling Sublime Text by Klathmon on Sunday December 04, 2016 @06:45PM (#13102414)
Except for everything that didn't involve a crash (which was everything in that list except the first thing)
Re:Disassembling Sublime Text by 0xcoffee on Sunday December 04, 2016 @05:01PM (#13102013)
An example of how they use telemetry can be seen in their issue tracker.

Here is an example: https://github.com/Microsoft/vscode/issues/707

Re:Disassembling Sublime Text by Skunkleton on Sunday December 04, 2016 @04:49PM (#13101953)
Pretty much all commercially developed software has usage collection. Why is a text editor any different?
Re:Disassembling Sublime Text by khedoros1 on Sunday December 04, 2016 @05:45PM (#13102187)
Exactly. No piece of software should be calling home, except to the degree that its core operation depends on it, and even then, that data should be easily available to the user.
Re:Disassembling Sublime Text by eropple on Sunday December 04, 2016 @05:51PM (#13102205)
So developers should be shooting in the dark on what their users are actually doing with the software and have no data with which to better allocate resources to the features that will cover the most users?

Bold move, Cotton.

Re:Disassembling Sublime Text by izacus on Sunday December 04, 2016 @06:20PM (#13102319)
Developers built great software just fine without constant data spying.... on the other hand all that great "important" data collection somehow doesn't assist in making modern Electron apps any less of a CPU, battery and RAM hogging arse of a software.

Most of analytics data never gets looked at and never provides any useful insight because it's setup poorly.

Re:Disassembling Sublime Text by hashhar on Monday December 05, 2016 @02:51AM (#13103995)
Well, comparing VSCode to Atom I can say that VSCode runs circles around Atom even though both of them are electron based editors.
Re:Disassembling Sublime Text by sooheon on Sunday December 04, 2016 @06:26PM (#13102335)
Yes, developers should have to put some thought into designing their own products. If they're curious how their product is being used, they should do the footwork and ask, and open channels for voluntary feedback. They can collect data with permission. End users' control over their own data is more important than making it easier for developers.
Re:Disassembling Sublime Text by codedokode on Sunday December 04, 2016 @08:03PM (#13102701)
Developers should ask users to opt-in and help with the development. Programs should not send a single byte without users's consent.
Re:Disassembling Sublime Text by khedoros1 on Sunday December 04, 2016 @06:11PM (#13102278)
When they don't provide a method for their user to audit and/or disable telemetry? Yes, I'd prefer them to be blind. I don't expect that this would be a particularly popular position, and that if I kept it as a strict requirement for software I use, it would make it essentially impossible for me to find options in whole classes of software.
Re:Disassembling Sublime Text by zachlatta on Sunday December 04, 2016 @04:58PM (#13102002)
Disappointed by these other answers.

Whether you should care comes down to your ideology. My view: I totally see the value in tracking your users, but I also believe there should always be an option to opt out. Tracking becomes insidious when you lose the right to not participate.

By choosing to opt out, you're showing Microsoft that there are people that genuinely care about being able to not be tracked, making it more likely for them to keep this option for the future.

Re:Disassembling Sublime Text by jsheard on Sunday December 04, 2016 @06:40PM (#13102383)
> By choosing to opt out, you're showing Microsoft that there are people that genuinely care about being able to not be tracked, making it more likely for them to keep this option for the future.

How is Microsoft supposed to know you disabled telemetry? VSCode can't tell them you did, that would be a form of telemetry :P

Re:Disassembling Sublime Text by mook on Sunday December 04, 2016 @10:38PM (#13103231)
They still get update requests (_something_ keeps telling me once a month that there's a new version out, even with telemetry off); that can be compared to the number of unique users with actual telemetry to find the number with it off.
Re:Disassembling Sublime Text by tdrd on Sunday December 04, 2016 @06:41PM (#13102396)
This presumes that MS tracks the fact that you've opted out of tracking, which is not obviously the case.
Re:Disassembling Sublime Text by SippinLean on Sunday December 04, 2016 @04:13PM (#13101811)
I don't know of a better open source IDE for front-end development right now. Performance isn't up to ST3 but it's more than acceptable, and the built-in tools and robust extensions more than outweigh that cost.
Re:Disassembling Sublime Text by niutech on Monday December 05, 2016 @03:23AM (#13104106)
Except VSCode is not an IDE but a code editor. For an open source IDE check Netbeans out. Or another code editor Brackets.
Re:Disassembling Sublime Text by SippinLean on Wednesday December 07, 2016 @02:55PM (#13125648)
Agree/disagree. Netbeans has a ton of features VSCode doesn't but VSCode does include a lot of IDE-like features, especially OOTB compared to ST3.
Re:Disassembling Sublime Text by Sean1708 on Monday December 05, 2016 @10:27AM (#13105912)
Out of interest, what would you say is the difference between a text editor and an IDE?
Re:Disassembling Sublime Text by Zaheer on Tuesday December 06, 2016 @12:42PM (#13116555)
IDE's usually offer much more features than text editors. This sounds kind of anecdotal because it is and the line between the two is getting blurrier as text editors get more powerful. Typically, strong auto-complete, debugger tools & project management were differentiating factors but those are becoming more available at the text editor level as well.
Re:Disassembling Sublime Text by wishinghand on Sunday December 04, 2016 @03:08PM (#13101532)
By multi-line edit do you mean multiple cursors at once? Does it have a fancy regular expressions generator to replace it? Otherwise that's a non-starter for me, simultaneous editing is too valuable.
Re:Disassembling Sublime Text by coltonv on Sunday December 04, 2016 @03:15PM (#13101570)
It's there, it's just bound to alt-click instead of ctrl-click. And currently you can't rebind any keybinding with a mouse click on it, so you have to use alt-click.
Re:Disassembling Sublime Text by shalabhc on Sunday December 04, 2016 @03:22PM (#13101605)
What are the main use cases of multiple cursors? It seemed like an interesting feature, and I'm curious why it would be considered essential.
Re:Disassembling Sublime Text by TeMPOraL on Sunday December 04, 2016 @03:56PM (#13101730)
I use them very often in Emacs instead of keyboard macros. They are useful whenever you have to perform the exact same operations in several places simultaneously visible on the screen[0]. By operations I mean both simple ones, like writing something, and more complex ones, like navigating/deleting whole words (of different length), etc.

Mostly I use it for quick renaming of variables, string fixes, and some structural changes in code.

--

[0] - multiple cursors, at least in Emacs, can work off-screen too, but I don't like not seeing what's going on when I do changes.

Re:Disassembling Sublime Text by NoGravitas on Monday December 05, 2016 @07:55AM (#13105035)
I also do this, though I use iedit-mode rather than multiple-cursor-mode.

However, I do like to point out that it's really just eye-candy for stuff I was already able to do in emacs. Previously, I would have used either keyboard macros or query-replace-regexp to do the same things.

Re:Disassembling Sublime Text by TeMPOraL on Monday December 05, 2016 @08:01AM (#13105059)
I second it. I too used either keyboard macros or query-replace- commands before. Multiple cursors is just nicer for these particular things.
Re:Disassembling Sublime Text by wishinghand on Sunday December 04, 2016 @03:39PM (#13101669)
It's basically a visual regular expressions. So I'll caveat my original statement that if you don't know regex, you need it. I never learned regex because I came from a self-taught, web development oriented background. So if I need to replace all instances of a variable, then go to the end of the line they were on and type in a different variable name or add a semi-colin, that's what I use.
Re:Disassembling Sublime Text by madeofpalk on Sunday December 04, 2016 @04:09PM (#13101787)
Lots of little things. Select a multiple lines of an object/hash/dict, break into multiple cursors, rewrite line (copying and pasting as needed, it works that out as well) to change to variable declarations, or to add a comma, or to... whatever.
Re:Disassembling Sublime Text by breck on Sunday December 04, 2016 @05:21PM (#13102100)
I often use "multiple cursors" as vertical cursors, to indent or dedent a whole block of code 1 space at a time. Often useful for contexts when shift+tab/tab doesn't work.
Re:Disassembling Sublime Text by euyyn on Sunday December 04, 2016 @04:01PM (#13101749)
For me it's mainly part of this sequence:

Ctrl-F <search query> SelectAll <edit with multiple cursors>

Do it all the time.

Re:Disassembling Sublime Text by heartbreak on Monday December 05, 2016 @12:54AM (#13103650)
I love the CTRL+CMD+G route as well. Use it constantly when refactoring.
Re:Disassembling Sublime Text by greggman on Monday December 05, 2016 @01:52AM (#13103811)
I desperately want to switch editors (been using slickedit since 93)

I tried VSCode only to find it is hardcoded to only support 3 panes at once. I often have 5-7 panes open.

It was also not clear how much work it would be to add modal selection. I tried the most popular vim emu looking for an example on how to do it only to find that feature has not been emulated yet.

Re:Disassembling Sublime Text by bpicolo on Monday December 05, 2016 @08:50AM (#13105288)
I use VSCode for a few tasks and enjoy it, but Sublime is just so much more polished than anybody else. In addition, Atom/VSCode/ETC all have panes as an afterthought. Sublime's tabs/panes work far better and behave the way I expect them to.
Re:Disassembling Sublime Text by ino on Sunday December 04, 2016 @02:36PM (#13101368)
If I already have a Sublime license, and I'm happy and it fulfils my needs perfectly, what would I gain in spending the time to try to get my workflow working in VSCode if it still hasn't caught up, as you say?
Re:Disassembling Sublime Text by bubersson on Sunday December 04, 2016 @03:27PM (#13101621)
If it fulfills your needs perfectly then there's no need to change. It may be still worth playing with a bit and doing tooling investigation to find out if there are some super useful features for your case.

I switched to vscode from sublime recently, because it has much better autocompletion and "goto definition" especially when working with JS and TypeScript code, which is exactly what I need. Other than that I was able to replicate all features from Sublime (e.g. multipoint editing) and I'm not aware of any missing feature from what I used in Sublime. One con is that vscode is slower to start and slower to open up a file.

Re:Disassembling Sublime Text by paulddraper on Sunday December 04, 2016 @02:48PM (#13101432)
> I'm happy and it fulfils my needs perfectly

Have you not answered your own question?

Re:Disassembling Sublime Text by adamrezich on Sunday December 04, 2016 @02:41PM (#13101400)
Up-to-date plugin ecosystem, especially if you write code in trendy languages.

But if your workflow ain't broke, don't fix it, right?

Re:Disassembling Sublime Text by nathancahill on Sunday December 04, 2016 @02:53PM (#13101463)
It's closer to an actual IDE for JS than Sublime is (even once you install a bunch of ST plugins). Especially for TypeScript. That said, if Sublime is working for you, stick with it.
Re:Disassembling Sublime Text by xwvvvvwx on Sunday December 04, 2016 @06:23PM (#13102328)
having a multi language debugger integrated into my editor was a huge game changer for me.
Re:Disassembling Sublime Text by PSeitz on Sunday December 04, 2016 @05:37PM (#13102162)
I heard that about Atom around 12 months ago.
Re:Disassembling Sublime Text by Zaheer on Tuesday December 06, 2016 @12:44PM (#13116571)
Atom had many more performance issues. VSCode is not on par with Sublime but very close.
Re:Disassembling Sublime Text by jsmeaton on Sunday December 04, 2016 @03:27PM (#13101627)
Keymaps were my number one reason for abandoning vscode so I'm glad they've got a sublime/atom keymap now. I might give it another go.
Re:Disassembling Sublime Text by epimetheus on Monday December 05, 2016 @09:49AM (#13105627)
I switched to VSCode just for my Typescript projects, and really like it. Main reason I switched was that in Sublime you can hide JS and map files, but it always hides them. With VSCode you can have logic in your config, so you can hide JS files, only if a TS file with the same name exists, that way I don't have to switch config when I'm looking for a js file particularly, and can keep my sidebar clean and show only files I need to edit.