|
Ten Reasons To Use EclipseEclipse 2.0 is out and making a splash! You may have already heard about IBM's newest and hottest IDE. Industry analysts have dissected it, technical writers have reviewed it, but most have failed to see an essential fact: through a combination of licensing, technologies, and sheer excellence, Eclipse is in a whole different league than most other development environments. Here are some reasons why you should consider using Eclipse now. #1 - Eclipse is FreeEclipse is free software: access and use of the Eclipse code are controlled by the Common Public License, an open-source license which allows individuals to create derivative works with worldwide re-distribution rights that are royalty free. The license has been approved by the Open Source Initiative, and can be summarized as: grab it, hack it, give it away – or resell it. IBM, the backer of the Eclipse project, has to be lauded for this forward-thinking initiative. Eclipse is also free in another sense of the word: it carries a zero price tag. Certainely a compelling feature in today's economy! How much money would you save but dropping that expensive IDE that requires a license per seat? Some are going as far as dropping graphical IDEs entirely; they went back to a pure command-line environment, and are proud of it. Emacs/vi and the Unix shell have great strengths, not the least their simplicity. But when facing the latest advances in IDE technology, as featured by Eclipse in particular, I couldn't help but feel those legacy tools have been left in the dust. The rest of this article will detail just how Eclipse bests even the most advanced commercial IDEs; for now let's just remember that its price is zero. Download it, unzip it, you're set to go. Why pay for a commercial IDE when better can be obtained for free? And remember, your boss will love you for it. #2 - Eclipse is a PlatformEclipse, although mostly known as a Java IDE, is primarily a platform, designed from the ground up to understand more than just the Java language. Thanks to its open architecture, Eclipse is wide open to extensions, by commercial entities as well as individuals. And while Eclipse is already a fantastic IDE for Java programming, other languages and tools are being integrated in the platform as we speak. And this mirrors the reality of my development: like most developers today, I don't use one language, I use many languages. I believe in using the best tool for the job; most applications today require a mix of technologies and languages. Consider J2EE applications: they are written in Java of course, but also JSP, XML, HTML, and other languages. A pure Java editor cannot handle all those different syntaxes which bear little or no relationship to Java. Eclipse, because of its open architecture, accepts plug-in modules which can handle almost anything. #3 - Eclipse Has MomentumAlthough Eclipse is an open-source platform, it isn't the only one. A most notable competitor is Sun's own NetBeans, commercially distributed under the name Forté. NetBeans has lots of features, is as free as Eclipse, and surely must be taken into account in a discussion of Java IDEs. But while Sun's efforts in opening NetBeans to other software providers have been met with mixed results, the Eclipse Consortium seems to have succeeded in creating a group of very strong backers actively supporting and extending the Eclipse Platform. First among them is of course IBM, who funds the Eclipse Project, and is building its commercial J2EE IDE product, WebSphere Studio, on top of Eclipse. But many others can already be mentioned: Rational Software is using Eclipse for its Rational XDE modeling tool; Fujitsu for its application server product line; and JProbe, Sitraka, and others are porting their respective products to Eclipse. #4 - Eclipse is Easy To ExtendThe Plug-in Development Environment, or PDE, is an integrated development environment for developing extensions to the Eclipse platform. Using the PDE is like using Eclipse to develop Eclipse, allowing developers to leverage the excellent Java tools to extend the platform itself. I discuss the JDT (Java Development Tooling) more in detail below. Thanks to the PDE, and to the attractiveness of the platform itself, Eclipse has succeeded in generating tremendous traction in the software development community. Plug-in projects aiming at integration more development tools into the Eclipse platform, are already too numerous to be listed here. Let's only mention a few:
#5 - The Eclipse Workbench: Views, Editors and Perspectives
Eclipse implements a strong UI metaphor, the result of years of research and
development in IDE technology: the workbench.
Simply defined, the workbench is a space where work is performed using a range of tools.
In Eclipse-speak tools are called views and editors, and a given
layout of tools is known as a perspective.
There are many views and editors; each is dedicated to a specific functionality.
E.g. the Java editor
highlights Java syntax; the Hierarchy view shows the class inheritance hierarchy;
the Console view displays Again Eclipse mirrors the reality of software development: as I move from analysis/design to implementation, then to testing and debugging, Eclipse allows me to use the most appropriate toolset simply by switching perspectives. Default perspectives exist and embody the most common tasks. E.g. the Debug perspective opens all debugging views, used to trace code, set variables and breakpoints; the Java Browsing perspective shows the Hierarchy view, the package, class and method views, as well as the Java editors. This simple yet powerful "workbench" metaphor is what makes Eclipse such a superior environment, easy and enjoyable to work with. The IDE has many features, conveniently accessible when needed, yet easily hidden when not. E.g. I write my code in the Java browsing perspective, which displays the class/method views. Running the JUnit tests pops open the JUnit view, which I file away (iconify) as soon as all tests have passed. To write my Ant build file, I switch to the Resource perspective where the entire project tree is shown. At all times the IDE has provided me with the tools I need for the task at hand, and only those. I decide what set of tools I'm going to need, and how they are presented to me. #6 - Eclipse is FasterMaybe this one is a pet peeve of mine, but I simply cannot stand waiting for menus to pop-up. Typical developer machines are less than a year old, and have more than enough horsepower to run any desktop application. How is it possible that a Java app still feels like a Java app, to the point that any developer can always tell an application is written in Java by its slow execution speed and quirky fonts? Maybe an answer to this problem is SWT, the Standard Widget Toolkit developed by the Eclipse team as a replacement for AWT/Swing. In addition to making the application look like any other native application, which is a gread-breaking improvement in itself, SWT seems to greatly improve the performance of GUI display. And maybe, just maybe, the Eclipse developers care more about performance than others. The Eclipse development process consistently lists explicit performance milestones that must be reached before the product ships. The remaining sections of this article focus on the JDT, the Java IDE which implements the core programming environment and doubles as Eclipse's best demo. #7 - Never Compile AgainOne aspect of Eclipse I dearly love is the utter lack of a "Build" or "Compile" button. Isn't it paradoxical, an IDE that doesn't let you build? IDEs started precisely as GUI wrappers around a compiler and a make tool, how can the "Build" feature be absent? Here's the key: Eclipse always builds for you. Every time you save a file, run a program or a tool, or any other action that accesses resources contained in the project, Eclipse compiles. This essentially means your code is always compiled. (Note that a "Rebuild" menu option is still present for those rare cases that require a manual build.) I find this to have a profound impact on my programming work. For the first time I'm working in an environment where the natural state of code is compiled. Text, source code, used to be the primary form of a computer program. In Eclipse, source code has almost become a transient state, used only as input to the compiler. As soon as possible, and in fact, almost continuously, code is compiled to its binary form, with all the benefits of compilation (type checking, static analysis, etc.). Eclipse also builds incrementally, thus ensuring that most build operations are completed within seconds. The remaining sections discuss the benefits of constantly keeping all code in a compiled state. #8 - Interpreted JavaEclipse is revolutionizing Java development by bridging the gap between traditional static languages (think C++) and dynamic OO environments (think Smalltalk). Java developers are used to the repetitive compile/debug/test cycle typical of static languages. Eclipse uses a combination of advanced techniques to emulate a dynamic programming environment normally associated with interpreted languages. This amazing feat gives Java developers the benefits of both worlds: a compiler still performs static analysis, and the repetitive compile/debug cycle yields to a smooth write/test activity.
Let's look at a spectacular example.
As mentioned above, Eclipse builds fully incrementally: it will even
let you run code containing syntax errors. Calling a method with compilation errors in it
breaks into the debugger, where I can fix the error and
resume the execution as if nothing had happened. Behind the scenes Eclipse
compiled the new class and dynamically replaced it in the running VM. My Java program
can be changed, and in fact, almost be developed, while running! This amazing
feature is known as hot code replace, and requires the latest JDK to work best.
Because all code is always compiled, Eclipse has detailled knowledge of the methods and classes making up an application. In addition, the Java editor also constantly parses code as you type it. This unprecedented depth of knowledge about the code blossoms in a bouquet of sophisticated features inaccessible to a purely text-based editor. It makes the environment incredibly smart and able to provide contextual help at a level I had never experienced before. To wit, the Java editor offers completion on class names, method names, and even argument names. It detects typos as they are made, underlines the offending statements, and offers corrections, e.g. creating a previously undefined method or class. It auto-imports classes when needed, and can flag useless import statements. Fill-in code templates are tailored to the current context, and save on typing efforts. To summarize, the Eclipse environment leads code writers with an expert hand, and increases productivity by providing immediate feedback about the code. #9 - Team DevelopmentEclipse is designed to successfully interact with any software configuration management system. The default Eclipse environment is fully integrated with CVS, the standard in open source development: GUI actions give access to most CVS operations – update, commit, diff, merge, patch, etc. The diff tool is spectacular: Java-aware, it can diff specific Java elements individually, e.g. method by method. But plug-ins already exist for most other SCM systems, such as ClearCase, Perforce, and numerous others. While some are still undergoing heavy development, the strong pressure created by the multitude of Eclipse users all but guarantees they'll reach production quality soon. #10 - The Refactoring MenuRefactoring is now known to most software engineers. Eclipse features a rich Refactoring menu, which offers choices such as Extract Method, which creates a method for the body of code highlighted, Extract Interface (creates an interface for the given class using its public method definitions), etc. Refactoring is quickly becoming an essential tool of software development, and I look forward to Eclipse leading the way in this arena. The Eclipse community has strong ties to the research community, and it is expected Eclipse will continue closely tracking advances made in software development techniques and methodologies. For instance, a rising movement known as Aspect Oriented Programming is implemented by Eclipse plugins available today. Another Eclipse project is bringing to the masses the benefits of code modeling and generation, while still another is exploring new possbilities in software configuration management. ConclusionEclipse is a fantastic integrated development environment that offers for free advanced features normally found only in expensive commercial products. Eclipse raises developer productivity by weaving together most of the tools required to do a software job. But Eclipse is more than just an IDE: Eclipse (the JDT especially) is also a vehicle, a vector enabling change in how Java software is written. A lot of the UI metaphors and techniques implemented by Eclipse originated in the Smalltalk community, and have reached a level of maturity never seen before in a Java IDE. Twenty years of experiments in OO development culminate in the Eclipse Platform, and it shows. Lucky are Java developers this jewel has been open-sourced! Eclipse enables and favors a smooth, fully incremental development style usually associated with interpreted languages. Agile methodologies, eXtreme Programming in particular, share the same background and forces that have shaped Eclipse. The Eclipse platform is therefore very conducive, and could even be considered the perfect tool for agile programming. But even if your team hasn't bitten into the XP apple yet, you definitely want to try it out by yourself and see! ReferencesThe Eclipse Web site is quite large, and I have had a hard time locating the information I need. Here is a list of selected resources of interest to the Eclipse user.
This article also makes reference to the following documents.
AcknowledgementsI wish to address sincere thanks to all the people who have helped me write this article by sharing with me their thoughts and comments. In no particular order: Jean-Michel Sadoul, Julien Fourment, David Orme, and all eclipse.tools subscribers for reading drafts of this article. And of course the entire OTI team for such a fantastic product! About the AuthorRenaud Waldura is a software engineer specializing in distributed applications development. He fell in love with Eclipse around build 20020214, dropped his fine-tuned emacs environment soon thereafter, and has never looked back. Visit Renaud's Web site at http://renaud.waldura.com and learn more about how he leverages open-source tools to help you succeed in your business. Copyright © 2000-2007 by Renaud Waldura. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee, provided that copies are not made or distributed for profit or commercial advantage, and that copies bear this notice and full citation on the first page. Copyright for components of this work owned by others than Renaud Waldura must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or fee. Request permission to publish from renaud@waldura.com. Last modified: 2003/02/07 18:20:56 $ |