Which Editor / IDE should I use?
Posted by Tim Koschützki, on Mar 23, 2007 - in Coding Techniques & Tools » Techniques & Habits
When you are a programmer you need a good set of tools. Every tool must be simple to use, but be able to serve its purpose. This is true for all coder's tools, but especially for the editor / ide (integrated-development-environmenz) that he uses. You must be able to edit source code as easy as possible, since source code is, well, the fundamental thing for a programmer. :) Let's take a quick look over various functionality your ide / editor should provide you with.
You should use only one editor
I think it's the best to only know one editor, but know it like your wallet. I am of the opinion that you should use it for everything - coding, documentation, messages, etc. "Why?" I hear you asking. Because, most editors have different sets of shortcuts, commandos, toolbars etc. If you are using PHPEclipse for your coding, Textpad for your documentation needs and a monolithic office-product to organise your todo lists and to type emails, you won't get as fast as you can get with only one editor. In each of these environments you will different commands and conventions.
You must use shortcuts. Using cut, copy and paste via the mouse will not be as efficient as using CTRL+X, CTRL+C and CTRL+V.
Choose one editor, understand it fully and use for all editing tasks. If there is only one set of shortcuts for editing tasks,you will not lose any time thinking about what was the correct shortcut for the search functionality. Some editors use "F5" for that, some use CTRL+F.
Make sure, that your editor can be used with all platforms that you are using.
Necessary Editor Functionality
Apart from the comfortable or useful functionality, that you like to use, I will present a couple of functions here that every editor should provide.
- Easy configuration. Every aspect should be configurable as to your preferences. Especially shortcuts are important, because if you use them often, your hands won't need to abandon your keyboard.
- Easy extensions. An editor should be able to cope with new developments, such as a new programming language being released.
- Programmable. You should be able to program your editor for complext asks. This can be done via Makros or embedded programming languages.
Other than that your editor should feature the following functionality:
- Syntax-Highlighting
- Automatic indentation
- Automatic completion of words, functions, etc.
- Predefined text templates
- A useful help section
- Features that are common among IDEs - like an embedded compiler and debugger
Predefined Fileheaders
Most modern Editors / IDEs provide a useful feature that automatically writes a comment at the top of the file with the
- Name of the class
- Your name
- A skeleton for declarations, like constructors, destructors, etc.
In PHPEclipse for example, you could automatically add PHPDoc tags as in here:
-
/**
-
* File description
-
* Created on <date>
-
*
-
* @author me <me @email.com>
-
* @todo
-
*/
Code Inspection
When you are not so used to object oriented programming in PHP, it's a best coding practice to use an editor that provides code inspection. For example it provides with a list of all functions in your file. One c lick on a function scrolls to that function immediately.
This is of course true for an OOP setup as well. A very useful feature.
So which editor should you use?
There are actually various options here, ranging from Textpad over PHPEclipse to UltraEdit. These three are not only the industry standardin PHP development environments, but also in most coding environments using other languages as well.
For the PHP community there is also Zend Studio, the official ide made by the developers of PHP. Zend Studio is certainly a good and useful ide with many features that I discussed in this post. However, the fact that there is similarly good freeware, you probably should not invest into it.
PHP Designer is another good option, providing support for better HTML and CSS Coding as well.
However, if you ask me, for now PHPEclipse is the way to go, as it provides integration with debugging, web testing and your webserver. It also features code inspection, auto indentation, code highlighting.You can toggle functions and phpdoc comments to get a better idea for the big feature. ANotheri mportant fact isa lso that most professional teams work with itand it always looks good on your application when you have substantial experience with Eclipse.
What should you try to do now?
- Explore all features on your currently used editor / ide
- Surprise you colleagues that use the same editor with a cool new feature nobody has used so far
- Use your editor's embedded programming language to automatize your work
- Learn your editor's table of shortcuts by heart
- Use your editor for all tasks, including programming, simple text editing, writing email templates, etc.
- Decide whether you need a new editor / ide