Are You Using Zen-Coding? You Should!
Zen-Coding is a not a standalone product, but rather a plugin that integrates with a variety of different editors. It is designed to handle HTML, XML, and XSL, however it can also handle additional structured code formats. Zen-Coding is an abbreviation engine that uses a modular structure to save you time. Aside from being an abbreviation engine, it can also do a variety of other actions including: Remove Tag, Tag Balancing, Toggle Comments, and Wrap with Abbreviation.
Benefits of Zen-Coding
1. Saves Time
The most obvious benefit of Zen-Coding is how much time it can save. Instead of typing 50 or 100 characters, you only need to write 10 or 15. For example, ul#languages>li*5 will automatically be expanded to <ul id=”languages”> and 5 (<li> </li>) and of course close it with </ul>. With 17 characters, you can get 69 characters. While this may seem insignificant, Zen-Coding is extremely powerful and can handle an unlimited number of parent and child tags.
In the same way that it saves time, it also guarantees accuracy. There is nothing worse than forgetting to close a tag or forgetting to add an element. As long as you create the input correctly, you will get a perfectly formatted output every time.
When it comes to creating large amounts of code, there is nothing more important than saving time and ensuring accuracy - Zen-Coding gives you both.
Current Features of the Abbreviation Engine
1. div tag name can be omitted anytime that you are writing elements that begin with ID or CLASS
2. All of the abbreviation groups allow for unlimited nesting, which means if you plan far enough ahead, you could potential create the skeleton for an entire document at one time.
3. It supports Filters
4. You can add multiple $'s in a row to function as zero padding
5. Element multiplication li*10 will output 10 <li> </li> tags
6. $ can be used for item numbering
7. ID and CLASS attributes
8. Can add custom attributes when needed
Currently Zen-Coding is officially supported by: Aptana, TextMate, Coda, Espresso, KomodoEdit, Notepad++, PSPad, <textarea>, and editArea.
There are also 3rd party supported plugins for: Dreamweaver, Sublime Text, UltraEdit, TopStyle, GEdit, BBEdit, TextWrangler, and EmEditor.
Zen-Coding has proved to be an extremely useful tool that coders can use to save both time and ensure accuracy. While some people experience a little bit of a learning curve, once mastered, Zen-Coding is very simple to use. However, it is not going to be very helpful if you are one of those coders that never really plan ahead. The farther ahead you can plan, the more time and effort it will save.