📜 ⬆️ ⬇️

Why Emacs?

Almost every programmer who loves his work at least a little and is not tied to a specific programming language will sooner or later come to using Emacs ... or vim ... or STE ... or even one of the many text editors.

Actually, why Emacs? The first reason and the most important - I like it, for reasons that are less compelling, but more objective, welcome under cat.

In the process of reading this article, users of other editors may want to exclaim that this is also possible in their editor. This is true - and this is great, but it doesn’t matter - in the end, every user will still choose an editor for himself.
')

What it is?

Leaving aside the jokes, Emacs is a text editor. Text editor with great opportunities for expansion. Many editors are more or less extensible, in the case of Emacs, the degree of extensibility is important. It was she who distinguishes him from many others.

Part of the editor is written in C - this part is responsible for the basic interaction with the OS, window drawing, input-output. Almost all of the code responsible for working with text is written in elisp, or it is a wrapper for C-functions that can be called from the same elisp.

This approach allows you to make anything from Emacs — an email client, a browser, a terminal, a wordpress client, an interface for MySQL, and much, much more. Emacs, being a text editor, is also a powerful platform for building applications.

Another important difference from most extensible text editors is that you can change the behavior of Emacs on the go — you can rewrite the function to switch between tabs so that it does not display .txt files in the list of tabs without restarting the editor. You can copy the code of the plug-in that was found on the Internet, and which, as you think, you need only once, into the temporary buffer (tab), execute it and thus get all the functionality into the editor. Or you can slightly edit the plugin, execute it - and you will immediately have your own version, which is necessary for you.


Who doesn't need Emacs?

If you are programming in Java or C #, then most likely Emacs will not give you the same opportunities for working with code that you are used to. If you're working on supporting a large project, where most of the work is refactoring, then Emacs won't help you either. If integration with JIRA, GitHub, or a fun debugger is more important for you, then again - you do not need Emacs.

At the same time, there is still a significant number of people who write code for the indicated languages ​​in Emacs.

If you have a continuous desire to refactor trivially, fighting for code perfection, for example, rename variables, change class hierarchy, method interfaces, etc. - Emacs, too, you probably do not need. But some serious support for refactoring exists today well, if for half a dozen languages, and if your language is not included in this number, then why not try Emacs?

There is an extensive category of people who work as programmers, but who are not interested in programming. They come to work, write code, learn new technologies as needed, but programming for them is only a way of earning, their interests and hobbies are different. Well, they do not need it all. When they leave the office, they forget all the work and live a normal human life. If you're one of those people, you just don't need Emacs.


And who needs it?

If you belong to one of the following categories of people, then you should try Emacs (of course if you are not already a happy user of a similar editor):

















Emacs Myths

1. Emacs is deprecated.

Emacs has the same features as other text editors, and even surpasses many of them. The releases are released regularly, the number of extensions on the githaba and their forks only multiplies. The developer mailing lists regularly hold discussions on the topic of cleaning outdated code that no one uses. The cleaning itself is also carried out. Virtually all the features that appear in popular IDE or other editors are quickly implemented by the community and under Emacs.

Nevertheless, you can easily get into the team, where you will be despised for using a text editor instead of a serious (tm) IDE. But this is more of a team problem, not Emacs.


2. Emacs is not suitable for development in modern conditions.

Emacs has debugger integration for many languages. Code navigation is also present. This is enough to write applications of any complexity, while your productivity will not fall compared with work in the IDE, with the exception of Java and C #. These 2 languages ​​are a unique example of when guessing - is an IDE being created under a language or a language under an IDE?

It is quite true that Emacs "does not understand" that the code is in front of it, and not the text. Therefore, you will not have type checks, “smart” auto-completion, too (well, that is, sometimes it will be - for some languages). Forget about viewing the documentation directly in the IDE, although okay - for some languages ​​there is such a feature. No smart refactorings. Warnings and advice, except those that are capable of issuing a compiler or interpreter, also will not.

However, this will not prevent you from writing good code. And also write code quickly and efficiently. Generally, if you use a full-fledged IDE instead of Emacs, your productivity grows significantly, your work must be very, very specific.

I conducted an experiment - I imported a current PHP project of 400,000 SLoC into PHPStorm and tried it for several days. After that, I returned to Emacs and ... the only useful one I found was a function that was in the IDE, but was missing in Emacs and was added to it after a few minutes of googling. This does not negate the fact that PHPStrom has a bunch of things that are missing from Emacs. Another question, and an important question, is this feature necessary for productivity?

Everything described above is my subjective opinion, but, on the other hand, I did not manage to find reliable research on how IDE improves the productivity of work compared to a good text editor. Maybe you are more lucky.


3. Emacs is hard to master.

It is not complicated, but it has a huge number of different functions that have been added for more than two decades of its existence. Mastering the editor takes a week - during this time you learn the basic editing techniques and get used to the shortcut keys. This will be enough to feel comfortable while working.

The second stage is the choice among the many functions that you need to work. It can take months and even years. But most likely it will never end - new extensions are constantly coming out for Emacs that may be useful to you.


What to strive for

In order to feel the spirit of old school omnipotence, I recommend to watch the following videos:


However, this is all not important - you can only feel the full effectiveness of Emacs yourself, this cannot be conveyed through video. As a teaching video for the night, as well as to consolidate the understanding of the essence of Emacs, you can watch a series of lectures from our compatriot:



Conclusion

I deliberately did not say anything about the other popular editors with a similar ideology - Vim, Sublime Text Editor, Notepad ++. Let the users of these editors themselves better tell about their advantages. And today you can try to start learning Emacs - at least to make sure that it does not suit you. Well, if you have already chosen another editor, then all the more try - you need to know the enemy by sight.

Source: https://habr.com/ru/post/190790/


All Articles