📜 ⬆️ ⬇️

Editor or IDE? Another analysis attempt

I would like to once again raise this rather controversial topic.

Since I started programming, this question does not give me peace, and numerous topics on forums and Habré have not brought clarity. Plus, it seems to me that some arguments for one or the other side were not given. And for those that are given, the priorities are incorrectly set and the context is missed.

In the article I will try to correct this omission and place a few more points on the "e".
')
I invite everyone to participate in the search for the perfect tool.

About my experience


I started programming in DOS. on turbo pascal And, for some reason, the IDE, we then used only for debugging, and that is quite rare. For writing code, they preferred to use a certain nameless edit.exe without any syntax highlighting in conjunction with Volkov Commander. And that was enough. In the same way I later did assembly and, in part, C ++.

Continuing to learn C ++, I switched to Windows and, accordingly, Visual Studio - where without it. I’ve got a version, if I’m not mistaken, from 5 to 7. After a simple editor, it was something - code generation and autocompletion caused delight. True, it was almost impossible to sort through all this generated good, but it seemed unimportant.

After a while, I moved to Linux and started php web development. Here I studied vim in parallel and used ZendStudio for development. At some point, I started using only Vim for everything - turned it, according to numerous manuals, into a small ide. He wrote his first bike CMS in php.

I note that before this programming was not the main type of my activity. Yes, I also wrote various small utilities for work, made themes for WordPress, but the main activity was administration.

As soon as I started developing professionally, I no longer have enough opportunities to vim. There was first eclipse, then netbeans, now phpstorm.

The last half-year I am heroically trying to master emacs, incl. as the main working environment.

So I have something to compare with and, I hope, my opinion will be quite reasonable and agrumentized.

IDE? IDE ...


I thought for a long time in what form to compare the advantages and disadvantages of the parties. The list for this is not very suitable, because a simple listing does not quite capture the essence of the matter. The editor and IDE are not opposites, but tools whose scope of application overlaps in a certain area. The advantages of the editor are not always the disadvantages of the environment and vice versa. For this reason, more or less structured reasoning on the subject goes on.

I will begin, perhaps, with one of the indisputable advantages of the editor - its rich possibilities for working with text and the ability to do everything without taking your hands off the keyboard. For the most part, the environment does not know how. But are such possibilities needed when writing code? When writing an article or letter, I think it's convenient to swap 2 words with one keystroke or move a paragraph up the page. But in the text of the program it is, in most cases, meaningless and requires refactoring. And you have to pay for it with either the flicker emacs keyboard shortcuts, or the no less brain-agitating commands in vim. But all this needs to be remembered! What is simply solved by a single movement of the mouse, like moving a window or changing their size, turns into a whole quest. Yes, even to select text is easier with a mouse - more precisely, faster, and you should not count how many words there are up to the place in the text. No, these functions may also be useful to the programmer, but the fact is that his time spent on actually editing the code is insignificant, so there will be practically no gain in time. But a significant complication of the tool is obvious.

A programmer spends 80% of his time understanding and moving around written code. And moving it by code, not by text! And here the editor cannot help him with absolutely nothing. The list of method parameters in the tooltip will not show, it will not allow to go to the method definition, the syntax will not control. And the IDE, even the simplest, copes with it simply and elegantly. I recently spent 10 minutes searching for a definition of one method in a project using silversearcher from emacs. It turned out that the class was defined in another module, etc. 10 minutes, instead of one mouse click! I'm emacs, of course, not experienced enough, so let it be 5 minutes, even a minute. But still the ratio is impressive.

And here the IDE shows its, perhaps, the only, but very fat plus - it is the presence of a programming language parser. The environment "understands" that it is editing the code. Editor is not. And this is autocompletion, and navigation, and syntax highlighting, and, sometimes, semantic errors. It seems to be overkill, pleasant trifle, self-indulgence. But it turns into a necessity after the size of the project increases a certain limit. And taking into account the volume of modern frameworks - this limit comes almost immediately.

Yes, on a project of a dozen files and a couple of thousand lines, this plus does not manifest itself in all its glory. The editor can also perform the same autocompletion, but it will never eliminate meaningless options. And if the size of the project is close to 100 thousand lines and consists of thousands of files, not counting libraries, then it becomes difficult to choose the right name from a mix of variable names, methods of other classes, or just words from comments (I had this in vim, I do not know, maybe corrected). Intellectual prompts eliminate the need to remember the names of the necessary functions and their parameters. Often this is just physically impossible.

Speaking of projects. In all IDE there is such a thing. Settings, resources are tied to it, you can search, etc. In editors, this is at best an open file system directory. Sometimes a little more.

Integration with the debugger in the editors also leaves much to be desired. Unit testing, logging to some extent save the situation, but, sometimes without a debugger, nowhere.

Some may argue that in modern editors, many of these functions are already implemented and are not inferior to the most sophisticated IDEs. I do not agree. First, there are no full implementations. They do not work as they should. Secondly, the installation of all this is already quite a difficult task. Yes, even the configuration of the internal functions of the editor is no longer trivial. Try, say, to include line numbering in the same emacs! Plus, often the necessary functionality is implemented by a dozen plug-ins that are unclear how they interact with each other. And often there are a dozen versions and branches that are not always compatible, we are strangely tuning, etc. You can, of course, spend a month, set everything up and install (which is also a lot of enthusiasts), but this will only bring the editor closer to the IDE level. For example, let's return to the same projects - I tried Project under vim and projectile under emacs and some more plugins. If Project still more or less meets my requirements (although in the latest version I didn’t manage to create a project at all due to bugs), then projectile left only negative impressions.

Nevertheless, editors have several areas of application where, at a minimum, they are worthy of competition for development environments.

First, they show themselves better on small projects. It makes no sense to download the IDE-combine to work with the project in 10-20 files. Easier in the editor to correct 3-4 lines.

Secondly, in some specific areas all the advantages of IDE are leveled. For example, low-level linux development. I did not do this, but judging by the structure of the code and the preferences of the developers (about 70% are emacs and clones, 25% are vim, 5% is some kind of exotic like jed), IDE has nothing to do there. All the necessary code with which the work takes place is compiled, usually in one or two files, and there is no need to jump within the entire project. And auto-completion will not help much when choosing from ten or two functions with almost identical names.

Thirdly, editors can work not only with the code. All their power can be used when working with csv or xml files. Or something else that is sometimes necessary, like an article or letter. And you do not need to relearn, look for a convenient program or memorize hot keys - everything is at hand, everything is the same.

Fourth, the ability to work with languages ​​for which there is no sane IDE. Say, with the same ruby, my environment did not help much. SublimeText was enough. Although I didn’t work with a large ruby ​​project, perhaps the IDE would show itself there.

And fifth, the notorious possibility of expansion. With good plugins, the editor becomes very convenient! Plus, the specific pleasure of continuous tuning of its main tool and the feeling of complete control over it are worth a lot.

Total


I don’t really like IDE, although it might have seemed so in the previous text. I consider them quite monstrous, with a bunch of unnecessary functions, slow and demanding of resources. And the best of them are quite expensive. In addition, I find the use of IDE relaxes, and binds to itself. The editors, respectively, are the opposite. Plus the availability and possibilities of fine tuning for themselves. At least vim and emacs. In the end, I just like them. For example, I am writing this article in Emacs.

But the industry (and the authorities) dictate their own requirements. If you do not use IDE, performance will drop significantly. But no one will give you half an hour to search for the missing comma in 10 thousand lines of code. All this should be done automatically and automatically corrected. I also sometimes like to dig into the code without any tools - but at work it is an inadmissible waste of time.

After all my trial and error, I made such a conclusion - the editor can be used for development, but with the IDE, after a certain limit, it can’t be compared and using the editor for something that you get paid for is an unaffordable luxury. Yes, if you use the right development practices, design / document the code correctly, follow the standards, you can smooth out the inherent shortcomings of the editors. But we are far from living in an ideal world, so using an IDE is a must, regardless of our desires.

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


All Articles