Java Tutorial - Java Script : Source Code Editors

Java Tutorial - Java Script :

Source Code Editors


The text or source code editor is the most commonly used tool for programmers. As a result there are many free editors available. Because of their wide popularity and availability, two editors should be specially noted, Vi and Emacs. We will also take a look at a couple of pure Java editors. Text editors and programming tools have an advantage over other software applications in that programmers write editors and development tools for the audience they know best: other programmers. The programmers add features that they know they would like to have, as well as features that will minimize the effort they have to expend on developing software. They try to create their tools to make their lives, and those of their comrades, easier. So what makes for a good program editor? What do we need beyond Windows Notepad? A good program editor helps the programmer write code. For Java, a good editor helps the programmer write Java code. But Java code is not enough. Most enterprise-class applications also require HTML, XML, JSP, property files, batch files, and script files to be written in addition to Java. A good editor needs to be able to assist the programmer with all of these technologies. All editors support basic features such as navigation through a document and the ability to insert, edit, and delete text. Even the early line-oriented editors did that. The tools we use today need to offer much more. They need to understand the language we are programming in and suggest ways to help. They need to assist us in avoiding common mistakes and pitfalls. A good editor needs to help us get our work done and yet not get in the way while we are doing it. Some of the features we desire in a program editor are:

Auto-indent:                                         Automatic indentation of code lines appropriately for the language.
Beautification:                                                  Automatic reformatting of source code to certain standards.
Brace match:                                                    Mismatched braces and parentheses are automatically identified.
Code assistance:                                             Pop-up, just-in-time help to inform the programmer about the                         arguments needed for various method calls.
Code completion:                                 Completes method signatures automatically as they are being typed in.
Color syntax highlighting:                    The editor has at least a rudimentary understanding of the syntax of the language being edited and changes the color of the code to reflect the language’s grammar.
Macro capability:                                  Allows repetitive tasks to be automated through some simple scripting capability.
Regular expression search and replace:           Supports regular expressions for the search and replace functions.
Spell checking:                                                Checks spelling for comments and string constants.
Templates:                                           Automate generation of standard code fragments or method bodies.
Undo:                                                   Allows the previous operations on the document during the current editing session to be reversed. Can we expect every editor to have these features? The answer is no. But these features are the ones we will look for as we compare tools. The choice of editor can be both the most personal tool decision and the most important. It is personal because it is used so much during the development cycle. Because of this a good developer will know his or her editor well and that is what makes it a personal choice. Does that mean that a developer should use only one editor? No, of course not! That’s like asking if a carpenter should use only one saw. Different tools offer different advantages and features over other tools. A good developer will know which capabilities each tool has and then select the right tool for the job at hand.