News for hackers. Stuff that matters.
Re:Helping a Million Developers Exit Vim by linkmotif on Tuesday May 23, 2017 @10:39PM (#14407224)
Why doesn't it make sense today?
Re:Helping a Million Developers Exit Vim by PhasmaFelis on Wednesday May 24, 2017 @03:57AM (#14408256)
To expand on rebootthesystem's excellent answers:

* Ease of learning. Any power user learning Vim now (or in the last 20+ years) is coming to it with a headful of useful, versatile conventions and shortcuts that completely don't work. God knows how many times I interrupted my flow by reflexively hitting Ctrl-Z to undo, or Ctrl-V to paste, or Shift-Arrow to highlight, or, hell, just trying to type something normally. It doesn't even sync with other command line conventions. That "Type :quit<enter> to exit Vim" message appears when you hit Ctrl-C: Vim knows what you're trying to do, but it won't do it unless you ask nicely. As far as I can tell, there's no substantial advantage to Vim's mappings except that people who already know Vim can keep using them.

Which ties into:

* Discoverability. This is less about Vim in particular and more about command-line apps in general, but still. In a GUI app, if you want to do something but don't know how, you can often find it quickly by clicking around menus, and in the process you may find something else useful that you didn't know about. On the command line, you pretty much have to tab out and search for help, whether in Google or the man pages. (And of course learning to navigate command-line help is a whole different skill in itself.

Re:Helping a Million Developers Exit Vim by cesnja on Wednesday May 24, 2017 @11:20AM (#14410634)
Spacemacs solves the problem of discoverability by displaying all modal keybindings currently available, if you started typing a modal command sequence, but haven't completed a command yet. The additional bonus here is that once you internalise these commands, they stay the same while you execute them much faster. In mouse-centered environments, one would first learn how to do an action using a mouse and after he felt the need to be faster, he'd need to learn the key combo from scratch (for the sake of the argument, let's ignore the few common conventions like F1, cut/copy/paste and undo/redo).

On the other hand, I agree that starting out with CLI is a bit painful. IMO, the middle ground taken by Spacemacs really should be researched (and used) mode.

Re:Helping a Million Developers Exit Vim by rebootthesystem on Wednesday May 24, 2017 @02:01AM (#14407894)
In all of the discussions on HN about vi/m this is probably the most intelligent question I've received after posting my opinion.

I've been coding for 16 hours straight and have at least another four in front of me (have to deliver tomorrow AM) so I don't have a ton of time to answer this.

I'll use today as my example of how irrelevant (and counterproductive) vi/m can be.

I'm working on a large Django project and cranking out apps like there's no tomorrow. I use PyCharm for this.

Here's a case where experts are making it their business to deliver a superior tool that allows me to get my work done. It has myriad tools configured and configurable to help me. I don't have to futz around with weird custom stuff. It is intelligent about Python, Django, JS, jQuery, databases, HTML, packages, Git, Python console, Django console, etc. It can even talk to my servers. PyCharm is, in my opinion, a nearly unmatched productivity tool.

I lied. I am working on two large Django projects simultaneously because some of the work for the new project entails porting from an old one. So, two PyCharm windows on two 24 inch monitors and two browser instances side-by-side on the third monitor.

Can you setup vim to do some/all of the above. To some extent, yes. I haven't used it at this level in quite some time so I can't answer the question. What's the question? Can you setup vim to match PyCharm feature for feature? I don't think you can, and, if you could, it'd be a nightmare.

A lot of the vim "religion" centers around keeping your hands on the keyboard, not using the mouse, carpal tunnel and speed.

Keeping your hands on the keyboard is irrelevant unless you are a data entry clerk. If you are a software developer you are far more likely to spend more time doing things other than typing. Designing data structures, diagramming databases, researching approaches to solving a problem. Thinking.

The above is also used hand-in-hand with "vim is faster". Yeah, again, if you are a data entry clerk entering tax return records this might have some value. Software development? Nah. The time one could save by only having to move a finger a few centimeters is but a rounding error in the context of any non-trivial software development project. It's silly, really. Take the entirety of a project and multiply typing time by, I don't know, 1.25. It would still be insignificant when compared to the overall project time. Debugging alone takes orders of magnitude more time than anyone could save by typing faster.

Not using the mouse. You know, those of us who grew up using, designing, building and programming computers that did not have a mouse were ecstatic when the mouse arrived. It's just plain silly to malign the mouse. I will say that I switched to a thumb operated trackball a long time ago. I don't go looking for a mouse. My trackball is always there, quite literally touching the right edge of the keyboard. And I don't have to move it all over the place to use it.

Carpal tunnel. Serious problem. I suffered from this about fifteen years ago. Doing 18 hour days in front of the keyboard was red-hot painful. I tried different ideas. I knew people who had to have surgery on both wrists and were never again the same. I wanted to avoid that scenario.

I ultimately did two things: First, I switched to a thumb operated trackball. Mice are not designed right and you have to move all over the place all the time. This is very repetitive and not good. Second, I designed and built my own desk. I welded a steel framework that supported a surface for the monitors at 29 inches off the floor. The framework also had a full length shelf in the front with the surface dropped down about three inches. The front of that shelf had a 2 inch raised lip. So, my forearms rested on this lip and my keyboard and trackball were two inches below that. My hands naturally drooped into that cavity. No more carpal tunnel. Being in front of the computer doing everything from mechanical to electrical to software engineering using various interfaces for 16+ hours is normal for me. I have not had any issues in 15 years or so. None.

All of the arguments for vim are simply irrelevant. The only argument I could find for knowing how to use it at a basic to mid level is this: If you find yourself having to access a remote system with a computer that dates back to the stone age you might have no choice but to have to edit files remotely and you know that vim/vi will be on that system. Personally, I have never in over thirty years had that problem. These days I'll use something like CuteFTP if I have to or, as I said above, PyCharm and other IDE's (PHPStorm, etc.) know how to talk to servers and allow remote editing "in comfort". I mean, you can buy a $200 PC laptop with a large 17 inch screen, full keyboard, etc. these days. No more excuses.

Bottom line: vi/vim don't make sense because they do not provide any advantages when compared to state of the art IDE's.

Wow, I ended up typing more than I wanted to. Oh well.

Re:Helping a Million Developers Exit Vim by alexvoda on Wednesday May 24, 2017 @05:06AM (#14408583)
Since you mentioned using a trackball due to carpal tunnel when using a mouse I thought I should share my setup. I don't really suffer from these issues (with the exception of scrolling) but it pays to prevent them.

I only use a mouse when I use many monitors (3+) and the desktop surface area is significant. In all other cases I prefer to use a very customized touchpad setup. I use a business laptop because it has buttons for the touchpad both below and above the touchpad(the buttons for the trackpoint. And I configured it so that all the buttons below are the normal click and a button above is the secondary click. And I disabled tapping because tapping gives you no feedback and prevent you from resting your hand on the touchpad. The main reason I switched is because I find scrolling on a touchpad (either 2 finger scrolling for short distances or circular scrolling for longer distances) a lot more comfortable than the scroll wheel. Scrolling a lot using a scroll wheel makes my middle finger hurt and middle click auto-scrolling doesn't work everywhere.

This means I can mouse around using either hand in the same way. Most touch pads are configured with buttons (reals or virtual) in the bottom left and right sides for left and right click. This means using the touchpad is different for the left hand than it is for the right hand.

The only other touchpad I found as usable was the Apple trackpad when it still had a button. I clicked with the button and the difference between primary and secondary click was whether I had two fingers on the trackpad.

Re:Helping a Million Developers Exit Vim by rebootthesystem on Wednesday May 24, 2017 @07:21PM (#14414224)
This is very interesting. Since the trackball worked well for me going back nearly twenty years I stopped looking for other solutions. I coded for 20 hours yesterday and I'm perfectly fine today.
Re:Helping a Million Developers Exit Vim by wtetzner on Wednesday May 24, 2017 @05:45AM (#14408756)
> It's silly, really. Take the entirety of a project and multiply typing time by, I don't know, 1.25. It would still be insignificant when compared to the overall project time.

I mostly agree with you, but I think there is value in fast text editing for software development. The advantage of being able to edit code quickly is that typing doesn't interrupt your train of thought as much.

Re:Helping a Million Developers Exit Vim by rebootthesystem on Wednesday May 24, 2017 @07:18PM (#14414207)
If someone's train of thought is interrupted by the difference in code entry time between vim and a good IDE or code editor --which is milliseconds-- they have a real problem requiring medical attention.

Forget IDE's for a moment. Look at an editor like Atom. It's fantastic. You type "for" and it expands the for loop automatically for you and it understands languages. And, more importantly, you have to spend exactly zero minutes configuring that behavior.

Let professionals make great IDE's and tools. Focus on the real job in software development, which is not being a text entry machine.

Re:Helping a Million Developers Exit Vim by wtetzner on Sunday May 28, 2017 @02:07PM (#14435425)
I get the impression that you haven't gotten proficient in an editor like Vim or Emacs. The difference in speed in terms of getting your thoughts out of your head into the computer is definitely more than milliseconds. I usually use Emacs, but I use an IDE for Java, because I think the benefits outweigh the costs, which is why I said I mostly agree with you. What I find frustrating is that there's no reason an IDE couldn't be as good as Vim or Emacs for editing text while retaining all of their IDE goodness.

On of these days I may try my hand at building something like that (assuming nobody beats me to it, which would be even better).

Re:Helping a Million Developers Exit Vim by linkmotif on Wednesday May 24, 2017 @09:39PM (#14414753)
Thanks for the reply.

Certainly, though, you are using PyCharm vi emulation mode?

The interesting thing about your reply is that you focus on productivity/speed. And I think it's hard to argue (though I've seen people attempt to argue this) that time spent moving to/from keyboard is not so relevant considering software development is largely about thinking.

However for me vi-style text entry is not about productivity but about mental comfort. It turns your keyboard into more of a musical instrument and amplifies your ability to express what you want to happen on the screen. That's the case for me. That's why I asked about vi emulation mode, because that's what I think is the salient feature/innovation of vi(m).

Re:Helping a Million Developers Exit Vim by thomastjeffery on Wednesday May 24, 2017 @01:20PM (#14411682)
> A lot of the vim "religion" centers around keeping your hands on the keyboard, not using the mouse, carpal tunnel and speed.

That's a nice side effect, but it's not why vim is "better".

"Normal mode" in vim ties composeable​ functions each to a separate key. The "." key repeats the most recent function. You can record a string of keystrokes to a macro, and even edit it as plain text.

Vim is fantastic for editing text, which is 99% of what most of us do. It may not be your first choice for creation (although it is mine), but that doesn't make it worthless.

Re:Helping a Million Developers Exit Vim by marssaxman on Wednesday May 24, 2017 @02:10PM (#14412139)
Editing text is maybe 9% of what I do. Most of my work consists of reading text, thinking about it, running tests, reading the results of those tests, thinking about what I've read, discussing what I've been thinking about with coworkers, reading more text, and thinking some more. It has been this way for most of my career. This is what I see most of my coworkers doing, too. Editing text more efficiently simply wouldn't make any measurable difference in my productivity, because editing text doesn't take up that much time to begin with.
Re:Helping a Million Developers Exit Vim by thomastjeffery on Wednesday May 24, 2017 @07:05PM (#14414132)
Personally, I don't care about "efficiency". I care about usability. Having a tool designed to edit text let's me focus on everything else. Sure, there is a learning curve, but you don't need to be an expert to find the tool useful.
Re:Helping a Million Developers Exit Vim by rebootthesystem on Wednesday May 24, 2017 @07:10PM (#14414160)
vi wasn't designed to efficiently edit text. It was designed to deal with shitty keyboards of the time. And now it is a cult.

I challenge anyone to prove that a non-trivial project, say, a year of work for a team of five developers, would get done any faster, better and with less bugs because of the single act of adopting vim vs. a top grade IDE.

Re:Helping a Million Developers Exit Vim by thomastjeffery on Thursday May 25, 2017 @04:10PM (#14419781)
> vi wasn't designed to efficiently edit text.

That's entirely my point. It's not about efficiency. It's a lot like using an alternative keyboard layout. Sure, it isn't faster, but it's a lot more comfortable.

Vim is great for editing text. There are functions that can easily be used to accomplish the editing task you want to do. Having tools designed for the task at hand makes working easier, and more comfortable. It's akin to having more leverage.

> It was designed to deal with shitty keyboards of the time. And now it is a cult.

That's very true. Like many other projects, with age Vim has held to tightly onto tradition. The functions available in normal mode are the same functions bound to the same keys. Any change to that behavior is so fundamental, it simply doesn't happen.

> adopting vim vs. a top grade IDE

That is not what I, or most others are asking. Most people who use vim enter the "vim cult" simply because they enjoy using the tool. Even after decades of stagnation, they prefer vim to an IDE.

If there is something the "vim cult" wants, it is for you to let them use the tool they enjoy. IDEs inherently push tools out of their tightly defined (integrated) ecosystem. If someone wants to use the tool they like, and an IDE, they have to integrate the two. More often than not, that means a minimal implementation of vi inside the IDE.

TL;DR If I am in the "vim cult", you are in the IDE cult. All I want from you is to let people use their tools.

Re:Helping a Million Developers Exit Vim by rebootthesystem on Wednesday May 24, 2017 @07:07PM (#14414143)
That is precisely my point. To devote any effort at all optimizing this is to go after the wrong optimization target. Just buy or use a good IDE that helps you with tasks beyond text entry and move on. There is no value to be gained doing anything else.
Re:Helping a Million Developers Exit Vim by thomastjeffery on Thursday May 25, 2017 @04:18PM (#14419825)
> Just buy or use a good IDE that helps you with tasks beyond text entry and move on.

Why can I not have both?

> IDE

Integrated Development Environment.

Why would you want your compiler and your debugger to implement your editor?

That's like selling a hammer with every box of nails. Sure, I will be using both, but I really like my hammer. The handle feels right in my hand. The balance is just right. Your hammer is cheap and clunky. It may not bother you, but that is no reason for me to use it.

Re:Helping a Million Developers Exit Vim by flukus on Wednesday May 24, 2017 @09:29PM (#14414719)
> Most of my work consists of reading text, thinking about it, running tests, reading the results of those tests

Vim is quite good at that too, you can set the make program and error format to execute the tests and easily navigate to the source of errors for example.

Re:Helping a Million Developers Exit Vim by diegoprzl on Wednesday May 24, 2017 @02:26AM (#14407961)
I think you're right. Nowadays I only use Emacs+evil for Org-Mode and languages that don't have strong tooling yet.

For me the main advantage of vi/vim is that I don't have to learn new editing keybindings each time I change editor/IDE. Vim mode is probably there and the rest I can rebind.

Another advantage for Vim/Emacs, especially Emacs, is that they are very extensible so you can actually have features that are more cutting-edge than what commercial IDEs have yet. Still I do think that the IDE package is more productive.

Re:Helping a Million Developers Exit Vim by bobwaycott on Wednesday May 24, 2017 @02:44AM (#14408009)
Everyone always makes fun of my thumb-operated trackball.
Re:Helping a Million Developers Exit Vim by rebootthesystem on Wednesday May 24, 2017 @07:24PM (#14414236)
It's kind of funny watching people who've never used one try to adjust to it. My kids grew up with them and wouldn't use anything else. They have them on their laptops too. I hate laptop touch pads, the single worst UI ever put on computers.
Re:Helping a Million Developers Exit Vim by bobwaycott on Thursday May 25, 2017 @10:38PM (#14421685)
Yeah, I mean, I try to explain the appeal, and nobody is even willing to give it a shot. I can't help but laugh when someone tells me how their Magic Trackpad thing is so much better. The precision is terrible, it doesn't improve on all the standard mouse type of constant wrist movements, and so on. Sometimes I joke that trackpads were meant for species that haven't evolved thumbs, or haven't learned how to use them. :)
Re:Helping a Million Developers Exit Vim by h1d on Wednesday May 24, 2017 @02:30AM (#14407971)
Surprising you type focused, which I agree with the content well, after 16 hours of work but it would be nice to see your table setup in picture.