Eclipse vs. Visual Studio

Introduction

While this topic seems to be oranges to apples comparison from the first glance, if you try to think about this, you’ll notice that this comparison is not so stupid as it seems from the beginning. Both Eclipse and Visual Studio are large, mature IDEs, both support many languages, both have very active community, both are mostly oriented towards devlopment for one of the two largest development platforms in the world: Java and .NET respectively. This last item brings another similarity: Java and .NET are very similar platforms by themselves by loads of factors, Java and C# are very similar languages that borrowed features from each other during all their history. So to some extent it is actually possible to compare Eclipse and Visual Studio, if they are used for very similar purposes.

For me as Java developer it was always tempting to draw back the curtains and look to the other world to see, what people do there, compared to what is done in my world.¬†From time to time, while reading the Web, I notice some articles and forum topics that try to compare Eclipse and Visual Studio. What bugs me the most is that it is always taken for granted that Visual Studio is hands down full-blown IDE with thousands of features included out of the box, while Eclipse is poor man’s experience that has not so much included, but sometimes you can even find some plugins and have functionality similar to Visual Studio. One day I decided to make a comparison of the features of both IDEs. Because I know Eclipse quite good, but have no experience with Visual Studio, I’ve taken all the information from the public docs. For Eclipse I was using http://help.eclipse.org and for Visual Studio I’ve taken everything from MSDN. The comparison appeared quite lengthy. At the end I collected some other users’ experience with the two IDEs. If anything is incorrect in this article, I’m open to hear and correct all the mistakes. So let’s go.

Refactoring

VS:

http://msdn.microsoft.com/en-us/library/719exd8s.aspx

Extract Method Refactoring (C#)
Rename Refactoring (C#)
Encapsulate Field Refactoring (C#)
Extract Interface Refactoring (C#)
Remove Parameters Refactoring (C#)
Reorder Parameters Refactoring (C#)

Eclipse:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-menu-refactor.htm

Rename
Move
Change Method Signature
Extract Method
Extract Local Variable
Extract Constant
Inline
Convert Anonymous Class to Nested
Move Type to New File
Convert Local Variable to Field
Extract Superclass
Extract Interface
Use Supertype Where Possible
Push Down
Pull Up
Extract Class
Introduce Parameter Object
Introduce Indirection
Introduce Factory
Introduce Parameter
Encapsulate Field
Generalize Declared Type
Infer Generic Type Arguments
Migrate JAR File
Create Script
Apply Script
History

Code Formatting

VS: CTRL-A to select all text then do the CTRL+K-F combo

Eclipse: CTRL+SHIFT+F

Run/Debug Configuration

VS: ONE Run Configuration and ONE Debug Configuration

Eclipse: any number of run and debug configurations

http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2FgettingStarted%2Fqs-6.htm

Source Code Actions

VS:

http://msdn.microsoft.com/en-us/library/6hf704tz.aspx,

http://msdn.microsoft.com/en-us/library/vstudio/cdbwbc30.aspx

Surround-with Code Snippets
Add using
Generate From Usage
Hook Up Events By Using IntelliSense (C#)
Implement Abstract Base Class
Implement Interface
IntelliSense for Override

Eclipse:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-menu-source.htm

Toggle Comment
Add Block Comment
Remove Block Comment
Generate Element Comment
Shift Right
Shift Left
Correct Indentation
Format
Format Element
Add Import
Organize Imports
Sort Members
Clean Up
Override/Implement Methods
Generate Getter and Setter
Generate Delegate Methods
Generate hashCode() and equals()
Generate toString()
Generate Constructor using Fields
Add Constructor from Superclass
Surround With
Externalize Strings
Find Broken Externalized Strings

Debug

VS:

http://msdn.microsoft.com/en-us/library/k0k771bt.aspx

Eclipse:

http://www.vogella.com/articles/EclipseDebugging/article.html

Type Hierarchy

VS: NOT AVAILABLE

Eclipse:

http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2FgettingStarted%2Fqs-6.htm

Organize Imports

VS:

http://msdn.microsoft.com/en-us/library/vstudio/bb514114.aspx, NO SETTINGS

Eclipse: CTRL+SHIFT+O,

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fpreferences%2Fjava%2Fcodestyle%2Fref-preferences-organize-imports.htm

Settings:

Import order list
New…
New Static…
Edit…
Remove
Up
Down
Import…
Export…
Number of imports needed for .*
Number of static imports needed for .*
Do not create imports for types starting with a lower case letter

Save Actions

VS:

not available, only via hack, http://stackoverflow.com/questions/16109219/execute-an-action-on-save-in-visual-studio-2012

Eclipse:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fpreferences%2Fjava%2Feditor%2Fref-preferences-save-actions.htm

Local History

VS: NOT AVAILABLE

Eclipse:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-55.htm

Quick Access

VS: NOT AVAILABLE

Eclipse: CTRL+3

Perspectives

VS: NOT AVAILABLE

Eclipse:

http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fconcepts-4.htm

Content Assist / Code Completion

VS:

http://msdn.microsoft.com/en-us/library/vstudio/fcf2zk43.aspx,

http://msdn.microsoft.com/en-us/library/vstudio/hcw1s69b.aspx

Show completion list after a character is typed
Place keywords in completion lists
Place code snippets in completion lists
Committed by typing the following characters
Committed by pressing the space bar
Add new line on enter at end of fully typed word
Pre-selects most recently used member

Eclipse:

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fpreferences%2Fjava%2Feditor%2Fref-preferences-content-assist.htm&cp=1_4_2_0_5_0

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-java-editor-quickassist.htm

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-java-editor-quickfix.htm&cp=1_4_14

Content Assist

Completion inserts/Completion overwrites
Insert single proposals automatically
Insert common prefixes automatically
Add import instead of qualified name
Use static imports
Fill method arguments and show guessed arguments
Insert parameter names
Insert best guessed arguments
Configure Type Filters.
Sort proposals
Show camel case matches
Hide proposals not visible in the invocation context
Hide deprecated references
Enable auto activation
Auto activation delay
Auto activation triggers for Java
Auto activation triggers for Javadoc
Select the proposal kinds contained in the ‘default’ content assist list
Content assist cycling
Timeout for fetching a parameter name from attached Javadoc
Favorites

Quick Fix

Add missing package declaration or correct package declaration
Move compilation unit to package that corresponds to the package declaration
Remove unused, unresolvable or non-visible import
Invoke ‘Organize imports’ on problems in imports
Create new class, interface, enum, annotation or type variable for references to types that can not be resolved
Change visibility for types that are accessed but not visible
Rename to a similar type for references to types that can not be resolved
Add import statement for types that can not be resolved but exist in the project
Add explicit import statement for ambiguous type references (two import-on-demands for the same type)
If the type name is not matching with the compilation unit name either rename the type or rename the compilation unit
Remove unused private types
Add missing type annotation attributes
Create new constructor for references to constructors that can not be resolved (this, super or new class creation)
Reorder, add or remove arguments for constructor references that mismatch parameters
Change method with constructor name to constructor (remove return type)
Change visibility for constructors that are accessed but not visible
Remove unused private constructor
Create constructor when super call of the implicit default constructor is undefined, not visible or throws an exception
If type contains unimplemented methods, change type modifier to ‘abstract’ or add the method to implement
Create new method for references to methods that can not be resolved
Rename to a similar method for references to methods that can not be resolved
Reorder or remove arguments for method references that mismatch parameters
Correct access (visibility, static) of referenced methods
Remove unused private methods
Correct return type for methods that have a missing return type or where the return type does not match the return statement
Add return statement if missing
For non-abstract methods with no body change to ‘abstract’ or add body
For an abstract method in a non-abstract type remove abstract modifier of the method or make type abstract
For an abstract/native method with body remove the abstract or native modifier or remove body
Change method access to ‘static’ if method is invoked inside a constructor invocation (super, this)
Change method access to default access to avoid emulated method access
Add ‘synchronized’ modifier
Override hashCode()
Open the ‘Generate hashCode() and equals()’ wizard
Correct access (visibility, static) of referenced fields
Create new fields, parameters, local variables or constants for references to variables that can not be resolved
Rename to a variable with similar name for references that can not be resolved
Remove unused private fields
Correct non-static access of static fields
Add ‘final’ modifier to local variables accessed in outer types
Change field access to default access to avoid emulated method access
Change local variable type to fix a type mismatch
Initialize a variable that has not been initialized
Create getter and setters for invisible or unused fields
Remove unneeded catch block
Remove unneeded exceptions from a multi-catch clause (1.7 or higher)
Handle uncaught exception by surrounding with try/catch or adding catch block to a surrounding try block
Handle uncaught exceptions by surrounding with try/multi-catch or adding exceptions to existing catch clause (1.7 or higher)
Handle uncaught exception by adding a throw declaration to the parent method or by generalize an existing throw declaration
Add a missing JAR or library for an unresolvable type
Open the build path dialog for access restriction problems or missing binary classes.
Change project compliance and JRE to 1.5
Change workspace compliance and JRE to 1.5
Add cast or change cast to fix type mismatches
Let a type implement an interface to fix type mismatches
Add type arguments to raw references
Complete switch statements over enums
Remove dead code
Insert ‘//$FALL-THROUGH$’
Insert null check
For non-NLS strings open the NLS wizard or mark as non-NLS
Add missing @Override, @Deprecated annotations
Add missing Javadoc comments
Add missing Javadoc tags
Suppress a warning using @SuppressWarnings
Throw the allocated object
Return the allocated object
Add @SafeVarargs annotation for heap pollution warnings (1.7 or higher)
Remove invalid @SafeVarargs annotations (1.7 or higher)
Remove redundant type arguments (1.7 or higher)
Add inferred type arguments (1.5 and 1.6)

Quick Assist

Inverse if statement
Inverse boolean expression
Invert local variable
Invert equals
Inverse conditional expression
Pull negation up
Push negation down
Remove extra parentheses
Put expression in parentheses
Put expressions in parentheses
Join nested if statements
Swap nested if statements
Split if statement with and’ed expression
Join selected ‘if’ statements with ||
Join ‘if’ sequence in if-else-if
Split if statement with or’d expression
If-else assignment to conditional expression
If-else return to conditional expression
Conditional expression assignment to If-else
Conditional expression return to If-else
Switch to If-else
Add missing case statements on enums
Exchange operands
Cast and assign
Use separate catch blocks
Move exceptions to separate catch blocks
Combine catch blocks
Add finally block
Add else block
Replace statement with block
Unwrap blocks
Pick out string
Convert string concatenation to StringBuilder (J2SE 5.0) or StringBuffer
Convert string concatenation to MessageFormat
Split variable
Join variable
Assign to variable
Extract to local
Assign parameter to field
Array initializer to Array creation
Convert to ‘enhanced for loop’ (J2SE 5.0)
Convert to indexed ‘for’ loop (J2SE 5.0)
Convert to Iterator-based ‘for’ loop (J2SE 5.0)
Create method in super class
Rename in file
Rename in workspace
Extract to local variable
Extract to constant
Extract method
Inline local variable
Convert local variable to field
Convert anonymous to nested class
Replace with getter and setter (Encapsulate Field)
Insert inferred type arguments

What Other People Say

Quote #1 http://eclipse-ruminations.blogspot.com/2010/12/eclipse-to-visual-studio-2010-what-im.html

The author is missing next features in VS:

  1. Quick Fix – Assign to local variable. Write the RHS of an assignment statement, then Ctrl+1 to have the IDE suggest/insert a LHS.
  2. Curly brace auto-completion. When I type the opening brace and hit enter, automatically indent one tab and add a close brace on the following line.
  3. Ctrl-Click for type definition hyperlinking. Basically, a mouse gesture for Visual Studio’s Go To Definition F12. I’ve been told there is an extension for this??
  4. Ctrl-Click for externalized strings (resources in .NET?). In Eclipse, when I Ctrl-Click on an externalized message referenced as a static String, I can jump to the properties file directly.
  5. “Flexible” Go To Definition. In Eclipse, if I write some code that calls a method, and I don’t have the particular overload parameters sequenced correctly, I can still (typically) jump to the definition of one of the overloads. Since they’re typically clustered together in the target type, this is a poor man’s way of getting around reading the Javadoc.
  6. (Speaking of Javadoc), Hover over a method to see its NDoc documentation. Reading the commented XML syntax on a method doesn’t do it for me.
  7. Link With Editor / Show In. When I’m jumping around using Go To Definition, I quickly lose track of where (in the resource tree) a particular class is. In Eclipse, I can toggle and untoggle Link With Editor to highlight the resource in Package Explorer. How do I select the current editor’s file in Solution Explorer?
  8. Synchronize View. This one is a HUGE hole. How the hell do you .NET people sync your code in a sane way??
  9. Multi-Page Editors. I’ll qualify this one a bit by saying that I’ve seen the implementation details of multi-page editors in Eclipse, and there are some definite issues. But the functionality is critical when you have an XML document which also has a graphical editor. (Entity Framework conceptual models, I’m lookin’ at you.) Gimme a synchronized two-tab editor so I don’t have to keep doing Open With, closing the other editor (can’t have both open at the same time, another FAIL), etc.
  10. Outline View in the XML editor. ‘Nuff said.
  11. Collapse All / Expand All. Solution Explorer needs these badly.
  12. File -> Restart. After I install a Visual Studio Extension, I need to restart. Please make this one click, thanks.
  13. Workspaces. I really don’t know how to explain this one. You can see one of my complaints (relating to Team Explorer) in this post. Another example is that of “recent solutions”. Please just keep my last solution open? What am I missing here? I need to have separate “threads” of work that are preserved somehow, so I can easily switch between conceptual projects in my daily work.

Quote #2 http://programmers.stackexchange.com/questions/9122/what-features-in-eclipse-is-not-available-in-visual-studio

Some excerpts:

1) Eclipse Quick Access is an amazing usability feature, in my opinion.

Short version:

Imagine a QuickSilver or Launchy inside the IDE!.

With Quick Access you can navigate to almost any part of the IDE using the keyboard. Yes, that can be done in Visual Studio also but you need to learn the shortcut to each view: Ctrl+Alt+J to go to the Object Browser; Ctrl+Alt+L for Solution Explorer, etc; or use generic window switching shortcuts (like Ctrl+F6 to go to next window one by one).

In Eclipse, you only need one shortcut: Ctrl+3 to open the Quick Access tool.

The Quick Access tool hat allows you to just start typing the name of any command, view, perspective, menu even source files! and it will auto-complete and suggest alternatives.

Quick Access:

Will remember abbreviations and your most frequent accessed items and progressively adapt to the way you use it.
Will also allow you type PascalCase abbreviations: You want to go to the Data Source Explorer view? type DSE and it will show up as the first option.
It will also show the keyboard shortcut for each item as a learning aid.

2) Missing from VS:

Ctrl+click on a method name to go its definition;
Auto brace complete (for C#) – but, to be honest, sometimes is annoying;

3) Notice how Visual Studio remembers the layout of the IDE (open windows, positions, etc) that you used the last time the debugger was running? And how it switches between that and the “non debugging” IDE layout automatically.

Eclipse does the same with Perspectives. Only that you can fully customize them not only for debugging and not debugging, but you can create several layout with different IDE configurations and switch between them with a simple click.

Want to go to the debugging layout while not debugging?. Just click the on the Debugging Perspective toolbar button.

Want to invent a new layout with no editors and only the Package Explorer and the Javadoc view are visible? Move your windows as you want and save it as a new perspective.

It is a great way of switching your IDE appropriately when your mind is also switching from one kind of task to another.

4) I assume you refer to the out-of-the-box Eclipse vs. out-of-the-box VS (otherwise, there are always plugins that add extra features).

Missing from VS:

Ctrl+click on a method name to go its definition;
Auto brace complete (for C#) – but, to be honest, sometimes is annoying

Conclusion

From what I’ve found so far, there is no feeling that Eclipse lacks any features compared to VS. Furthermore, seems that Visual Studio sucks at every single point of comparison. Visual Studio looks like a dumb text editor compared to Eclipse. So called “Intellisense” that is supposed to be the most intelligent code completion utility, in reality is just a children’s toy compared to what Eclipse has built in. If after that you still think that Visual Studio is superior in terms of features… Well… Maybe I missed anything. Just tell me I was wrong.

Now the question is: how in the hell is it possible that one of the largest corporations in the world with so much money cannot even come close to free open source product that is developed by community? Does it mean Microsoft just CAN’T do more? Even if it had unlimited money and resources? Does it mean that Microsoft just doesn’t care, if the cashflow goes on anyway?

About these ads

13 thoughts on “Eclipse vs. Visual Studio

  1. Totally on my mind too. I code in Eclipse CDT at work and I started doing a toy project at home in Visual Studio 2013. Man, they just don’t compare. Eclipse is MUCH better from a code-writing perspective. The only area were Visual Studio wins IMHO is debugging. At least on Linux, the Eclipse C++ debugger is a joke compared to Visual Studio.

  2. @Trevor Thanks for you comment on CDT. I don’t have much experience with CDT, I was just comparing from Java point of view: VS/C# and Eclipse/Java. Good to know that even C++ has much better support in Eclipse. Some time ago I was writing a small project with CDT and it was very limited compared to JDT. Seems that situation has changed for better since that time.

  3. Many of the features described here are only useful in java, because java sucks.

    C# doesn’t need the IDE to constantly help you create better code. C# delivers better code by default.

  4. @Fede Good luck with debugging, refactoring, code completion, history, code hierarchies, etc, etc, etc of C# code in Notepad ;)
    If C# is so great language for you that you don’t need an IDE, then why do you even need a computer? Write you programs on a paper!

  5. If I were a java developer, I would expect that the language evolved in such a way that I would have to make convoluted hacks in order to do anything. That means:

    – Real Properties, so the BS get_Prop() and set_Prop convention, which is HORRIBLE.
    – Real Generics, not something that gets deleted at runtime and is still object.
    – Delegates and Events. Remove the need for 1 method interfaces, which suck.
    – Extension Methods.
    – LINQ and System.Linq.Expressions
    – Async / Await.

    C# delivers better code by default. I’m sorry you’re still stuck with a language from the 90’s

  6. My point is that I prefer MS to be working on improving C# and .Net and leave the IDE as it is. I don’t care about the IDE as long as I can produce HIGH QUALITY code and solutions because the Framework and Language enable me to.

  7. @Fede There is soooo much else in Eclipse except “making convoluted hacks in order to do anything”, you can’t even imagine. 95% of what is written in this article is applicable to both languages. So please leave your comments about C# vs. Java aside. This is IDE comparison, and VS is not even comparable to Eclipse. You cannot code in VS as you can code in Eclipse. Period.

  8. Except you cannot code in C# with Eclipse, therefore you have to use a dinosaur crappy language.

    Sorry, but if suffering the lacks of VS is what it takes to be able to use C# and .Net, then I’ll go thru that.

  9. @Fede Sure your language makes you best programmer ever. Not so sure what makes you feel such butthurt.

  10. Seriously? There are so many errors in this comparison its pathetic. Learn VS Before you comment on it. Almost Everything you mention can be done in VS so this only proves you dont know how to use it. As I said pathetic.

  11. Strange that official documentation does not mention all these things, isn’t it? Remember that I did not use my Eclipse knowledge, I just used the documentation. Furthermore, I’ve double-checked all the missing features on Stackoverflow and other open discussions. I even posted some workarounds for missing features. I posted many opinions of other people, who had experience with both IDEs. Your argument that “this sucks” is not relevant. Go prove I was wrong, only then I’ll believe.

  12. What about VS 2013? I think it added features out of the box that were missing, and also that there are some impressive features it has and Eclipse does not.

    For example:
    – Can you examine return value in debugger?
    – Can you peek definition?
    – Does Eclipse saves your settings in the cloud?
    – Do you have intellitrace equivalent in Eclipse? Can you debug an (equivalent of) intellitrace trace on another machine, like you can in VS?
    – Can you debug using code maps?
    – Can you auto-generate sequence diagrams?

    I didn’t use Eclipse lately, but I remember it being very slow. VS 2013 on the other hand, is blazingly fast.

  13. I haven’t seen 2013 version, maybe I will have a look later. As for Eclipse being slow, there are currently 2 platforms v3 and v4. I use the last version from v3 platform – 3.8. It is as fast as I can only imagine. Small tasks like code completion, running something, opening a class and so on take from 0.1 to 1-2 seconds (this is just my feeling) more complex tasks like large refactorings can take maybe 3-5 seconds. The key thing is that you can control how much memory Eclipse is allowed to take in eclipse.ini. For large projects I use 1 GB and it is always more than enough.

    Regarding the features you mention:

    • I’m not aware, how this can be done in Eclipse. That is a real benefit, I agree.
    • What is peek definition?
    • Easily. Just point Eclipse to save its settings in your Dropbox folder. But why do you want to save them in the cloud, if you have version control systems? :)
    • What is intellitrace?
    • What is code maps?
    • Yes, with a plugin. And class diagrams too. They will even update automatically on the fly. See http://www.objectaid.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s