Monday, April 1, 2013

Code fasta, Fasta, FASTA with zen coding

Zen wunz go fasta!
If you're familiar with Warhammer 40k Orks, then the reference should be appropriate otherwise, WHOOOSH!

What is this zen coding BS then, you might ask? Well, zen coding is something Google came up with to write out HTML faster. Zen is not a technique mind you but rather an editor plugin for your favorite IDE allowing you to write in abbreviations and then expanding it to completed code.
You can basically write shit like this:

div#page>div.logo+ul#navigation>li*5>a

And have it expand to this:

<div id="page">  
     <div class="logo"></div>  
     <ul id="navigation">  
         <li><a href=""></a></li>  
         <li><a href=""></a></li>  
         <li><a href=""></a></li>  
         <li><a href=""></a></li>  
         <li><a href=""></a></li>  
     </ul>  
 </div>

We should be able to see the convention quite easily and as you can see quite convenient in handling with repetitive code. Unless, of course you're someone who like's typing, then that's another thing altogether.

This also works on Less and Sass code among other things. And it also comes as Netbeans plugin which is very nice. Other implementations are also available.