Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it worth learning to use Emacs for web development

Tags:

emacs

I have never used Emacs before and the first time I tried it I was so repulsed by its interface which seemed not very user friendly . But since then I have heard a lot about it improving productivity and this has rekindled my interest . But is it true for the case of web development as well? for the likes of php,python,javascript/jquery etc . How good are the code completion features?

Please suggest some resources to get me started in the right direction.

like image 563
abc def foo bar Avatar asked Dec 08 '10 05:12

abc def foo bar


People also ask

Is Emacs good for web development?

The answer is yes, Emacs is very good for web development, especially if you spend a little time to configure Emacs.

Is it worth using Emacs?

Short answer: Yes. You should learn either Emacs or Vim. Get comfortable with one before you tackle the other, though; they're quite different and they're both tools that you can spend years on without hitting the limits of their functionality.

What is the point of using Emacs?

Why Emacs? Emacs helps you be productive by providing an integrated environment for many different kinds of tasks: All of the basic editing commands (and there are lots of them) are available no matter what you're trying to do: write code, read a manual, use a shell, or compose an email.


1 Answers

I'm a bit of a religious user when it comes to Emacs so please take this with a few bags of salt. I'll try to state my reasons for using Emacs (including for web development).

Emacs' primary strength is it's extensibility and the fact that at it's core, it's a lisp interpreter with a bunch of primitive functions useful for text editing and display. This makes it "programmable". You can customise it almost endlessly.

This has spurred a number of libraries which do (common) things like code completion, source code browsing, test harness integration, refactoring tool integration, version control integration etc. If a developer working on a project is an Emacs user, it's not uncommon to see her adding something to her project just to get it to work well with Emacs. The extensibility has also spurred a number of less that conventional libraries like mail clients, web browsers, IRC clients, music players etc.

Many Emacs users keep most of their work (except for maybe their browsers) inside Emacs. This allows them to use the same keystrokes and high level techniques for everything that they use. I myself use it for my daily coding, for my email, as my PIM and a bunch of other things. I can for example, while working on my code, just write something like "TBD" as a comment somewhere and let the PIM part remember this as a TODO item next time I open the editor. I can also for example while coding simply switch to another "buffer" (the emacs term for windows) with an IRC client and ask questions I might have to other people who are online. This makes me quite productive and quick. Also, the keystrokes are almost the same on a large number of command line UNIX programs (like my shell etc.) which helps me do my work faster.

Another advantage is that Emacs is old. People have tweaked and polished it endlessly and still do. The result is a set of commands for editing that I didn't even know that I needed. Things like "capitalise word" to make the first letter of the word my cursor is on upper case sounds trivial but while you're editing, it's quite useful.

Being extensible, Emacs has "modes". These are environments for specific programming languages. Indentation rules, syntaxes, completion etc. will change depending on the mode you're in. There are modes for almost all modern languages and they provide substantial help while editing. You have things for javascript, php etc. which help you while coding in those languages. There are also web specific tools (e.g. Emacs can talk to MozRepl so that you can refresh you browser and things while editing). People write modes all the time for what they want and it's not too hard. I recently started using jekyll to maintain my blog and wrote a mode to make my life easier). The modes add functionality but at a base level are the same (e.g. same keys to delete a character, move forward by a sentence etc.). I like this because I don't have to learn a whole new set of keys and get used to them just to code in another language.

That being said, Emacs is a tool for a different kind of developer. Most hardcore Emacs users (and there are quite a few famous ones out there) don't use many IDE type features. They usually like just a window (Without toolbars, menu bars and all that) so that the real estate for code is maximum. If you're used to leaning on a feature heavy IDE to do your work, Emacs might not be the right tool for you (I think this is what Trey meant in his comment). If however, you want a programmers editor that stays out of the way and let's you get your job done with minimum hassle, it's something you should definitely try out.

Okay, resources. The first thing to do is to start up Emacs and type Ctrl-h t. This gives you a "hands on" tutorial you can use to learn the editor basics. Once you're done with that, you can read the fine manual at http://www.gnu.org/software/emacs/manual/html_node/emacs/index.html. Once you're happy with that, you can read the Emacs lisp tutorial and start extending and customising Emacs as per your wishes. The EmacsWiki is a great place for tips, tricks and docs as is the Emacs IRC channel.

All the best!

like image 128
Noufal Ibrahim Avatar answered Sep 30 '22 10:09

Noufal Ibrahim