Félix: Thoughts re using vs-code instead of Leo?

109 views
Skip to first unread message

Edward K. Ream

unread,
Jun 20, 2020, 10:21:53 AM6/20/20
to leo-editor
Félix, I'm wondering what you see as the pros and cons of using vs-code instead of Leo. Here's a few thoughts. I'd like your comments:

Pros of using vs-code:

- Many more plugins. That could also be a distraction.
- Probably better support for node.js, ts and js.
- Probably better support for basic text editing.

Cons of using vs-code:

- Leo's gui plugins won't work in vs-code.
- Probably better support for python.
- Leo's abbreviations probably won't work.

I assume that key bindings aren't a huge deal.

Your comments?

Edward

Félix

unread,
Jun 21, 2020, 12:41:34 PM6/21/20
to leo-editor

Hi Edward, 😃

I wrote this reply yesterday night before going to bed and am only posting this morning because I wanted to sleep on it first i guess...: I see that you have discovered the features and power of vscode in the meantime! haha! so please ignore the suggestion below about reading an article that explains most of it. I'm still posting it untouched below because otherwise they are my thoughts about Leo, vscode and the "state of programming technologies in our modern times".

Here are some collected thought about Leo, vscode, and at the end, my thoughts about the specific points you brought up with the pros and cons of using vscode.

One does not use Leo instead of vscode, nor does one use vscode instead of Leo. A programmer that understands the power they both have, alt-tabs (angrily) between the two. (well at least before I finish leoInteg)

So indeed, Knuth's vision was off by a small detail with regards to literate programming: The 'sections' concept only work when built upon directed acyclic graphs, i.e. "Outlines". This, I guess, is Leo's first foundational feature. (One of your most important discovery and invention Edward!)

Leo is the friggin "level 9000" outline editor from outer space that enables all the things I list on the opening paragraphs of leoInteg's readme. Those things are also listed in your great and inspiring post : https://github.com/leo-editor/leo-editor/issues/1025 (Leo is not only the greatest one at this, it's the only one.)

At the workplace, like many, I went from visualStudio (90's) big corporate IDEs like eclipse/rational (00's), to sublime, somewhere late 2000's early 2010's, and got convinced by coworkers to switch to vscode a year or two ago. (So i'm still quite a newbie in that regards)

If I'm not mistaken, vscode is a fork of atom, which is just a blank vanilla canvas "text editor with tree in the sidebar", where everything is an extension. Even the basic features and language(s) support: it's just that those are pre-installed.

vscode is the most popular "programmer's" text editor nowadays because it understands everything on the screen and will tell me, as I type, what members are available on any objects, even those who were just imported from outside libraries...Even when not running in 'debug'. It gives me detailed info on any word I hover over. When I'm about to write a variable to pass as a parameter it suggests/autocomplete with those that are on the scope and of the right type only. (well for typed languages at least, such as C, typescript, ...)

And I'm not even talking about all the other stuff it picked up from sublime... Please take 10-15 minutes if you could, to read this https://code.visualstudio.com/docs/editor/codebasics and the other entries under "user guide"

vscode takes in charge the workspace (opened folder) and will run 'Language Servers' that resolve any symbol, in the background, as you type and navigate your code. (Ex. When you rename a property/method, it changes in all files it is referenced at once.)

But for an explicit example of the kind of thing that made me go 'Wow!' when using vscode, I attached 3 gifs (See descriptions below):


While watching those gifs, its important to note that the only thing I did to enable all this functionality was 'nothing': I Just happened to be working in a folder (workspace) which contained a python file, which triggered vscode into asking me : "Hey, there's a python file in your workspace. Do you want vscode to install the default microsoft Python extension?" (Yes/Maybe Later) And I clicked 'Yes'. That's it.

Now if you've ever setup big corporate IDEs like eclipse, rational, or other modular IDE at work, You know you have many more things to configure and install before being totally setup for running and debugging effectively with all your favorite tools.

Gifs Description:

 1- showoff_vscode1.gif : autocompletion from imported libs: those sources being scanned to give me details were not 'specified' as existing anywhere in some project configuration file à la 'eclipse', vscode figured it out himself.
 2- showoff_vscode2.gif : I see documentation strings, and parameter definitions on hover, and use alt+click to 'dig' into definitions: in whatever source file, which again, It figured from the imports at the top of the script and the environment.
 3- showoff_vscode3.gif : In this gif, i'm stepping into the chunk of code I was talking to you about the other day. I configured nothing in order to do that. I just clicked in the margin to set a breakpoint and boom!

That's some of the stuff vscode did with opened python files. Features for other typed languages are even more helpful and well integrated. (because vscode goes through the type definitions of all symbols of all files in an opened workspace)

... which brings me to... 

To understand and love to use Leo while programming, you have to have given it a try. I was curious to try and use it after having read about it. But only once trying it, would anyone be convinced to keep and use another additional 'IDE/editor' on their computer. In my experience, the biggest element that was making my fellow young programmers (in their early 20s) Not try Leo was the tclTk/Pyqt GUI that made them feel like they were in notepad in 1998. And the fact that they had to alt+tab to another app, or minimize, to see the resulting derived files.

But enough of my rambling, here's some other thoughts about the specific points you underlined:

Pros of using vs-code:

- Many more plugins. That could also be a distraction.
    vscode is the first ide that 'gets' the plugins right: the plugins cannot create GUI/UI content directly, there is no access to the 'DOM'.
    plugins authors have to integrate additional entries in mouse-hover panel, activitybar, status bar, etc. Duplicates are handled and removed by vscode so it doesn't look bad. It's really mind boggling when you start developing extensions and expect to be able to create DOM elements! vscode will never have tons of rows of buttons and tools/panels because you have to insert in existing ones and icons/buttons are only visible on hover and if appropriate context makes sense.

- Probably better support for node.js, ts and js.
  indeed.
- Probably better support for basic text editing.
   It's ahead of sublime now!

Cons of using vs-code:

- Leo's gui plugins won't work in vs-code.
    'gui' stuff specifically, yes, but other plugins should work.
- Probably better support for python.
    In my perspective, vscode offers better support by far, but I may have not enabled the required options/configurations/debuggers in Leo, if any.
- Leo's abbreviations probably won't work.
    I am not aware of the abbreviation feature of Leo. I should google and learn about this.

I assume that key bindings aren't a huge deal.
    Not at all as I have reproduced them mostly all and they're overridable in vscode.

Félix

P.S. More rambling below but I just smoked some cannabis, so it's not really serious:

If a microsoft employee, or bill gates himself, (or other) discovers the power of dag/outlines to organize code in a forward way (instead of being reflected back to the programmer like in the default outline view of regular IDEs) and the whole literate programming concepts as an effective and valid workflow, then Bill Gates can build a& sell an product and  name this the 'Microsoft DAG Outliner' or whatever, and take all credit for it. I'm half-joking but this would be terrible and unfair in my mind.

It's important for me, as you can see from leoIntegs code and documentation, and as a point of honor, that the invention and discoveries are attributed correctly, along with the original vocabulary and terminology. ("leo" as the tool's and concept name in general, "EKR" as the author of Leo and all its concepts, "Leonine" as the quality of things written with structured outlines, etc.  Just like we would attribute to Knuth mostly what preceded this.)

Edward K. Ream

unread,
Jun 22, 2020, 5:50:03 PM6/22/20
to leo-editor
On Sun, Jun 21, 2020 at 11:41 AM Félix <felix...@gmail.com> wrote:

Hi Edward, 😃

I wrote this reply yesterday night before going to bed and am only posting this morning because I wanted to sleep on it first i guess...: I see that you have discovered the features and power of vscode in the meantime! haha! so please ignore the suggestion below about reading an article that explains most of it. I'm still posting it untouched below because otherwise they are my thoughts about Leo, vscode and the "state of programming technologies in our modern times".

It's hard to keep up with all the thoughts, comments and excitement. But I'm not complaining :-)

I'm responding to your replies in pretty much reverse order.  After this I think I'll be up to date...

One does not use Leo instead of vscode, nor does one use vscode instead of Leo. A programmer that understands the power they both have, alt-tabs (angrily) between the two. (well at least before I finish leoInteg)

I suspect that vs-code + leoInteg will be the preferred environment for many.

So indeed, Knuth's vision was off by a small detail with regards to literate programming: The 'sections' concept only work when built upon directed acyclic graphs, i.e. "Outlines". This, I guess, is Leo's first foundational feature. (One of your most important discovery and invention Edward!)

The "How to Speak" video mentioned that important ideas need slogans. Leo's first slogan was "webs are outlines in disguise".
Leo is the friggin "level 9000" outline editor from outer space that enables all the things I list on the opening paragraphs of leoInteg's readme. Those things are also listed in your great and inspiring post : https://github.com/leo-editor/leo-editor/issues/1025 (Leo is not only the greatest one at this, it's the only one.)

I agree. And thanks for reminding me of #1025. It was very smart of you to zero in on the distinction between essential and non-essential features. It the simplest, best, design principle for leoInteg.

vscode is the most popular "programmer's" text editor nowadays because it understands everything on the screen and will tell me, as I type, what members are available on any objects, even those who were just imported from outside libraries...Even when not running in 'debug'. It gives me detailed info on any word I hover over. When I'm about to write a variable to pass as a parameter it suggests/autocomplete with those that are on the scope and of the right type only. (well for typed languages at least, such as C, typescript, ...)

I've been suffering intellisense envy for a long time. It's a killer feature.
...I attached 3 gifs...
 
While watching those gifs, its important to note that the only thing I did to enable all this functionality was 'nothing': I Just happened to be working in a folder (workspace) which contained a python file, which triggered vscode into asking me : "Hey, there's a python file in your workspace. Do you want vscode to install the default microsoft Python extension?" (Yes/Maybe Later) And I clicked 'Yes'. That's it.

It's clear that Leo's devs can never hope to complete with the thousands of smart vs-code devs writing plugins for vs code.

Pros of using vs-code:

- Many more plugins. That could also be a distraction.
    vscode is the first ide that 'gets' the plugins right: the plugins cannot create GUI/UI content directly, there is no access to the 'DOM'.
    plugins authors have to integrate additional entries in mouse-hover panel, activitybar, status bar, etc. Duplicates are handled and removed by vscode so it doesn't look bad. It's really mind boggling when you start developing extensions and expect to be able to create DOM elements! vscode will never have tons of rows of buttons and tools/panels because you have to insert in existing ones and icons/buttons are only visible on hover and if appropriate context makes sense.

I didn't realize any of this until I re-read it just now.

What I did notice was how easy it is to explore plugins and install/uninstall them.

- Probably better support for node.js, ts and js.
  indeed.
- Probably better support for basic text editing.
   It's ahead of sublime now!

Good to know.

Cons of using vs-code:

- Leo's gui plugins won't work in vs-code.
    'gui' stuff specifically, yes, but other plugins should work.

Yes. This is another example of the distinction between essential features of Leo vs non-essential features.

- Probably better support for python.
    In my perspective, vscode offers better support by far, but I may have not enabled the required options/configurations/debuggers in Leo, if any.

After further review, I agree with you. Now that Ctrl-B works in leoInteg there is likely no advantage to using Leo regarding python.

There might be some more python-related features that could be added to leoInteg, but none seem salient at present, and they could always be added later.
- Leo's abbreviations probably won't work.
    I am not aware of the abbreviation feature of Leo. I should google and learn about this.

Leo settings define abbreviations. For example, I use "alp;;" all the time. It expands to "@language python".  The double semicolons are merely a convention: they ensure I won't type the abbreviation by mistake.

I suspect vs-code (or a plugin) already supports this as far as text goes. Actually, I would be shocked if that weren't true. However, Leo's abbreviations can also create outlines! I doubt very much if emacs org mode or vimoutliner can do that. So some assembly will be required eventually.

I assume that key bindings aren't a huge deal.
    Not at all as I have reproduced them mostly all and they're overridable in vscode.

Very cool.

If a microsoft employee, or bill gates himself, (or other) discovers the power of dag/outlines to organize code in a forward way (instead of being reflected back to the programmer like in the default outline view of regular IDEs) and the whole literate programming concepts as an effective and valid workflow, then Bill Gates can build a& sell an product and  name this the 'Microsoft DAG Outliner' or whatever, and take all credit for it. I'm half-joking but this would be terrible and unfair in my mind.

Heh. I have a completely different take on the situation. My life's work has been to promote Leo's essential features. I am not at all worried about someone "stealing" those features.

Given that vs-code is itself open source (with the MIT licence, no less), I see the likelihood of commercial competition with vs-code + leoInteg as virtually nil.

You could even say that leoInteg is "stealing" Leo's ideas, and using them in vs-code. But I'm thrilled by that development! It means that Leo's essential ideas have a real chance of reaching thousands or even millions of people who otherwise would never encounter them.
It's important for me, as you can see from leoIntegs code and documentation, and as a point of honor, that the invention and discoveries are attributed correctly, along with the original vocabulary and terminology. ("leo" as the tool's and concept name in general, "EKR" as the author of Leo and all its concepts, "Leonine" as the quality of things written with structured outlines, etc.  Just like we would attribute to Knuth mostly what preceded this.)

I appreciate your sentiments. As the "How to Speak" video says, one gets used to being famous; one never gets used to being ignored. It's another reason to be excited about leoInteg.

Having said that, I think it wise to get, deep down, that the real value of what we all do lies in the pleasure it gives us, and the pleasure it gives other people.

I sometimes speak of my "legacy", and there isn't anything really wrong with that. Otoh, the Buddist doctrine of "The impermanence of all things" (sans the religious theory) is one of the foundations of my life. The most common answer that Nobelists give when asked "How do you think you will be remembered?" is: "I won't be remembered."

Edward

Félix

unread,
Jun 22, 2020, 7:54:54 PM6/22/20
to leo-editor
Leo settings define abbreviations. For example, I use "alp;;" all the time. It expands to "@language python".  The double semicolons are merely a convention: they ensure I won't type the abbreviation by mistake.

Ah, those are called 'snippets' in many editors, : define a short string upon which hitting 'tab' (or some defined activation) replaces the abbreviation by a longer string(S) and places you cursor at the right place, even sometimes within the string. 
Unless i'm confusing with something else, obviously... which i may.

I appreciate your sentiments. As the "How to Speak" video says, one gets used to being famous; one never gets used to being ignored. It's another reason to be excited about leoInteg.

I really enjoyed that video and I got many things out of it! Thanks for that!

Félix

Edward K. Ream

unread,
Jun 23, 2020, 4:19:50 AM6/23/20
to leo-editor
On Mon, Jun 22, 2020 at 6:54 PM Félix <felix...@gmail.com> wrote:
Leo settings define abbreviations. For example, I use "alp;;" all the time. It expands to "@language python".  The double semicolons are merely a convention: they ensure I won't type the abbreviation by mistake.

Ah, those are called 'snippets' in many editors, : define a short string upon which hitting 'tab' (or some defined activation) replaces the abbreviation by a longer string(S) and places you cursor at the right place, even sometimes within the string. 
Unless i'm confusing with something else, obviously... which i may.

That's right. Leo's abbreviations are like snippets. However, Leo's snippets may create a node, including possibly sub-nodes. I doubt that existing vs-code snippets can handle that.

I appreciate your sentiments. As the "How to Speak" video says, one gets used to being famous; one never gets used to being ignored. It's another reason to be excited about leoInteg.

I really enjoyed that video and I got many things out of it! Thanks for that!

You're welcome. It's messages continue to resonate with me.

Edward

Jacob Chang

unread,
Apr 5, 2021, 1:38:11 PM4/5/21
to leo-editor
On Tuesday, June 23, 2020 at 1:19:50 AM UTC-7 Edward K. Ream wrote:
On Mon, Jun 22, 2020 at 6:54 PM Félix <felix...@gmail.com> wrote:
Leo settings define abbreviations. For example, I use "alp;;" all the time. It expands to "@language python".  The double semicolons are merely a convention: they ensure I won't type the abbreviation by mistake.

Ah, those are called 'snippets' in many editors, : define a short string upon which hitting 'tab' (or some defined activation) replaces the abbreviation by a longer string(S) and places you cursor at the right place, even sometimes within the string. 
Unless i'm confusing with something else, obviously... which i may.

That's right. Leo's abbreviations are like snippets. However, Leo's snippets may create a node, including possibly sub-nodes. I doubt that existing vs-code snippets can handle that.

Wow, abbreviations creating nodes with sub-nodes is incredibly powerful for me. I am currently creating a structure to move my case management into Leo.  This form of templating is going to save me a ton of time.  newcase;; = a family of nodes and subnodes.  Now I just need to learn how to implement it. lol 
Reply all
Reply to author
Forward
0 new messages