Emacs会让我成为一个更好的程序员吗?

Steve Yegge wrote a comment on his blog:

All of the greatest engineers in the world use Emacs. The world-changer types. Not the great gal in the cube next to you. Not Fred, the amazing guy down the hall. I'm talking about the greatest software developers of our profession, the ones who changed the face of the industry. The James Goslings, the Donald Knuths, the Paul Grahams, the Jamie Zawinskis, the Eric Bensons. Real engineers use Emacs. You have to be way smart to use it well, and it makes you incredibly powerful if you can master it. Go look over Paul Nordstrom's shoulder while he works sometime, if you don't believe me. It's a real eye-opener for someone who's used Visual Blub .NET-like IDEs their whole career.

Emacs is the 100-year editor.

The last time I used a text editor for writing code was back when I was still writing HTML in Notepad about 1000 years ago. Since then, I've been more or less IDE dependent, having used Visual Studio, NetBeans, IntelliJ, Borland/Codegear Studio, and Eclipse for my entire career.

For what it's worth, I have tried Emacs, and my experience was a frustrating one because of its complete lack of out-of-the-box discoverable features. (Apparently there's an Emacs command for discovering other Emacs commands, which I couldn't find by the way -- it's like living your own cruel Zen-like joke.) I tried to make myself like the program for a good month, but eventually decided that I'd rather have drag-and-drop GUI designers, IntelliSense, and interactive debugging instead.

It's hard to separate fact from fanboyism, so I'm not willing to take Yegge's comments at face value just yet.

Is there a measurable difference in skill, productivity, or programming enjoyment between people who depend on IDEs and those who don't, or is it all just fanboyism?

#0

First let me say, I am a self professed true believer in the cult of Emacs.

That said, the blogger is nuts. You write in what you find useful. I find that Emacs helps me, mainly because I spent my college years pre-paying the start-up cost of learning how to modify it to suit my needs, and modifying myself to its needs.

But other people do things differently, and as they say "That's OK".

#1

He (Steve Yegge) has elaborated on this, in bits in pieces, in other postings of his. http://steve-yegge.blogspot.com/2008_04_01_archive.html is probably the most comprehensive, but the info is buried in there since it's on a tangent to the main subject.

I guess to summarize: the programmers who are merely good or competent will pick up an IDE and get to know it really well, and maybe do decently enough in it, but they'll restrict themselves to what the IDE provides for them. In other words, they adapt themselves to the IDE. The great programmers, on the other hand, will adapt their environment to suit themselves, in such ways as writing scripts or their own tools, or extending their tools. And to that last point, not only Emacs is the most extensible environment there is, it is also the easiest environment to extend there is, and it is the environment where you reap the most benefit from extending it--your extensions integrate into Emacs like they are stock features, and so your future extensions may build upon your previous ones (positive-feedback-loop kind-of thing).

#2

The best programmers use vi or emacs, because the most experienced programmers are the best, and 20 years ago, there wasn't much choice except vi and emacs.

After having started with vi (ca. 1987) on a machine with a very slow text terminal, I converted to (GNU) Emacs after a few years (on a faster machine), and used it almost exclusively for nearly 10 years.

Emacs was the first truly integrated development environment - the whole edit/link/compile cycle could be controlled in emacs, and you could roll your own for whatever compiler you used.

Nowadays, IDEs such as eclipse are even better integrated (to be honest: emacs sucks at graphics), but Emacs is still one of the best environments for "pure" text editing.

#3

Improving your clear thinking and problem solving will make you a better programmer. No program can do that.

Using a better hammer won't help me build a nicer house unless I know how and why. ;)

#4

Yegge needs to meet Bill Joy. Not only is he one of the great programmers in the world, he also wrote large chunks of vi. In vi.

Short Shameful Confession: After 20 years of using vi (and vim/gvim in recent years) for everything, in the last year or so I've started using Eclipse for java editing (and Thunderbird for email), although at my current job my machine has so little memory that I usually use vi except when I need the debugger.

#5

Is there a measurable difference in skill, productivity, or programming enjoyment between people who depend on IDEs and those who don't, or is it all just fanboyism?

Let's just narrow this down to Visual Studio vs. Emacs---the question is too broad otherwise, and I suspect most people (at least here on StackOverflow) are familiar with those two. [I am, and I use and prefer emacs]

Next, let's break the three components of the question down.

Programming enjoyment boils down to primarily liking programming in itself, and secondarily to not have annoyance factors pop up when you do it. Using tools that you struggle with is going to subtract from the enjoyment. So, I would guesstimate, the enjoyment is likely maximized by using tools you like and are familiar with.

Of course, once you do get familiar with a new tool, you may find that you like that tool better, and thus will like programming more if you do it with your new favorite tool. It isn't clear to me that people in general will like VS over emacs (or vice versa) when they know them both well.

Next, programming skill. If there's any connection between skill and choice of VS/emacs, I think it's skill causing choice, not choice causing skill. None of {VS, emacs}, in my experience, seem to make me learn anything about writing better code.

A good tool may make me able to write the same code (and thus same quality of code) in smaller amounts of time; if we assume that productivity = quality of code `times` code per time, then it stands to reason that any editor that'll let you write good code in less time is a productivity boost.

I may be too unfamiliar with VS, but here I think emacs has some strengths that I haven't found in VS. It may sound ridiculous, but something as simple as cursor movement with Ctrl-[fbnp] is a real boon---it means you don't have to move your hands to the arrow keys. Another thing: you can do a search or replace which includes newlines, which I use often enough that I'd hate to miss it.

Another thing I like is the ability to embed a shell in my editor. In my experience, it's much more valuable on non-windows platforms (and my first "programming" experience, IIRC, was writing DOS .bat files, so I'm not just a flaming fanboy), but on those platforms it's a big win. It makes emacs "integrate" with "everything" (file search with find/locate, text search with grep, version control with svn/git/hg/..., you name it).

Final verdict--should you learn emacs or not? And is it all fanboyism? If you got the time, I'd say it's always worth learning new ways of doing the same thing, because the new way just might turn out to work better for you. And I encourage you to not reject it for what it appears to be when you're all new to it. In that sense, it's like switching to the Dvorak keyboard layout: you're slower at first, but once you get up to speed you're likely to be at least as fast as on qwerty, and more comfortable. I recommend the same approach to learning new (programming) languages as well: because you don't know the vocabulary (standard library), saying things is hard, but the reward is still there in the horizon waiting for you.

#6

With the quoted text beginning "All of the greatest engineers in the world use Emacs," I wouldn't take it at face value either. Does he know all of the world's greatest engineers? Is it the same list of world's greatest engineers that you or I have?

Once learned, a powerful editor like EMACS or vi will make you more efficient, or at least more efficient if you happen to be caught without your favorite IDE.

It's the "once learned" part that's the killer. It's a lot of work and practice to use these tools productively, and it's very tough at the beginning.

#7

I'm an Emacs fanboy, personally, but Emacs is just a tool. It won't make you a better programmer any more than a super-fancy pen will make you a better writer.

The clarification that "great programmers" adapt their environment to themselves may have some merit, but lots of tools can do that (e.g. vim and SlickEdit), so there's nothing particular about Emacs in that regard.

I think what's most likely true is that "great programmers" are passionate about programming and people who are passionate about it tend to find tools that help drive that passion. Emacs (and vim and SlickEdit, et al) is such a tool.

#8

I don't believe there's a difference, it's more a matter of preference.

However what I've noticed is that the longer you've coded, or the lower-level you've coded, the higher the chances are that you've used emacs or vi.

#9

While the IDE's have gotten a lot better in the last decade, they still contain the programming in a little safe "bubble", far away from some of the uglier details. What tends to happen is that this increase in abstraction allows for more programmers to do more, with less knowledge. That, of course, doesn't apply to all programmers, but easier tools do bring programming to a wider audience.

More knowledge of lower-level tools, often translates to more stability in the code, since there are less chances of "going against the grain" accidentally. It's unfair to just list out EMACS as being the only leading indicator, since it comes from a whole range of languages and tools, and really is more about the depth of understanding, not the specific technology.

Way back, you either learned VI or EMACS on the UNIX boxes or you specialized in PCs (OK, there was VMS, CMS, AS400, etc. too, but those were older technologies). Both streams attracted very keen people, but the UNIX guys tended towards wanting a sophisticated solution, while the PC guys just wanted it done quickly. The cultures were very different.

#10

IMHO IDEs tend to be optimised around a specific platform or language or OS: Eclipse JDT is great for Java, Visual Studio is C++/.NET-centric, etc. They help productivity a lot (again IMHO) if you're only working on that platform, but if you change platforms you have to basically learn a new IDE (or at least a new set of plugins, views, perspectives and I don't know what else for Eclipse).

The advantage of knowing emacs, or Textmate, or vim (my personal preference), or any generic editor, is that the skills you acquire in that editor apply regardless of what platform you're writing for. They're optimised for editing text, and once you master them, you can edit text very efficiently in any language.

There's also Yegge's assertion that great programmers adapt their tools to their working style rather than vice versa. I think this is a win for generic editors, because you customise one editor, rather than having to work out how to adapt four different IDEs to all behave the way you want.

#11

I'd argue that the best programmers tend to be the ones that will take the time to customize their environment, making it faster/easier to perform the tasks that they are likely to do. Emacs is one of the most powerful editors when it comes to customizing your environment. It has a steep learning curve but, once you're past that, there's virtually no limit to what you can make it do for you.

Someone once said that the best programmers are the lazy ones; the ones that, once they need to do something more than once, find a way to automate it so that it takes less effort to do. Emacs allows you to be very, very lazy ;)

#12

I've used IDEs from the very beginning (arguably; having started with QBASIC), and for many, many years. I've now switched almost completely to VIM (in diverse flavours) for all my development work and I don't regret it. My productivtity has definitely increased.

Of course, nothing will replace the Windows Forms designer from Visual Studio. But compared to VIM (and Emacs, I'm sure) the text editor inside Visual Studio is really lousy. Once you harness the raw power of the console and the GNU developer tools (by which I mean make, GCC, binutils and gdb, and then some) you'll notice that these tools may look primitive but they're just the opposite, and actually offer all the tools that an IDE provides (well, except for the forms designer).

It's just that you've got a very steep climb ahead of you when you first start using these tools and the incentive may be small. I was lucky enough (?) to be forced to use these tools so I didn't have a choice that I could weasel out of.

#13

For me the main reason I would choose Emacs over an IDE is because it allows me to do everything from just my keyboard. This is nice in that it saves some time for when I would normally use a mouse. Also since I find myself very mobile I have a tendency of having my programming "groove" interrupted due to using my slow touch pad. In addition its customization makes it shine over some IDEs for me. However if you find yourself programming fast enough with an IDE then I would say the learning curve of Emacs is not worth the trouble.

#14

Personally, I feel that you should use whatever makes you more productive. If you don't have the time to invest in a project to sit and learn Emacs, then it's probably not the best use of your time at that point.

I do, however, feel that it is a good idea to get to know other IDE's when you have ample time to do so.I use Visual Studio in my day to day work, but at home I use Eclipse for small projects and have used Emacs as well. At the particular point where I considered using Emacs, my effort was better served getting actual work done than slowing myself down wrestling with Emacs.

I think to a certain extent it's absurd to think that all of the best programmers use Emacs. There are many amazing programmers who aren't as popular (or as vocal, perhaps) that don't use Emacs.

#15

I started using Emacs about a year-and-a-half ago because it was the confluence of several wants -- wanted to work with regular expressions (in an editor that supported them), wanted to learn lisp, wanted a better editor.

Editing my code with regexes taught me a lot about finding patterns in the code. The keystrokes took a while to get used to, but I fly a lot faster without the mouse.

Emacs gave me the ability to keep work with my notes and coding in the same application -- minimal context switching means minimal brain-switching, and I can keep focused on the task at hand.

#16

No. Good code makes you a better programmer.

That said, good text manipulation is key to efficiency. Either vim or emacs will change how you work with text -- both are proven effective but are almost at odds with each other in terms of style. Also, this debate is rather old (back to the 80's and 90's where text -> compiler was key), so there are many other text editors and/or IDEs that can help you be the best programmer you can be.

#17

No. If you believe using emacs makes you a better programmer, you are confusing cause and effect.

I do use it daily, though. I find that I'm more productive with emacs+maven than with Eclipse for java development (although I do still fire up Eclipse every now and then to do the occasional refactoring or debug session).

These are my reasons:

  • The actual text editing experience in emacs beats everything else. It's amazing how fast you can accomplish so much using only your keyboard. Eclipse is more mouse-oriented, and when you type you encounter lots of irritating snags.
  • Being able to customize emacs using elisp is incredibly powerful. I'll go so far as to say that if you're not taking the time to learn rudimentary elisp and customizing your environment you're simply wasting your time.
  • There are extensions for practically anything you could ever want to do in a text editor.

#18

I think Emacs can make you a better programmer, albeit indirectly. I think Emacs got me to actually write in a functional language (Elisp) which has me interested in other functional languages (Clojure) which I'm told will make me a better programmer. That said, I suppose time will tell.

#19

Is there a measurable difference in skill, productivity, or programming enjoyment between people who depend on IDEs and those who don't, or is it all just fanboyism?

I don't think you could really get an answer to that. There are so many different ways to measure skill, productivity and programming enjoyment - and all of them are probably very subjective and/or can't be broken down into ONE thing causing it or not.

It's still an interesting question tho.

My personal belief is - it depends on the programmer :)

G-Man

#20

One of the great features of emacs is that it can handle pretty much any file type you throw at it, of any size. Admittedly, if you're opening a crazy huge encrypted file, it won't necessarily be useful but it will open. Most editors (and IDEs) will give you major heartache if you hand them a file that's too big and / or not one of their expected formats.

Try opening a 1 Gig file in Notepad for an example.

I started using Emacs somewhere around 1980 and it has always been a tool in my toolbox. It's not the only tool but it's always something that I can turn to and know that I'll be able to get some useful work done.

Obligatory inflammatory comment: On the other hand, I have nothing good to say about vi. I've always felt that vi would happily kill me and sell my organs just out of spite....

In real life, I use Netbeans for almost all forms of development and I use emacs every now and then to make a quick edit. There's almost nothing out there that is quite as convenient as emacs (for me) when it comes to getting something crazy done right now.

Anybody else ever have to edit static strings in compiled binary executables? Is there a better tool for that sort of thing than emacs? It certainly works for me.

#21

I don't think it would make you a better programmer, but when you have THAT level, you will most likely use emacs ( or vi )

: - /

The good thing about those two ( I have never used emacs before, but I still use vi for the most mundane task ) is the fact, they don't interrupt your train of thought, you don't have to take your hands out of the keyboard to grab the mouse, and hunt in the file menu for the correct option. You just, keep writing. Inside your mind you say something like: "Replace all the occurrences of this word for that", press enter and continue with your work.

Besides, I don't think they use emacs is their only tool.

Would it make you better programmer? Probably not. But when you have that level of expertise, probably you will like how fast can you code using those tools.

#22

No.

Discipline, critical thinking and a desire for self-improvement will make you a better programmer. Your tool set, while a major factor in your productivity, won't create genius.

If you don't like emacs or vi, don't use them. By making the conscious choice not to, you're shaping your development environment to fit your own needs and work practices. In any case, you're entitled to use what you like - and ignore anyone who's foolish enough to berate you for the tool you use to write bits to disk - it's the bits that matter.

Note: "Tool set" here means, literally, the "brand" of tools - specific editors, compilers, etc. Conceptual tool sets, e.g. the use of version control, unit testing - all in general - are a part of the self-improvement process.

#23

I know you didn't ask this, but one thing learning emacs (unexpectedly) improved for me was manipulating a command line. Before I learned emacs keybindings I used to move the cursor and navigate history using the cursor keys because I didn't know any better. It was something of a lightbulb moment when I realised I could use backward-word, move-beginning-of-line and backward-kill-word (which I have always bound to C-w, as Stevey suggests) in bash (M-t is often useful too, and most impressive to those who've never seen it before).

I do quite a lot of work on Solaris, where the root shell is "the posix shell", and does not have emacs bindings by default. I find that my fingers now type exec bash of their own accord, every time I log in, so much faster do I feel with the now-familiar editing commands under my fingers.

Must admit though, I still find Knuth's books hard going (though worth it) - so I don't think it's magically improved my programming.

#24

Emacs made me more efficient at text manipulation and filesystem navigation. And since both these things are involved when I program, it's made me a more efficient (thus better) programmer.

#25

Being able to use some customizable editor allows you to do nifty things, but emacs in particular isn't necessarily the Very Best One Possible. I'm a SlickEdit user myself, I do all the same weird half-automated stuff with it that emacs is famous for. I've seen people do similar things with vi and various Windows-based editors.

So, yeah, socket sets good, but arguing that Craftsman makes the One True Socket Set is kind of dumb.

#26

Mastering the Emacs key bindings and its built in functions will allow you to manipulated text faster than IDE's such as Eclipse or Visual Studio.

Don't take my word for it, check out these videos of pros using Emacs.

Once you get to a decent level in Emacs you can effectively edit any language: Java Script, Java, Ruby, Python, HTML, C, C++, etc.

Getting started with Emacs is a pain in the butt, the out of the box experience is worse than bad. Emacs default configuration does not expose the Emacs newbie to the more powerful features (hippie-expand, etags, yasnippets, etc) of Emacs. I suggest started with the Emacs Starter Kit dot files.

Another reason that Steve Yegge claims that the world best programmers use Emacs, is elisp. Elisp allows the experienced programmer the power to easily expand Emacs. Writing an extension in Eclipse or Visual Studio is significantly harder than writing a quick function or even a new minor mode in elisp.

#27

I believe its a large misconception that using these text based editors such as VI and Emacs are looked highly upon or needed to become a "great programmer". I always felt IDE's are mor e powerful then they use to be, and it truly comes down a preference and style.

#28

Disclosure: I use emacs most of the time.

I don't think one has to necessarily choose between using emacs or IDE. You can have 'emacs' in your IDE. With emacs, once you have finger-memorized the key-bindings you can be very productive and you will feel powerless with any other editor. But if many --- sadly not all --- of the emacs key bindings are available in your IDE then your productivity will markedly improve and you don't feel that the time you spent learning emacs was wasted.

I tried the emacs plugin for eclipse and I found it to be quite usable. Ofcourse it is not perfect. But you get all the benefits of using an IDE like code completion, refactoring etc. I hope that this plugin is improved to provide more emacs functionality.

Regarding emacs, sadly, it has not kept up with the times and a programmer will miss out a lot by sticking with it.

However, if you happen to program in scala and are an emacs lover you are in luck as you can use ensime package for emacs and get most of the IDE functionality --- highlighting of syntax errors, code-completion, package browsing, type inspection, refactoring, debugging etc.

#29

I used emacs in college. that was about 16 years ago. I haven't looked back. While I wish I could still be comfortable with emacs, the truth is I am quite productive with my MS IDE.

the text you posted is just a troll. Yep. No other reason for it than to start a religious war.

#30

I began with emacs but switched to vi which to me is more elegant because of it simplicity. Also if you ever are stuck in single user mode, ed commands are a subset of vi commands. I don't know if emacs can handle that.

So in that regard I think vi makes you a better programmer..

#31

I'd say that he's at least somewhat right. As others have noted, the editors in IDEs are sort of limited compared to either vim or emacs. At the same time, both vim and emacs are available, when there's no chance of having a full-blown IDE working (over ssh sessions for instance). And yet another thing is not having to reach for the mouse. It trully is a killer feature - one can easily do things at least twice as fast. You won't, however, benefit from this, unless you're at least a decent typist (which, BTW is another point that Yegge is making quite clearly on his blog, you've gotta type well).

#32

The comparison between Vi and Emacs sounds like the comparison of GNOME and KDE to me. Vi (and its dialects/implementations) are simple, no-frills, easy-to-master, scriptable, extensible, pretty much universally available (on all Unixes) editor. Emacs on the other hand, IMO takes a harder way to do the same things. It takes time to master, but I guess since THE great programmers have used it, I feel great too after I have mastered it :-)

But, to get the job done when I have text based editors, Vi is definitely easy to get started with. Perhaps, Emacs ultimately motivates you to learn Lisp, which will definitely change the way you program. That is a indirect effect, IMO.

#33

No

We all walk different paths in life, we look at problems from different angles.

To be a great programmer the editor can't help you be better, other things make your programming skills better. But please note that the wrong tools that don't help you can actually hinder your own evolution as a programmer.

Or if we take the example of a carpenter, a great hammer can't make a great carpenter any better, but a bad hammer can stop him from doing his best.

/Johan

#34

Well... For me, it's a matter of productivity and enjoyment.

All the things you mentioned, like intelisense, integrated debugger and etc can be added to Emacs. And they can be added to it according to your taste. You end up with an environment built to suit your needs. This boosts productivity because it allows you too make the functionalities that you use the most more easily available. This also boosts your enjoyment because you can modify your power-process and thus get a better awareness of it, what ends up also boosting your productivity because you are enjoying more what you are doing.

On plus, you get a functionality that ain't available in visual tools: decent keyboard support. There's not a single visual IDE that I tried where the keyboard support would be decent. The mouse is slow to use. I want an expert's interface. Not "an interface for the grandma." An IDE is meant to be an expert's interface. The mouse is not an expert's interface for programmers. It is a decadent and time-consuming peripheral that allows you to interact with a program that you are seeing for the very first time.

I think that you should give emacs another try... I have some tips to start:

M-x allows you to enter commands in the minibuffer

Useful commands:

  • apropos: lists all the commands related with a certain string
  • describe-function: describes what a command does
  • where-is: discovers the keyboard shortcut for a given command
  • global-set-key: associates a custom shortcut to a given command

Useful Keyboard shortcuts:

  • C-x b Selects one certain buffer
  • C-2 Splits buffer horizontaly
  • C-3 Splits buffer verticaly
  • C-o Selects other buffer when they'r split
  • C-0 Unsplits buffer
  • C- is where you should define your custom shortcuts.

Useful add-ins: support for ctags. They allow you to jump to Function/class definitions.

  • ido-mode - better completion in the minibuffer autocomplete mode
  • cua-mode - windows-like cut copy paste undo
  • pc-selection-mode - shift-arrow selection

#35

"The text you posted is just a troll. Yep. No other reason for it than to start a religious war."

I agree with the quote.

Anyone who believes that the true added value of a programmer is in the editor that that programmer uses, is an idiot.

Anyone who believes that the true value of a truly valuable programmer can be diminished by giving that programmer the wrong editor, is an idiot.

(Oh yes, I might include an exercise in formal logic here - add truth values to make these propositions consistent with common logic :) FORALL programmer : good(programmer) ===> usesEMACS(programmer) FORALL programmer : usesEMACS(programmer) ===> good(programmer) (FORALL programmer : good(programmer) ===> usesEMACS(programmer)) ===> (FORALL programmer : usesEMACS(programmer) ===> good(programmer))

(And as for the religious warfare :) All truly valuable programmers were raised on ISPF, not EMACS.

推荐文章

在MediaElement中重复视频的最简单方法是什么

在MediaElement中重复视频的最简单方法是什么

推荐文章

有很多dll的应用程序是一件坏事吗?

有很多dll的应用程序是一件坏事吗?

推荐文章

有www或没有www的默认URL的优缺点是什么?

有www或没有www的默认URL的优缺点是什么?

推荐文章

从Clojure调用java函数

从Clojure调用java函数

推荐文章

输出sql语句已分组

输出sql语句已分组

推荐文章

苹果推送:它需要一个应用程序吗?

苹果推送:它需要一个应用程序吗?

推荐文章

Paypal IPN返回HTTP/1.1 200 OK

Paypal IPN返回HTTP/1.1 200 OK

推荐文章

WPF,在TreeView中显示属性值而不是节点名

WPF,在TreeView中显示属性值而不是节点名

推荐文章

ASP.NET:自定义控件重新加载整个页面

ASP.NET:自定义控件重新加载整个页面

推荐文章

Python regex字符串到单词列表(包括带连字符的单词)

Python regex字符串到单词列表(包括带连字符的单词)

推荐文章

谷歌地图富商V3

谷歌地图富商V3

推荐文章

WCF Web服务元数据发布禁用错误

WCF Web服务元数据发布禁用错误

推荐文章

如何计算记录输入后的天数?Android、SQLite、Java

如何计算记录输入后的天数?Android、SQLite、Java

推荐文章

在for循环期间从Python列表中删除内容

在for循环期间从Python列表中删除内容

推荐文章

db4o字段已索引,但未用于查询

db4o字段已索引,但未用于查询

推荐文章

重定向https://to http://bypass the“Add Exception”页面

重定向https://to http://bypass the“Add Exception”页面