[IDEA & amp; Eclipse] 1. Why is IntelliJ IDEA more suitable for professional java developers than Eclipse? intellijidea

Source: Internet
Author: User

[IDEA & Eclipse] 1. Why is IntelliJ IDEA more suitable for professional java developers than Eclipse? intellijidea

Holy War

There are some "permanent" questions that do not have the only correct answer, such as which is better: Windows or Linux, Java or C #; who is stronger: Chuck Norris or Van Damme.

One of them is the choice of Java IDE:

There are a lot of arguments about which plug-ins, shortcuts, and so on. There are too many differences between them, and it is difficult to decide what is the most important.

Therefore, it is said that the two ides are similar in functionality, and selecting one is a matter of personal preferences.

I think this is not just a matter of personal preferences. The objective reason is that Intellij IDEA is definitely better than Eclipse.

I won't compare the differences between the two in many ways, such as plug-ins and shortcut keys. Because there are a series of blogs about this, such as [part 1] [part 2] [part 3]. I will show the biggest difference between IDEA and Eclipse. Generally, fans of IDEA and Eclipse do not know about it. The former is used to use it rather than imagining how IDE lacks it. The latter is not used to it and it is hard to imagine that IDE can do so well. Eclipse users usually do not realize this difference when playing IDEA, because they are used to working in Eclipse mode.

Why am I so confident?

Before you begin, let me explain who I am and why my point is worth hearing.

I have been using Eclipse for five years. I know it very well. I write plug-ins for it and really love it. Then, I changed my job to a company and was forced to transfer it to IDEA for development. After this "Break up", I finally realized why IDEA is more acute. Now I have been using IDEA for some years, so I can compare them because I know them.

Major differences between IDEA and Eclipse

The reason why IDEA is more acute is that IDEA understands the context. This is why the JetBrains employee named IDEA intelligent. What does it really mean? IDEA retrieves your entire project, analyzes all the content of the project, and even constructs a syntax tree. Thanks to it, IDEA knows where you are and what you can do wherever you place your mouse.

Still not running? Don't worry. After listing the following examples, everything is clear.

This understanding of context is manifested in many ways. The following is only a part of it.

1. debugging

In the debugging process, we usually want to request some expression values. In Eclipse, You need to select this expression. It is very important to select the entire expression. Otherwise, you cannot find its value. Then, you can use Ctrl + Shift + I to view the value of this expression.

You don't need to select anything when using IDEA. You just need to move the cursor to your expression and then press Alt + F8. IDEA will understand the expression you may need and display a dialog window with some suggested parameter variables. You can also edit and neutral in the dialog box to obtain the value of this expression. Very convenient! After you have tried this feature, you will no longer want to debug it in Eclipse.

Basically, you can do the same thing on both ides, but using IDEA is simpler and faster. I seriously said that the difference is too big: just like heaven and earth. In a small IDEA dialog window, Automatic completion, syntax highlighting, and everything you need are provided.

2. Automatic completion

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

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

Now we want to find the options starting with vi.

How does IDEA do it? Without waiting for any buttons, it can understand assertElement immediately requires an example of the Conditaion class as the second parameter, and there is a static variable named visible in the Condition class. IDEA directly recommends this unique valid option.

However, what does Eclipse do? Alas, it cannot understand the context, and it does not know where the cursor is located is the second parameter of the assertElement method. Therefore, when you press Ctrl + Space, Eclipse simply displays everything starting with the vi letter in the world.

In a beautiful pop-up box, I see a lot of useless information about the beautiful highlighted format specifications .:(

3. Reconstruction

Professional programmers can efficiently use the refactoring functions provided by IDE. All modern ides provide many impressive refactoring functions. However, the reconstruction function of IDEA is also intelligent. They can understand what you need, and then provide you with the most suitable solutions for different situations.

For example, suppose we have an assertErrorMessageIsHidden method:

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

We use the string "errorMessage" as a parameter for this method.

Let's start with IDEA, place the cursor on any string "errorMessage", Press Ctrl + Alt + P (representing "parameter "), IDEA will suggest which expressions can be used as parameters using the sub-string.

When the "errorMessage" expression is selected, IDEA will recommend some variable names that may be used as this parameter.

Monthly surprises

You are often surprised by the intelligent performance of IDEA. For example, it prompts you the names of some options. It takes into account the method name, the variable type, and even the variable value, and the names of other such variables, and the names of the variables you previously given, except for ignoring your zodiac. Believe me, you will want to say "Wow, IDEA, too ?", I 'd like to say at least once a month.

Now let's take a look at how Eclipse provides suggestions.

Don't forget to select the entire "errorMessage" expression. Select a refactoring function of "recommended parameters" (there are no shortcut keys available through the menu) to get similar results. However, Eclipse does not provide the variable name prompt option, but fortunately not.

Conclusion

If we select Java IDE, Intellij IDEA must be better than Eclipse. This is not just a matter of personal preferences. Objectively speaking, IDEA is better. It enables you to quickly write and modify code. It provides an appropriate name prompt to find the appropriate method. You do not need to select an expression to guess what you want to do and how you want to name it. IDEA indicates and prompts you.

P.S. Remarks

I think IDEA is indeed better than Eclipse in Java IDE. If you consider other aspects of their capabilities, such as for other IDE such as C ++, Python, and Scala, or as a platform for building desktop applications, Eclipse is likely to be the top runner.

In fact, this is dependent on their definition. Eclipse has positioned itself as an abstract platform to use plug-ins to build any tool, while IDEA is positioned as an "intelligent Java IDE ", and it does.

As a souvenir, I tried to list some better aspects of Eclipse than IDEA:

  • Eclipse looks better, and all the minor issues of SWT and local controls are very valuable. Eclipse looks very stable and well-thought-out. It has beautiful fonts and icons. However, at first glance, IDEA is like a toy with incomplete icons and clumsy Swing interfaces.
  • Eclipse has stronger project structure support. In IDEA, your project is composed of modules. In Eclipse, you have a work zone composed of projects. Each project can be opened or closed separately, grouped or hidden. But do you really need it?
  • Writing plug-ins 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 to use

Final suggestions

If you need beautiful icons to create a desktop program platform, C ++ IDE, or you work with a low-configuration notebook, Eclipse may be a better choice for you. However, if you are a Java developer, you need faster and more convenient tools to help you focus on solving problems rather than distracting you. IDEA is exactly what you need.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.