Why IntelliJ IDEA is better than Eclipse

The main difference between IDEA and Eclipse The

reason IDEA is more astute is that IDEA understands context. That's why JetBrains employees named IDEA intelligent. What is its real meaning? IDEA retrieves your entire project, analyzes all the content of the project, and even builds syntax trees. Thanks to it, IDEA knows where you are and what to do there, no matter where you place the mouse at any time.

Still not sure? Don't worry, after listing a few examples below, everything will be clear.

This understanding of context manifests itself in many, many ways, and the following are just some of them.

1. Debugging

Usually in the debugging process, we want to ask for the value of some expression, in Eclipse you need to select this expression, it is very important to select the whole expression, otherwise you will not be able to find its value. Then, you can use Ctrl+Shift+I to see the value of this expression.



With IDEA you don't need to select anything, you just move the cursor to your expression and press Alt+F8. IDEA will have a good understanding of the expression you may need, and then display a dialog window with some suggested parameter variables it gives. You can also edit and get the value of this expression immediately in the dialog. Quite convenient! After trying this feature, you won't want to debug in Eclipse anymore.



Basically it will let you do the same thing on both IDEs, but using IDEA is much easier and faster. To this I seriously express that the difference is too great: like heaven and earth. Autocomplete, syntax highlighting and everything you need is provided in a small IDEA dialog window.

2. Auto-completion

Auto- completion makes IDE better than notepad, and IDEA, which can perceive context in this field, has made a qualitative leap. For example, we start with the following line of code:




?

1

assertElement(By.id("errorMessage"), vi


Now what are the options we want to find starting with vi.

How does IDEA do that? Without waiting for any key press, it immediately understands that assertElement needs an instance of the Conditaion class as The second parameter, and in the Condition class there is a static variable called visible. IDEA will directly suggest the only valid option.



However, what will Eclipse do? Alas, it doesn't understand the context, it doesn't know where the cursor is The second parameter of the assertElement method. So when you press the "holy" Ctrl+Space, Eclipse will simply show everything in the global that starts with the letter vi.



In a beautiful popup I see a lot of beautiful Useless information highlighted in formatting specifications. :(

3. Refactoring

Professional programmers can efficiently use the refactoring features provided by IDEs. All modern IDEs provide many impressive refactoring features. But again, IDEA's refactoring features are also very smart. They can read what you need, and then provide you with the most suitable solution for different situations.

For example, suppose we have an assertErrorMessageIsHidden method:




?

1
2
3

public void assertErrorMessageIsHidden() {
  assertElement(By.id("errorMessage"), Condition.visible);
}


We take the string "errorMessage" as a parameter to this method.

Let's start with IDEA, place the cursor on any string "errorMessage", press Ctrl+Alt+P (for "parameter"), IDEA will suggest which expressions we might be able to use the substring as a parameter.



When the "errorMessage" expression is selected, IDEA will suggest some possible variable names that can be used for this parameter.



Monthly Surprise

You will often be amazed at IDEA's cleverness, such as suggesting the names of some options for you. It takes into account method names, variable types and even variable values, as well as other such variable names, the same as the name you gave this variable before, except ignoring your zodiac sign. Trust me, you'll want to say "Wow, IDEA can do this too?" I'd say at least once a month.

Now let's see how Eclipse makes recommendations.

Don't forget to select the entire "errorMessage" expression. Selecting a "recommended parameter" refactoring function (via the menu, no shortcuts available) yields almost the same result, however, Eclipse doesn't give you the option to prompt for variable names, but thankfully it doesn't.



Conclusion

If we choose Java IDE, Intellij IDEA is definitely better than Eclipse. It's not just a matter of personal preference. Objectively, IDEA is better. It is that you can quickly write and modify code. It gives appropriate name hints to find suitable methods. It guesses what you want to do and how you want to name it without requiring you to specifically choose the expression. IDEA foreshadows and gives you hints.


PS Remarks

I think IDEA is really better than Eclipse as a Java IDE. If you consider their other capabilities such as being used on other IDEs such as C++, Python, Scala, or as a platform for building desktop applications, Eclipse is likely to come out on top.

In fact it depends on their definition, Eclipse has positioned itself as an abstract platform for building any tool with plugins, and IDEA has positioned itself as a "smart Java IDE", and it is.

As a souvenir I'll try to list some of the things that Eclipse might be better than IDEA:
• Eclipse looks better, and all the fuss-free SWT and native controls are worth it. Eclipse looks like a solid, well thought out program with nice fonts and icons. However, when I first saw IDEA, it was like a gimmicky toy, with incomplete icons and a clunky Swing interface.
•Eclipse has stronger project structure support. In IDEA, your project is composed of modules. In Eclipse you have a workspace consisting of projects, each of which can be opened or closed individually, grouped or hidden. But do you really need it?
• Writing plugins for Eclipse seems simple
. • IDEA uses more system resources than Eclipse. This actually makes sense - because IDEA knows more
. Finally, Eclipse is free, but the IDEA Community version is enough for me.

Final advice

If you need nice icons, a platform for creating desktop programs, C ++IDE or if you work with a low-end laptop, then Eclipse might be a better choice for you. But if you are a serious Java developer and you need faster and more convenient tools to help you focus on solving problems instead of distracting you, IDEA is exactly what you need.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326778595&siteId=291194637