
Let's stop telling programming newbies to learn Vim (or Emacs) - japhyr
http://devblog.avdi.org/2012/10/16/lets-stop-telling-programming-newbies-to-learn-vim-or-emacs/
======
BklynJay
Q: What's the best way to generate a random string?

A: Ask a first-year CS student to quit out of Vim.

~~~
sbov
A: Ask a vim user to quit out of emacs.

~~~
zmitri
C-x C-c I believe

Keep your friends close, and your enemies closer :)

------
jarin
Here's the thing about Vim or Emacs: Nobody can tell you when you need to
switch to one of them. Your heart will tell you.

~~~
maxk42
Sometimes your boss will tell you.

------
vampirechicken
You have to ssh into my machine and fix a configuration file. The only editors
on the machine are ed, ex, and vi/vim. You're dead int he water and useless to
me. learn the 22 vi keystrokes. It won't kill you. It will make you stronger.

Editors that make me take may hands off the keyboard in order to click around
in the gui to move around my files are productivity killers.

~~~
sergiotapia
>are productivity killers

Don't state this as if it were fact. They're productivity killer __for you __.
Because you have been using Vim for so long. A person who is balls deep
familiar with Sublime Text 2 or Visual Studio will be just as fast due to
experience.

~~~
mdwrigh2
> A person who is balls deep familiar with Sublime Text 2 or Visual Studio
> will be just as fast due to experience.

I wouldn't state this as if it were fact either. The biggest gain for me is
the ability to quickly and easily script my text editor to do tasks for me.
Sublime Text 2 has a macro system, but it looks neither quick nor easy to
write scripts for. Visual Studio looks like it no longer supports macros as of
VS2012.

~~~
gknoy
However, there's a huge leap in productivity between having an editor whose
keybinds you know (and can use without a mouse), and one which you have
extended with extensive macros. That's like the difference between an out-of-
the-box Emacs and SLIME.

Your Vim setup is awesome, but for a newbie to vim like me, it'll take a long
time before I'm more productive using it -- not only would I need to
internalize the keybinds and text processing tools, but I would also then have
to start adding custom scripts and stuff, in order to do other things. (run
unit tests, evaluate a block of code in an interpreter, etc)

~~~
mdwrigh2
The comparison was between someone who is skilled at vim and someone who is
skilled at Sublime Text 2. My argument is that the person using Sublime Text 2
_wouldn't_ be as "fast" as the person using vim, _not_ that the person who was
skilled at Sublime Text 2 would be as fast as me using my VIM setup, which is
what you're talking about. I agree, that would be a ridiculous argument.

------
slmbrhrt
I'm finding more and more often that the best way to teach someone about a
feature of their own favorite text editor is to threaten to walk them through
doing it in vim. Magically, they've found the plugin or option before I can
make it back to their desk with my solution.

------
DanielBMarkham
Mixed feelings about this.

I think there is another skill, somewhat related to programming, that we need
to teach before programming: text slicing and dicing.

The entire point of a programmable powerful editor is to apply text transforms
more quickly than you could with click and type. If that's important, then we
should teach it first. I personally believe it is important because of the
huge productivity multiplier it gives programmers.

~~~
evoxed
Related: I think perhaps the most valuable aspect of teaching beginners how to
use vim/emacs (in a basic sense at least) is that it isn't necessarily just
for programming. You can "practice" with just about everything you write, and
if you stick with it become even more efficient in all your other work outside
of programming. I started writing almost all of my letters and essays in vim
because it's so much faster and in one environment that I can modify to my own
needs.

~~~
esrauch
What kind of settings do you use when in letter-writing-mode? I feel like vim
is fairly useless to me for anything that isn't 80 (or 100) character max line
based, which isn't how I write letters at all. If I autowrap then its a giant
pain to reflow the text (maybe there's an easy way to do that), and if I don't
then simple navigation is a giant pain.

~~~
nprasanna87
In your vimrc(it's a single line): " <Leader>W -> Blog mode. Allows for using
vim to write long sentences and paragraphs

nnoremap <leader>W :set colorcolumn=0<cr>:set syntax=markdown<cr>:nnoremap j
gj<cr>:nnoremap k gk<cr>

------
habitue
I feel like emacs is being unfairly lumped in with vim as "one of those
powerful editors that are a million years old".

The difficulty he is describing here applies to vim/vi only (modal text
editing). With emacs the default setup has menus, typing inserts text into the
document. You can do file->save. It is newbie friendly because you can learn
bits and pieces of the powerful stuff as you go

~~~
xyzzyz
This is only partially true, as Emacs still has very nonstandard default key
bindings. I feel that if Emacs developers enabled more standard bindings by
default (i.e. cua-mode, C-o for opening files, C-s for saving, etc), Emacs
could win _a lot_ of new users, because, well, it wouldn't be much different
than gedit in terms of basic usage. Traditional key bindings could be enabled
by a single line in ~/.emacs .

~~~
snogglethorpe
Maybe, but it would also cause complete havoc, because the "standard GUI"
keybindings conflict with _enormous_ swathes of Emacs standard keybindings
(remember, some of them conflict with Emacs key _prefixes_...), and Emacs has
_a lot_ of keybindings. Once you've started to move stuff around, the
conflicts cascade, and there's simply no easy way to recover, especially as
many keybindings are made in 3rd-party packages, over which there's little
control.

Given that there's actually a rather small number of "standard GUI"
keybindings, it actually seems much more tractable to simply ask people to
relearn those. It simply isn't a huge burden compared to the alternative...

The sort of people who would be completely loathe to relearn the few "standard
GUI" bindings will probably use the mouse/menus instead anyway (and I've
observed many newbies happily using Emacs without ever touching the keyboard
except when entering text!).

~~~
johncoltrane
The answer to that mess? Modes.

------
japhyr
I teach high school math and science and once a year I teach a programming
class, which currently focuses on Python. I then mentor a few students who are
interested in following up on the class on their own.

My preferred editor is emacs, but there is no way I'd try to have people use
emacs in their first programming class. We are using Ubuntu computers, and I
am currently having students work in Geany.

Are there any other suggestions for editors on ubuntu machines, that are
friendly to new programmers?

~~~
telemachos
_If_ you want to teach someone a command line editor (that's an if, but at
some point it will be useful - at the very least as a backup), then nano or
pico (pico is often - maybe always - a symlink to nano) is a good idea.

It would be unpleasant to edit in nano/pico full time (no syntax highlighting
or indentation help, etc.), but if you _have_ to do something through ssh and
emacs or vim are still too much, they get the job done. What makes them new-
user-friendly is that they keep a "menu" of basic commands visible at the
bottom of the screen. So you can always see how to save, quit, etc.

For GUI editors, Gedit and Kate were pretty popular for (K)ubuntu and other
Debian derivatives.

~~~
sergiotapia
I agree with learning or at least being a bit familiar with nano. It's
probably the best way to edit a small one-off file via SSH.

Imagine you want to quickly change a directory path in httpd.conf, instead of
downloading the file, editing and then uploading it via FTP - just nano that
sumbitch and you're done.

I learn how to use it in about 30 minutes. That's really all it takes to get
the basics down.

~~~
bazzargh
I would disagree that that's the easiest way.

C-x C-f /ssh:user@host:/path/to/httpd.conf

... and I have it open in my local emacs, with my own settings, with colour
and indenting, and no lag when I'm editing. (this is called tramp mode)

And if I then typed M-x eshell, I'd have a shell at the directory where I
opened that file, and the nano users would start shouting 'burn the witch!'.

Other editors also support remote editing over ssh - no need to
download/upload, the editor takes care of that for you. Working this way, I
don't even have to trust that the remote server has nano or emacs or whatever
- which it often doesn't.

------
shanelja
It might just be me, but personally I don't understand what is so bad about
plain old Notepad. Everythng I've ever coded (except when at work where I'm
forced to use others) has been done on Notepad (or, if I'm feeling in the mood
to have some colours on the screen, Notepad++) and I've never had any issues.

Why spend so long worrying about your IDE of choice when they are all
effectively glorified text editors?

 _edit: I'm glad that my comment provoked such a fantastic discussion_

~~~
killface
It might just be me, but personally I don't understand what is so bad about
plain old Rocks. Everything I've ever hammered (except at work where I'm
forced to use other) has been done by Rocks (or, if I'm feeling in the mood to
have some recessed nails, convex rocks) and I've never had any issues.

Why spend so long worrying about your Hammer of choice when they are all
effectively glorified Rocks?

~~~
shanelja
A skilled artist utilizing a rock correctly can do a better job than another
person using a hammer.

~~~
mdwrigh2
That isn't an argument for using a rock. Just because Beethoven was capable of
composing incredible symphonies while deaf doesn't mean that you should deafen
yourself while composing.

~~~
shanelja
But here you reverse the burden of action, if every person was born death, as
if the metaphor is applied to reality, then surely, the others go out of their
way when they could be composing incredible symphonies all along?

------
mtoddh
One of the first reasons I ever heard for learning either vi or emacs was that
they were the only editors that were basically prevalent everywhere,
regardless what flavor of unix you found yourself on. Not so much because of
how powerful they were.

------
matthuggins
I've been coding since I was 12 (I'm now 30), and it's what I do day-in and
day-out. I consider myself to be a pretty solid programmer (Ruby being my
primary language for the past 3+ years), and I prefer IDEs like TextMate and
RubyMine. IDEs like VIM have too steep of a learning curve when you're trying
to just get some work done, and I can do anything (at least anything that I've
ever needed to do) with my IDE of choice than I can do with vim.

~~~
albemuth
No way of not sounding pedantic but neither TextMate nor Vim are IDEs.

~~~
matthuggins
Touché, you're technically correct. (The best kind of correct.)

------
robert_nsu
Using vim helped me write better (or smarter) regular expressions. I tell
people starting out with vim to stick with it and it will help them in the
long run.

------
jeffehobbs
Strongly agree. Also: nano.

------
tkahn6
Learning emacs or vim is worth it if only just so you can use it in a
tmux/screen session.

~~~
BruceIV
Agreed. And, not to start the great text editor holy war, but some variant of
vi will be pre-installed on almost any *NIX system (although it's been
replaced by nano in a lot of newer Linux distros)

