<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Monday By Noon &#187; Aptana</title>
	<atom:link href="http://mondaybynoon.com/tag/aptana/feed/" rel="self" type="application/rss+xml" />
	<link>http://mondaybynoon.com</link>
	<description>A resource for Web designers and developers to read about and discuss their craft.</description>
	<lastBuildDate>Wed, 18 Aug 2010 17:44:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The Art of zen-coding: Bringing Snippets to a New Level</title>
		<link>http://mondaybynoon.com/2009/08/17/the-art-of-zen-coding-bringing-snippets-to-a-new-level/</link>
		<comments>http://mondaybynoon.com/2009/08/17/the-art-of-zen-coding-bringing-snippets-to-a-new-level/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 12:32:58 +0000</pubDate>
		<dc:creator>Jonathan Christopher</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Favorites]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Aptana]]></category>
		<category><![CDATA[Coda]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Espresso]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[zen-coding]]></category>

		<guid isPermaLink="false">http://mondaybynoon.com/?p=535</guid>
		<description><![CDATA[zen-coding is a new plugin for Web designers and developers, letting them write their code at high speed.]]></description>
			<content:encoded><![CDATA[<p>If I had to single out one thing that most significantly changed the way I write markup, code, and style, it would without a doubt be snippets. To get even more specific, it would be the snippet implementation of <a href="http://macromates.com/">TextMate</a>. When I first saw the feature at work via screencast, I was literally flabbergasted. I can&#8217;t explain how much it changed the way I thought about writing code, productivity, and overall quality of work. I was currently running Linux at the time, so I spent day and night trying to find replicate functionality in a native editor for myself.</p>
<p>This was before the days of the <a href="http://live.gnome.org/Gedit/Plugins/Snippets">Gedit implementation of snippets</a> so I did my best to <a href="http://mondaybynoon.com/2007/03/12/using-scite-with-textmate-style-snippets/">replicate TextMate in SciTE</a>. <em>It was <strong>awesome</strong></em>. Incorporating snippets changed the way I worked by orders of magnitude, and the implementation found in TextMate is the bar to which I compare every other editor I&#8217;ve tried.</p>
<p>What&#8217;s great is that snippets seem to have hit the mainstream. Besides OS X specific editors such as <a href="http://panic.com/coda">Panic&#8217;s Coda</a> and <a href="http://macrabbit.com/espresso">MacRabbit&#8217;s Espresso</a>, platform independent editors and <abbr title="Integrated Development Environment">IDE</abbr>s have their own implementations as well. Apart from <a href="http://www.e-texteditor.com/">E TextEditor</a> on Windows, however, I haven&#8217;t seen an editor implement snippets to the full effect of TextMate.</p>
<h2>The big deal about snippets</h2>
<p>The deciding factor for me is the ability to have multiple stops per snippet. This gives you the ability to not only share snippets (through Bundles or otherwise) but also <em>very easily</em> write your own. Every designer/developer has his or her own set of tricks, and a generic bundle isn&#8217;t going to cover you 100%. The great thing about a solid implementation of snippets puts the power in your hand to finish the job and add the final touch of customization you need.</p>
<p>I&#8217;m always on the hunt for a newer, better editor. It&#8217;s a curse I&#8217;ve had for years and one that will never go away. To be brutally honest, snippets are the only thing holding me to TextMate at this point, as there are a number of strong contenders on the market now, targeted specifically toward Web developers. They&#8217;re also gorgeous to boot.</p>
<p>I was to the point where I was simply waiting for the various editors to publish a few dot releases including a solid snippets implementation a la TextMate. That is until I discovered <a href="http://code.google.com/p/zen-coding/">zen-coding</a>. My mind was blown all over again.</p>
<h2>zen-coding takes snippets to a new level</h2>
<p><a href="http://code.google.com/p/zen-coding/">zen-coding</a> touts itself as a &#8220;set of plugins for HTML and CSS hi-speed coding&#8221; and my gosh it lives up to the name. The snippets implementation provided by zen-coding are based on specification drafts, and a heck of a lot has been included by default.</p>
<ul>
<li><a href="http://code.google.com/p/zen-coding/wiki/ZenHTMLElementsEn">HTML elements (based on the HTML5 draft spec)</a></li>
<li><a href="http://code.google.com/p/zen-coding/wiki/ZenHTMLSelectorsEn">HTML selectors</a></li>
<li><a href="http://code.google.com/p/zen-coding/wiki/ZenCSSPropertiesEn">CSS properties (based on the CSS3 draft spec)</a></li>
</ul>
<p>Instead of going over the documentation here, I&#8217;d just like to call a bit of attention to the <a href="http://code.google.com/p/zen-coding/wiki/ZenHTMLSelectorsEn">HTML selectors</a> linked above. This is truly what made my jaw drop.</p>
<p>The biggest calling point for zen-coding for me is its implementation of HTML selectors as snippet triggers. zen-coding includes an entirely new angle to writing markup, and it facilitates the feature by letting you write HTML based on CSS selectors. It&#8217;s so simple it&#8217;s confusing at first. I think it&#8217;s best explained by doing a quick before and after. If you were to type:</p>
<pre class="sh_css"><code>div#name.one.two</code></pre>
<p>and follow that with the zen-coding plugin keystroke (CMD+E in TextMate), the plugin will reformat the line as:</p>
<pre class="sh_html"><code>&lt;div id=&quot;name&quot; class=&quot;one two&quot;&gt;&lt;/div&gt;</code></pre>
<p>Let&#8217;s get a bit more advanced, typing:</p>
<pre class="sh_css"><code>ul#name>li.item</code></pre>
<p>will result in:</p>
<pre class="sh_html"><code>&lt;ul id=&quot;name&quot;&gt;
    &lt;li class=&quot;item&quot;&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<p>Last, but not least:</p>
<pre class="sh_css"><code>p.one+p.two</code></pre>
<p>will result in:</p>
<pre class="sh_html"><code>&lt;p class=&quot;one&quot;&gt;&lt;/p&gt;
&lt;p class=&quot;two&quot;&gt;&lt;/p&gt;</code></pre>
<p>It doesn&#8217;t stop there. zen-coding has included an even more elaborate set of possibilities on top of valid CSS selectors.</p>
<h3>Element multiplication and variables</h3>
<p>A really fascinating feature of the CSS selector abilities comes from element multiplication. Perhaps one of the most tedious things to mark up (when not working from existing copy) is a list (or eight). zen-coding does its part to lighten the load, quite a bit:</p>
<pre class="sh_css"><code>ul#name>li.item*3</code></pre>
<p>provides:</p>
<pre class="sh_html"><code>&lt;ul id=&quot;name&quot;&gt;
    &lt;li class=&quot;item&quot;&gt;&lt;/li&gt;
    &lt;li class=&quot;item&quot;&gt;&lt;/li&gt;
    &lt;li class=&quot;item&quot;&gt;&lt;/li&gt;
&lt;/ul&gt;</code></pre>
<p>By including a multiplication modifier, you can control <strong>how many</strong> child elements are included in the snippet!</p>
<p>The other really interesting implementation deals with variables in snippet output, which is neat:</p>
<pre class="sh_css"><code>select>option#item-$*3</code></pre>
<p>gives you:</p>
<pre class="sh_html"><code>&lt;select&gt;
    &lt;option id=&quot;item-1&quot;&gt;&lt;/option&gt;
    &lt;option id=&quot;item-2&quot;&gt;&lt;/option&gt;
    &lt;option id=&quot;item-3&quot;&gt;&lt;/option&gt;
&lt;/select&gt;</code></pre>
<p>By including the dollar sign, you can include a reference to the index of the element you&#8217;re multiplying. Although really specific, it could (and probably will) come in <em>very</em> handy from time to time.</p>
<p>I mean if you&#8217;re not impressed yet, I just give up!</p>
<h4>See it in action</h4>
<p>There are a few screencasts referenced on the <a href="http://code.google.com/p/zen-coding/">Google Code page for zen-coding</a> which illustrate the above really well:</p>
<ul>
<li><a href="http://pepelsbey.net/pro/2008/08/zen-html/">Zen HTML features, 1.х branch, screencast</a></li>
<li><a href="http://pepelsbey.net/pro/2008/10/zen-css/">Zen CSS features, 1.х branch, screencast</a></li>
<li><a href="http://chikuyonok.ru/2009/04/aptana-zen-coding-v01-beta/">Aptana Zen HTML features, 2.х branch, screencast</a></li>
</ul>
<p>Definitely check them out if my explanation is still a bit foggy, as the screencast really helps display what this plugin is capable of.</p>
<h4>Compatibility</h4>
<p>One of the finer points of zen-coding is the fact that the developer(s) are taking the time and effort to publish this genius for <strong>multiple editors</strong> both for OS X and cross-platform. Currently, according to the Google Code page, the plugin has versions for:</p>
<ul>
<li><a href="http://macromates.com/">TextMate</a></li>
<li><a href="http://www.aptana.com/">Aptana</a></li>
<li><a href="http://panic.com/coda/">Coda</a></li>
<li><a href="http://www.netbeans.org/">NetBeans</a></li>
<li><a href="http://macrabbit.com/espresso/">Espresso</a></li>
</ul>
<p><del>Unfortunately, I didn&#8217;t find a download link to the Espresso Sugar, but I will keep my eyes open for that as well.</del> <ins><strong>Update:</strong> the lead developer, in <a href="http://mondaybynoon.com/2009/08/17/the-art-of-zen-coding-bringing-snippets-to-a-new-level/#comment-12886">his comment below</a>, let us know that the Sugar is included by default in Espresso releases.</ins> I&#8217;ve checked out the plugin both in TextMate and Coda and I can say that this plugin alone makes Coda a true contender for more advanced developers looking for a better implementation of Clips (until Coda natively supports snippets (fingers crossed for 2.0 bigtime)).</p>
<p><strong>Note:</strong> to fully install in TextMate, you&#8217;ll need to download three bundles. At the time of this writing, the three download links are titled as:</p>
<ul>
<li>Zen.Coding-TextMate.v0.3.zip (implements zen-coding)</li>
<li>TextMate.Zen.HTML.1.3.zip (implements HTML functionality)</li>
<li>TextMate.Zen.CSS.1.3.zip (implements CSS functionality)</li>
</ul>
<p>Be sure to install each bundle you need!</p>
<p>Non OS X users may find a bit of luck in that the plugin is released for both Aptana and NetBeans, two very popular IDEs as of late. Windows users should be able to use the TextMate bundles in E as you&#8217;re accustomed. While there is definitely activity on the Google Code page, I&#8217;m not positive that other editors will be supported in future releases.</p>
<h4>I love Web design.</h4>
<p>This is the line of thinking that really gets me excited about what I do. zen-coding has again completely changed the way I approach writing code, and has raised the bar to a new height. What else is great is that this functionality was provided out of someone else&#8217;s love for the industry as well. Their great idea is now making my life even easier, and that cycle will definitely continue in the Web design community.</p>
]]></content:encoded>
			<wfw:commentRss>http://mondaybynoon.com/2009/08/17/the-art-of-zen-coding-bringing-snippets-to-a-new-level/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 4/15 queries in 0.007 seconds using disk

Served from: mondaybynoon.com @ 2010-09-06 11:23:25 -->