<?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>Artful Code &#187; Soap box</title>
	<atom:link href="http://www.artfulcode.net/categories/soap-box/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.artfulcode.net</link>
	<description>Resources and tips for dynamic, interactive languages.</description>
	<lastBuildDate>Fri, 09 Sep 2011 02:15:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Fixed &#8211; Blackberry OS 7</title>
		<link>http://www.artfulcode.net/articles/fixed-blackberry-os-7/</link>
		<comments>http://www.artfulcode.net/articles/fixed-blackberry-os-7/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 16:05:18 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Soap box]]></category>
		<category><![CDATA[blackberry]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/articles/fixed-blackberry-os-7/</guid>
		<description><![CDATA[I just bought the Blackberry Bold 9930 with OS 7' newly available from Verizon (I have heard that the Torch will be available later this week). After some very hairy experiences with OS 6, I was both excited and anxious to experience the new OS on a handset with the hardware to run it well.]]></description>
			<content:encoded><![CDATA[<p>I just bought the Blackberry Bold 9930 with OS 7 newly available from Verizon (I have heard that the Torch will be available later this week). After some very hairy experiences with OS 6, I was both excited and anxious to experience the new OS on a handset with the hardware to run it well.<span id="more-846"></span></p>
<p>My initial impression is good. After a bit of difficulty related to the new App World 3 (I recommend sticking with v2 for now), my data and applications are restored and I am chugging away.</p>
<p><strong>The keyboard</strong></p>
<p>While most smart phones now use soft keys, I still prefer the Bold&#8217;s hardware keyboard. Those who share the preference will absolutely <em>love</em> the new Bold&#8217;s keyboard. For one thing, it is larger and wider, with a slight curve, making it easier to reach the keys on the outside. It feels very nice to use as well. Many will scoff, but I think that this is just about its most attractive feature; after all, the keyboard is so integral to the Bold experience that it makes a disproportionate difference in the &#8220;feel&#8221; of the phone.</p>
<p><strong>Touch Screen</strong></p>
<p>The touch screen is pleasantly surprising. The screen itself is crisp and bright, and very touch responsive. I was not a big fan of the new layout on OS 6, but with the touch screen it is quite easy and even efficient to use.</p>
<p>The screen is also slightly larger with a better resolution. Users of the Torch or other smart phones won&#8217;t see it, but Tour/Bold and Curve users will appreciate the boost in screen real estate.</p>
<p><strong>The OS</strong></p>
<p>OS 7 deals with most of the issues I had with OS 6. It is much faster, in part due to the new phone&#8217;s hardware. Transitions and effects are now hardware-accelerated, reducing the time (and power) required to process them. Not only is it faster than the slow, bogged down experience I had with OS 6, but it is snappier and more responsive than any BB I have owned to date. Even the Desktop-based interactions, like backups and sync, are much faster.</p>
<p>Additionally, universal search is faster and indexes much more quickly. Once painful to use in OS 6, it is now the fastest way to find applications and messages.</p>
<p><strong>Battery life</strong></p>
<p>Blackberry has always been king of battery life. No other smart phone ever comes close to a BlackBerry, and that has traditionally been one of the (extremely few) advantages of shipping much slower hardware.</p>
<p>That said, the new Bold has a smaller battery than my last Bold (the 9650), but appears to last every bit as long. Whether it is due to efficiency gains in the software or the faster hardware, it has made a difference.</p>
<p>It is not intuitive, but just as a heavier vehicle will use more gas with an under powered-engine, software can draw a lot of power when the hardware cannot keep up. This is especially true of embedded programming, where the environment places such constraints on resources. My suspicion is that the combination of GPU-accelerated graphics and better reception are helping to keep the OS from pegging the CPU so heavily. In any case, it is a welcome enhancement.</p>
<p><strong>The ugly</strong></p>
<p>I still can&#8217;t send pictures or video directly from the browser. You can only send or post a link, or go to the trouble of saving the file, sending it, and deleting it. I would not think it should be too hard to add this feature, and a number of folks miss it. It is one of those &#8220;super app&#8221; features that make BB pleasant to use. It saves time by linking apps tightly.</p>
<p><strong>Conclusion</strong></p>
<p>If you have been hanging onto your old Bold or Tour because of OS 6, now is the time to upgrade. It is well worth the money (to me, anyway) to get the new Bold 9930. it is everything I had hoped that my last phone would be, and BB users are going to love it. It is good to see RIM roll with the punches and get back up again.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Ffixed-blackberry-os-7%2F&amp;title=Fixed+%26%238211%3B+Blackberry+OS+7" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Ffixed-blackberry-os-7%2F&amp;title=Fixed+%26%238211%3B+Blackberry+OS+7" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Fixed+%26%238211%3B+Blackberry+OS+7&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Ffixed-blackberry-os-7%2F&amp;title=Fixed+%26%238211%3B+Blackberry+OS+7" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Ffixed-blackberry-os-7%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Ffixed-blackberry-os-7%2F&amp;title=Fixed+%26%238211%3B+Blackberry+OS+7" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Ffixed-blackberry-os-7%2F&amp;title=Fixed+%26%238211%3B+Blackberry+OS+7" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Ffixed-blackberry-os-7%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Fixed+%26%238211%3B+Blackberry+OS+7+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Ffixed-blackberry-os-7%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/fixed-blackberry-os-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My thoughts on Blackberry OS 6</title>
		<link>http://www.artfulcode.net/articles/my-thoughts-on-blackberry-os-6/</link>
		<comments>http://www.artfulcode.net/articles/my-thoughts-on-blackberry-os-6/#comments</comments>
		<pubDate>Mon, 16 May 2011 01:32:12 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Soap box]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[blackberry]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/?p=840</guid>
		<description><![CDATA[I have been using Blackberry OS 6 on my Bold 9650 (pre-installed) for a few weeks. I love some of the new functionality, especially search and the new context menus. Search works very similarly to Spotlight on OSX. The new context menus do a good job of splitting common contextual options out of the BB menu. I also like the quicker boot time.]]></description>
			<content:encoded><![CDATA[<p>I have been using Blackberry OS 6 on my Bold 9650 (pre-installed) for a few weeks. I love some of the new functionality, especially search and the new context menus. Search works very similarly to Spotlight on OSX. The new context menus do a good job of splitting common contextual options out of the BB menu. I also like the quicker boot time.<span id="more-840"></span></p>
<p>It feels pretty top heavy, though. I think they tried to bolt the QNX UI on top of BB OS, but without the power and efficiency underneath the hood to make it perform adequately on my handset. The 9650 seems high end for OS 5 but low end for OS 6. Some of the rendering, smooth scrolling, and transparency effects really bog down the system, at least on the 9650’s hardware.</p>
<p>The only other real problem I have with it is that it is missing a feature I really like from OS 5 &#8211; the ability to send a picture via MMS directly from the browser.</p>
<p>For a while, I used an OS 5 theme which eliminated many of the more expensive UI elements, like app tabs, but at some point I lost the ability to use themes, even after a clean install.</p>
<p>So for now, I’m back to OS 5, and my phone is much snappier again. Oh well. Better to be a big fish in a little pond, I suppose.</p>
<p>&nbsp;</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fmy-thoughts-on-blackberry-os-6%2F&amp;title=My+thoughts+on+Blackberry+OS+6" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fmy-thoughts-on-blackberry-os-6%2F&amp;title=My+thoughts+on+Blackberry+OS+6" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=My+thoughts+on+Blackberry+OS+6&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fmy-thoughts-on-blackberry-os-6%2F&amp;title=My+thoughts+on+Blackberry+OS+6" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fmy-thoughts-on-blackberry-os-6%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fmy-thoughts-on-blackberry-os-6%2F&amp;title=My+thoughts+on+Blackberry+OS+6" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fmy-thoughts-on-blackberry-os-6%2F&amp;title=My+thoughts+on+Blackberry+OS+6" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fmy-thoughts-on-blackberry-os-6%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+My+thoughts+on+Blackberry+OS+6+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fmy-thoughts-on-blackberry-os-6%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/my-thoughts-on-blackberry-os-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blackberry Bridge and the Playbook</title>
		<link>http://www.artfulcode.net/articles/blackberry-bridge-and-the-playbook/</link>
		<comments>http://www.artfulcode.net/articles/blackberry-bridge-and-the-playbook/#comments</comments>
		<pubDate>Mon, 02 May 2011 23:44:32 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Soap box]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[playbook]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[rim]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/?p=832</guid>
		<description><![CDATA[After silently drooling over the usefulness of my wife's iPad for the last few months, I finally gave in to temptation and decided to get a tablet. Of course, being a Blackberry man, I was ecstatic about the release of the Playbook. The Playbook OS is QNX, and ultra fast, light-weight, real time unix that I have been a fan of since college. I always felt that it would have been a wonderful system for Apple to have built OSX on, but it seems that Blackberry at least gets to beat Apple to the punch on something, anyway.]]></description>
			<content:encoded><![CDATA[<p>After silently drooling over the usefulness of my wife&#8217;s iPad for the last few months, I finally gave in to temptation and decided to get a tablet. Of course, being a Blackberry man, I was ecstatic about the release of the Playbook. The Playbook OS is QNX, and ultra fast, light-weight, real time unix that I have been a fan of since college. I always felt that it would have been a wonderful system for Apple to have built OSX on, but it seems that Blackberry at least gets to beat Apple to the punch on something, anyway. <span id="more-832"></span></p>
<p>The Playbook has suffered from a rash of poor reviews, largely due to the lack of apps and RIM&#8217;s decision to release without  the native PIM suite ready. These things obviously detract from the experience, especially the absence of email and messaging software.</p>
<p>I try to take the long view, though. This is a brand new tablet platform, and software environment will eventually get a complete host of apps, some useful, some not, just as is the case with the Apple app store as well as the Android marketplace. For the moment, though, it is mostly filled with what appear to be very mediocre experiments with the platform. Very few are worth the money at the moment.</p>
<p>The system is very slick, though. The navigation becomes very natural with very little effort, and the browser is lightening fast. The bridge functionality is excellent, although it will frustrate the unenlightened (read: non-Blackberry users) that it requires a Blackberry hand set to use.</p>
<p>Bridge is extremely cool. It gets overlooked as a stop-gap until RIM releases the official, native PIM, but it gives Blackberry users something important that a more typical suite might easily overlook. Messages are pushed to a Blackberry, rather than synchronized, as is the case with IMAP. Bridge maintains control over those messages on the hand held, rather than the tablet. That&#8217;s the right way, because a phone is going to stay with you much more than a tablet (new toy syndrome notwithstanding).</p>
<p>Bridge gives me an extra piece of awesome, too. The Bridge Browser, while not running at native speed, provides a decent web experience without tethering charges. That not only saves me money, but it keeps me feeling young by letting me pretend that I am sticking it to the man, and you just can&#8217;t put a price on that.</p>
<p>Therefore, I really hope that bridge is not condemned once RIM releases their PIM suite. I really want to see them add to it and give it the polish that RIM is so good at. I hope it continues as a special extra for BB users, and becomes fully integrated, which is one of the major areas of polish were RIM lords it over the competition</p>
<p>On another note, I also very humbly ask that whoever is in charge of the keyboard make it behave exactly as it does on my Blackberry. I am tired of having to type apostrophes and capitalize with a separate button, thank you very much.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fblackberry-bridge-and-the-playbook%2F&amp;title=Blackberry+Bridge+and+the+Playbook" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fblackberry-bridge-and-the-playbook%2F&amp;title=Blackberry+Bridge+and+the+Playbook" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Blackberry+Bridge+and+the+Playbook&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fblackberry-bridge-and-the-playbook%2F&amp;title=Blackberry+Bridge+and+the+Playbook" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fblackberry-bridge-and-the-playbook%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fblackberry-bridge-and-the-playbook%2F&amp;title=Blackberry+Bridge+and+the+Playbook" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fblackberry-bridge-and-the-playbook%2F&amp;title=Blackberry+Bridge+and+the+Playbook" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fblackberry-bridge-and-the-playbook%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Blackberry+Bridge+and+the+Playbook+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fblackberry-bridge-and-the-playbook%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/blackberry-bridge-and-the-playbook/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>goto statement considered</title>
		<link>http://www.artfulcode.net/articles/goto-statement-considered/</link>
		<comments>http://www.artfulcode.net/articles/goto-statement-considered/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 03:09:40 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Soap box]]></category>
		<category><![CDATA[goto]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/?p=816</guid>
		<description><![CDATA[Everyone knows not to use goto, right?  Dijkstra's words on the subject have risen to the level of gospel in the programming community. Not that I do not completely agree... in most cases.]]></description>
			<content:encoded><![CDATA[<p>Everyone knows not to use goto, right?  Dijkstra&#8217;s words on the subject have risen to the level of gospel in the programming community. Not that I do not completely agree&#8230; in most cases.<span id="more-816"></span></p>
<p>I have to admit that I occasionally resort to goto myself. This week was one such an occasion. But before you pick up your torch and farming implement of choice and join the mob heading for my castle gates, please consider that  Dijkstra&#8217;s letter was complaining about unrestricted goto, which was a popular feature of languages at the time. It was an unstructured precursor of the subroutine and structured programming, which put goto on a leash and taught it not to bark at the neighbors. In restricting goto to local jumps, as most modern languages supporting the feature do, the beast became much less fearsome. In fact, a while loop is just a structured goto, as is try/catch (albeit with a little extra magic.)</p>
<p>Perl, of course, does not impose such restrictions on a programmer (although it does prohibit jumping into blocks that require initialization, such as other functions.) With a little discipline, though, goto is a feature and quite useful. It can be used to make extremely complex loops explicit and easy to follow as well as allow a loop to break to any outer loop in the current call stack.</p>
<p>As an example, I recently wrote a function to increment a string of arbitrary alphanumeric characters, where letters must maintain their case but increment as base-26 numbers and numbers increment normally (base 10). For example, if a letter increments past z, it becomes a and the next character to the left is then incremented. The increment logic fit into a function that took two of these strings and calculated all possible values in between to support some limited set operations against two alphanumeric ranges.</p>
<p>My original code for the increment logic was grisly at best. It took a series of nested while loops and state variables that were incremented or decremented as needed. I avoided recursion because the sequences were of arbitrary length. Breaking the code into subroutines made it more complex to maintain loop state. Using goto allowed me to break apart the logic into blocks without the overhead or state-passing necessary to shoehorn the logic into subroutines. I was able to label each part clearly and jump between them as needed to increment or &#8220;carry the 1.&#8221; I reduced the size of the code to just a couple dozen lines, including safety checks, and found that the goto code was much easier to read and reason about.</p>
<p>That said, I want to emphasize strongly that goto should be kept local. Jumping to outer function calls makes the logic of a program difficult to reason about and changes scope in confusing ways. But as a way of structuring complex loops and iterative logic, you just can&#8217;t beat goto.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fgoto-statement-considered%2F&amp;title=goto+statement+considered" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fgoto-statement-considered%2F&amp;title=goto+statement+considered" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=goto+statement+considered&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fgoto-statement-considered%2F&amp;title=goto+statement+considered" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fgoto-statement-considered%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fgoto-statement-considered%2F&amp;title=goto+statement+considered" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fgoto-statement-considered%2F&amp;title=goto+statement+considered" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fgoto-statement-considered%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+goto+statement+considered+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fgoto-statement-considered%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/goto-statement-considered/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>The rebirth of the BBS</title>
		<link>http://www.artfulcode.net/articles/the-rebirth-of-the-bbs/</link>
		<comments>http://www.artfulcode.net/articles/the-rebirth-of-the-bbs/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 17:56:24 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Soap box]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[social networking]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/?p=777</guid>
		<description><![CDATA[A few of us are old enough to remember the days before the Internet, when "online" meant you had Prodigy, AOL, or CompuServe. Some of us are venerable enough to predate even those dinosaurs and recall the age of 300 baud modems, Telix, typing ATDT into the terminal, and local BBSes with names like Gunner's Grotto and Elfstone (and if you recognize those two, you probably know where I lived in high school). I spent quite a few late nights chatting on the Grotto, a lavish MajorBBS with more than a dozen phone lines on rotary. I remember getting that brand new 9600 baud modem and being awed by its speed.]]></description>
			<content:encoded><![CDATA[<p>A few of us are old enough to remember the days before the Internet, when &#8220;online&#8221; meant you had Prodigy, AOL, or CompuServe. Some of us are venerable enough to predate even those dinosaurs and recall the age of 300 baud modems, Telix, typing ATDT into the terminal, and local BBSes with names like Gunner&#8217;s Grotto and Elfstone (and if you recognize those two, you probably know where I lived in high school). I spent quite a few late nights chatting on the Grotto, a lavish MajorBBS with more than a dozen phone lines on rotary. I remember getting that brand new 9600 baud modem and being awed by its speed.<span id="more-777"></span></p>
<h3>At the dawn of time&#8230;</h3>
<p>The old BBS is terribly antiquated by today&#8217;s standards. A <em>sysop</em> (or webmaster for you young folk) would dedicate perhaps half a dozen phone lines to their server, running MajorBBS (which was not a PHP-powered forum), Angelfire (which was not a defunct web hosting company), or Wildcat. Each had their strong points, but they usually had some form of user-to-user chat, in-system messaging, file sharing, and games (who remembers spending all night playing <strong>Legend of the Red Dragon </strong>or <strong>Tradewars</strong>?)</p>
<p>The Internet freed us from this more intimate world. Email now worked between all systems, and in-house email either conformed or disappeared. Prodigy and CompuServe died, while AOL adapted (for a while, anyway). Files could be shared simply and quickly, and anyone with basic knowledge of HTML and an ad-supported account somewhere could participate.</p>
<h3>Modern day</h3>
<p>These days it&#8217;s for granted that everyone and everything is connected. With Twitter, even an everyday Joe can be sure that all of their friends are kept up to date on how much they are enjoying that ham sandwich.</p>
<p>The social networking trend is interesting to me because I see it as a shift back to the more intimate realm of the BBS. Counter to the culture of full exposure engendered by the Internet, folks are gravitating toward sites that provide a more limited experience. Even the most curmudgeonly of us grudgingly accept Facebook and use it to filter our social lives online.</p>
<p>Networking sites provide a safe haven &#8211; a controlled community, much in the style of the old BBS. We prefer their primitive messaging to full-featured email clients when communicating with our friends and family, not because we are Luddites, but because it is more personal. There is something quite uncomfortable about sending your mother an email at hotmomma288@yahoo.com.</p>
<h3>Looking back</h3>
<p>This is something of a rehash of an article I wrote <a title="Social Networks" href="/articles/social-networks/">last year</a>. In fact, reading back, I even took the same grumpy tone :). I was a bit late signing up for Facebook, but I have to admit that I enjoy it. Now, if they could just port <strong>Legend of the Red Dragon</strong> over&#8230;</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fthe-rebirth-of-the-bbs%2F&amp;title=The+rebirth+of+the+BBS" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fthe-rebirth-of-the-bbs%2F&amp;title=The+rebirth+of+the+BBS" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=The+rebirth+of+the+BBS&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fthe-rebirth-of-the-bbs%2F&amp;title=The+rebirth+of+the+BBS" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fthe-rebirth-of-the-bbs%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fthe-rebirth-of-the-bbs%2F&amp;title=The+rebirth+of+the+BBS" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fthe-rebirth-of-the-bbs%2F&amp;title=The+rebirth+of+the+BBS" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fthe-rebirth-of-the-bbs%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+The+rebirth+of+the+BBS+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fthe-rebirth-of-the-bbs%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/the-rebirth-of-the-bbs/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>PHP is a framework</title>
		<link>http://www.artfulcode.net/articles/php-is-a-framework/</link>
		<comments>http://www.artfulcode.net/articles/php-is-a-framework/#comments</comments>
		<pubDate>Fri, 15 May 2009 18:12:26 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Soap box]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/?p=624</guid>
		<description><![CDATA[Rails, Django, Spring &#8211; application frameworks like these are now ubiquitous in the development of web-based applications. This is part of a trend in many general purpose languages of building toward the web. For these, the application framework is not just a buzzword; it is the abstraction used to build the language up to the [...]]]></description>
			<content:encoded><![CDATA[<p>Rails, Django, Spring &#8211; application frameworks like these are now ubiquitous in the development of web-based applications. This is part of a trend in many general purpose languages of building toward the web. For these, the application framework is not just a buzzword; it is the abstraction used to build the language up to the browser.<span id="more-624"></span></p>
<p>PHP was designed with the reverse in mind. In its first release, it could have been considered to be a DSL for web-based applications. It was written to specifically address the needs to writing web applications, and is now building toward a more general purpose language. In all likelihood, this is the wrong way around. It certainly does not fall into the bottom-up design Shangri-La of which Paul Graham is such a proponent.</p>
<p>In reality, though, web-based applications are driving the industry. PHP is still very relevant in that domain. From very early on, PHP was centered on functionality that is considered basic to any web-based framework. Functionality without which each library is simply a thin wrapper over CGI. Features like easy access to GET and POST variables, session handling, header control, and database access have been built into PHP from, if not the beginning, then close enough that dinosaurs like myself don&#8217;t remember it ever being otherwise.</p>
<p>PHP has its own share of frameworks, too, which allow the programmer to painstakingly map SQL schema to XML or vice versa. They carefully abstract the logic out of the view and force the programmer to jump through hoops to write a simple application (although, for complex applications, this often makes the programmer&#8217;s life *much* easier.)</p>
<p>PHP does not need any of this. In fact, the most pragmatic framework I have used to date for PHP is the <a href="http://clickontyler.com/simple-php-framework/">Simple PHP Framework</a>, which is just a set of useful classes to automate some of the more tedious areas of web development. What it does not do is get in the programmer&#8217;s way. It is <a href="http://en.wikipedia.org/wiki/Occam's_razor">Occam&#8217;s razor</a> at work in the world of web development. From the SPF website, quoting a non-existent link:</p>
<blockquote><p>&#8220;All the web frameworks in the world won’t turn a shitty programmer into a good one.&#8221;</p></blockquote>
<p>What PHP is not is elegant. It does not have beauty of prose, nor those features that make languages like ML and Lisp so exciting, such as closures, functions-as-objects, or lazy evaluation. Instead, PHP is, above all, a practical language. Instead, it has less sexy features, such as built-in support for XML, XSLT, and Xpath, support most databases, and the built-in ability to serialize to and from JSON and cookie strings.</p>
<p>It is easy to overlook how simple PHP makes many tasks that are complex in other frameworks. For example, Django&#8217;s form library is large and complex. I&#8217;ve no doubt that most other frameworks have equally Byzantine systems for developing reusable forms. In PHP, one might just write:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">function input($type, $name, $display, $value)
{
    &lt; ?
        &lt;label&gt;&lt; ?= $display ?&gt;
        &lt;input type=&quot;<span style="color: #000000; font-weight: bold;">&lt;?=</span> <span style="color: #000088;">$type</span> ?<span style="color: #339933;">/&gt;</span><span style="color: #0000ff;">&quot; value=&quot;</span><span style="color: #339933;">&lt;</span> ?<span style="color: #339933;">=</span> <span style="color: #000088;">$value</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; /&gt;
    ?&gt;
}</pre></div></div>

<p>The function could be refined to separate the template and the code by putting the HTML into a separate include:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$type</span><span style="color: #339933;">,</span> <span style="color: #000088;">$name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dispaly</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">include</span> <span style="color: #0000ff;">'templates/input.inc.php'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Simple, right? Which is not to say that PHP&#8217;s faults are not legion. That said, I think that PHP sometimes does a better job of building toward general purpose programming than many other languages do of building toward web development.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fphp-is-a-framework%2F&amp;title=PHP+is+a+framework" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fphp-is-a-framework%2F&amp;title=PHP+is+a+framework" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=PHP+is+a+framework&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fphp-is-a-framework%2F&amp;title=PHP+is+a+framework" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fphp-is-a-framework%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fphp-is-a-framework%2F&amp;title=PHP+is+a+framework" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fphp-is-a-framework%2F&amp;title=PHP+is+a+framework" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fphp-is-a-framework%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+PHP+is+a+framework+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fphp-is-a-framework%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/php-is-a-framework/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Social networks</title>
		<link>http://www.artfulcode.net/articles/social-networks/</link>
		<comments>http://www.artfulcode.net/articles/social-networks/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 18:17:52 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Soap box]]></category>
		<category><![CDATA[culture]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/?p=391</guid>
		<description><![CDATA[I&#8217;m old enough that I remember when email happened on the local university&#8217;s VAX system or by dialing into some yahoo&#8217;s computer running Angelfire BBS with four phone lines.  I remember just how blazingly fast a 9600 baud modem seemed.  I&#8217;m even old enough to remember typing ATDT into Telix :).  Alright, I&#8217;m only 30, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m old enough that I remember when email happened on the local university&#8217;s VAX system or by dialing into some yahoo&#8217;s computer running Angelfire BBS with four phone lines.  I remember just how blazingly fast a 9600 baud modem seemed.  I&#8217;m even old enough to remember typing ATDT into Telix :).  Alright, I&#8217;m only 30, but even at my age I sometimes feel confounded by current trends and am just beginning to have that urge to shoo youngsters off my lawn.  Not that they are ever on my lawn.  They are generally at home, on MySpace or Facebook.<span id="more-391"></span></p>
<p>I think I understand the pull of social networking sites.  When I was a teenager, playing on my dad&#8217;s old Apple or, if he would let me, his spanking new 486 <em>with an 8 color monitor</em>, I would spend hours waiting to get into some local BBS with half a dozen phone lines so I could explore.  And it <em>was</em> exploring.  Back then, system running Angelfire, Wildcat, and MajorBBS were ahead of the game, with email, chat, message boards (then called forums) and games.  Ah, for the hours I wasted playing Tradewars :)</p>
<p>What made these work was the combination of discovery and socializing.  I knew the other folks who used the BBSs in my town.  I saw them on the forums and in the chat rooms.  We fought each other in Tradewars and Legend of the Red Dragon.  You met new friends and interacted in a unique environment (without the risk of getting stuffed into a locker at school, no less).</p>
<p>Social networking sites are just the latest incarnation of this.  Of course they are popular with teenagers; social networking is part and parcel of <em>being</em> a teenager.  My wife teaches college-level courses for high schoolers, and they are constantly sneaking onto MySpace or Facebook (or texting) during class.  Back in my day, we just passed notes.</p>
<p>I must admit to having recently signed up for a Facebook account.  It is neat to be able to look up old college buddies and see what people are doing and where they have ended up.  It is the 30-year-old&#8217;s equivalent of an octogenarian checking the obituaries every day for familiar names.  Of course, I have not yet stooped to a MySpace account.  If I wanted a scrolling background, embedded sound, and blinking, marquee text, I would go back to 1998 and build a website in Frontpage.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fsocial-networks%2F&amp;title=Social+networks" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fsocial-networks%2F&amp;title=Social+networks" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Social+networks&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fsocial-networks%2F&amp;title=Social+networks" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fsocial-networks%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fsocial-networks%2F&amp;title=Social+networks" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fsocial-networks%2F&amp;title=Social+networks" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fsocial-networks%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Social+networks+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fsocial-networks%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/social-networks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>In defense of newLISP</title>
		<link>http://www.artfulcode.net/articles/in-defense-newlisp/</link>
		<comments>http://www.artfulcode.net/articles/in-defense-newlisp/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 15:25:51 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Soap box]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[newlisp]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/articles/in-defense-newlisp/</guid>
		<description><![CDATA[newLISP receives an unexpected level of hostility from lispers. Languages like Arc and newLISP share an enmity that stems from the assumption that these languages are in some way attempting to replace Common Lisp. This is not the case. It should be pointed out that newLISP is an interpreted language with primary emphases on low [...]]]></description>
			<content:encoded><![CDATA[<p>newLISP receives an unexpected level of hostility from lispers.  Languages like Arc and newLISP share an enmity that stems from the assumption that these languages are in some way attempting to replace Common Lisp.  This is not the case.<span id="more-19"></span></p>
<p>It should be pointed out that newLISP is an interpreted language with primary emphases on low memory usage, short start-up time, and efficient implementation.  In that, newLISP is exceptionally successful; the <a href="http://www.newlisp.org/downloads/newlisp_manual.html#functions">amount of functionality</a> that has been packed into an executable of just over 250 Kb is impressive.  Automatic memory management is <a href="http://www.newlisp.org/MemoryManagement.html">fast and simple</a> and requires little overhead.  In terms of <a href="http://www.newlisp.org/benchmarks/">speed</a>, newLISP compares favorably to other interpreted languages (e.g. Perl and Python).</p>
<p>It also needs to be mentioned that newLISP is <em>not</em> Common Lisp.  The name newLISP seems to indicate that newLISP modernizes and replaces Common Lisp.  The <a href="http://www.newlisp.org/index.cgi?FAQ">FAQ</a> on newLISP.org does take a decidedly populist tone with regard to other lisps.  This is unfortunate, because newLISP is a very <a href="http://www.newlisp.org/index.cgi?page=Differences_to_Other_LISPs">different language</a> than CL or Scheme and is not truly in competition with them.</p>
<p>I&#8217;d like to discuss of a few of the more significant sticking points for potential users.</p>
<h4>Macros</h4>
<p>newLISP is a purely interpreted language.  This has some important implications in its implementation.  Macros are disimilar to compiled lisps.  Most importantly, there is no compile-time expansion.  All expansion is performed at runtime and with the overhead of a function all.  In fact, newLISP macros are more like functions with lazy evaluation.</p>
<p>However, this does not completely diminish the power of newLISP macros.  newLISP&#8217;s operator, <code>letex</code>, may be used to both expand and evaluate a block of code.  Using the <code>args</code> function and <a href="file://localhost/usr/share/doc/newlisp/newlisp_manual.html#indexing">implicit indexing</a>, variable capture may be avoided in macros.  Here is an extremely basic macro to iterate over the lines of a file using both <code>letex</code> and <code>args</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>define-macro <span style="color: #66cc66;">&#40;</span>dolines<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>letex <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>var <span style="color: #66cc66;">&#40;</span>args <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#40;</span>file <span style="color: #66cc66;">&#40;</span>open <span style="color: #66cc66;">&#40;</span>args <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #ff0000;">&quot;read&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
                    <span style="color: #66cc66;">&#40;</span>body <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">cons</span> 'begin <span style="color: #66cc66;">&#40;</span>rest <span style="color: #66cc66;">&#40;</span>args<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#40;</span>while <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">set</span> 'var <span style="color: #66cc66;">&#40;</span>read-line file<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
            body<span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#40;</span>close file<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>dolines <span style="color: #66cc66;">&#40;</span>line <span style="color: #ff0000;">&quot;/path/to/file&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>println line<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<h4>Variable capture</h4>
<p>This is a real issue when writing newLISP.  The function <code>args</code> can prevent capture by functions&#8217; parameters, but there is no equivalent to Common Lisp&#8217;s <code>gensym</code> to dynamically create unique symbols.  Fortunately, it is not difficult to write our own:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>define _gensym<span style="color: #66cc66;">:</span>_gensym<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>define <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">gensym</span><span style="color: #66cc66;">:</span><span style="color: #b1b100;">gensym</span> <span style="color: #66cc66;">&#40;</span>ctx MAIN<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_gensym <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">name</span> ctx<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>new-sym <span style="color: #66cc66;">&#40;</span>string <span style="color: #ff0000;">&quot;gensym-&quot;</span> <span style="color: #66cc66;">&#40;</span>_gensym <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">name</span> ctx<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>+ <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#40;</span>_gensym <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">name</span> ctx<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
                 <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">or</span> <span style="color: #66cc66;">&#40;</span>sym new-sym ctx<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">gensym</span> ctx<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#40;</span>begin
                <span style="color: #66cc66;">&#40;</span>_gensym <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">name</span> ctx<span style="color: #66cc66;">&#41;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
                <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">gensym</span> ctx<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>This demonstrates two other features of newLISP, contexts and dictionaries, which I will go into in more detail shortly.  For now, it will suffice to explain that contexts are lexical namespaces (context symbols are typically denoted in the form <code>context:symbol</code>, similarly to CL packages) and dictionaries are a way to use contexts as an associative namespace.</p>
<p>Note that this implementation of gensym is dependent on the maximum integer value on the system.  newLISP will wrap into negatives after the max integer, so the maximum number of symbols possible to create is generally twice the value of the max integer.  However, symbols that have been deleted will be recycled.</p>
<h4>Hash tables</h4>
<p>newLISP does not use hash tables (see <a href="http://enfranchisedmind.com/blog/2008/02/25/problems-with-hash-tables/">here</a> for an explanation of why).  This is a show-stopper for many.  Without joining the (often heated) debate over this, newLISP does provide the same functionality as a hash through its dictionaries:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>define dict<span style="color: #66cc66;">:</span><span style="color: #555;">dict</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; create the dictionary</span>
<span style="color: #66cc66;">&#40;</span>dict <span style="color: #ff0000;">&quot;foo&quot;</span> <span style="color: #ff0000;">&quot;bar&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; associates &quot;foo&quot; to &quot;bar&quot; in dict</span>
<span style="color: #66cc66;">&#40;</span>dict <span style="color: #ff0000;">&quot;foo&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; retrieves &quot;foo&quot; from dict</span></pre></div></div>

<p>Or, programmatically:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>context dict <span style="color: #ff0000;">&quot;foo&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; =&gt; &quot;bar&quot;</span>
<span style="color: #66cc66;">&#40;</span>context dict <span style="color: #ff0000;">&quot;foo&quot;</span> <span style="color: #ff0000;">&quot;baz&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #808080; font-style: italic;">; sets foo:bar &quot;baz&quot;</span></pre></div></div>

<h4>Dynamic scope</h4>
<p>newLISP is dynamically scoped.  Because it is an interpreted language, much computation and memory is saved by avoiding the complexities of lexical scoping.</p>
<p>newLISP&#8217;s contexts do implement static scopes that can be used to create lexically enclosed modules and closures.  Within the context, though, variable lookups are dynamic to the context.  In the example above (gensym), <code>_gensym</code> is a context dictionary and <code>gensym</code> is a default functor (a function assigned to a symbol with the same name as its context is defined as a functor in newLISP).  Within <code>gensym:gensym</code>, scope is dynamic to the gensym namespace, which is lexically isolated from the default namespace, labeled MAIN.</p>
<h4>Garbage collection</h4>
<p>newLISP uses a form of memory management called <a href="http://www.newlisp.org/MemoryManagement.html">ORO</a> (one reference only).  From the newLISP documentation:</p>
<blockquote><p>Memory management in newLISP does not rely on a garbage collection algorithm. Memory is not marked or reference-counted. Instead, a decision whether to delete a newly created memory object is made right after the memory object is created.</p>
<p>Empirical studies of LISP have shown that most LISP cells are not shared and so can be reclaimed during the evaluation process. Aside from some optimizations for primitives like set, define, and eval, newLISP deletes memory objects containing intermediate evaluation results once it reaches a higher evaluation level. newLISP does this by pushing a reference to each created memory object onto a result stack. When newLISP reaches a higher evaluation level, it removes the last evaluation result&#8217;s reference from the result stack and deletes the evaluation result&#8217;s memory object. This should not be confused with one-bit reference counting. ORO memory management does not set bits to mark objects as sticky.</p>
<p>newLISP follows a one reference only (ORO) rule. Every memory object not referenced by a symbol or context reference is obsolete once newLISP reaches a higher evaluation level during expression evaluation. Objects in newLISP (excluding symbols and contexts) are passed by value to other functions. As a result, each newLISP object only requires one reference.</p></blockquote>
<p>The intuitive assumption is that this results in slow evaluation, but it does not.  Nor is newLISP&#8217;s evaluation speed burdened by a garbage collector.</p>
<blockquote><p>newLISP&#8217;s ORO rule forces newLISP to constantly allocate and then free LISP cells. newLISP optimizes this process by allocating large chunks of cell memory from the host operating system. newLISP will request LISP cells from a free cell list and then recycle those cells back into that list. As a result, only a few CPU instructions (pointer assignments) are needed to unlink a free cell or to re-insert a deleted cell.</p>
<p>The overall effect of ORO memory management is a faster evaluation time and a smaller memory and disk footprint than traditional interpreted LISP&#8217;s can offer. The lack of garbage collection in newLISP more than compensates for its high frequency of cell creation/deletion. Note that under error conditions, newLISP will employ a mark and sweep algorithm to free un-referenced cells.</p></blockquote>
<h4>Implicit indexing</h4>
<p>Implicit indexing is syntactic sugar for indexed access to elements in a list:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>lst '<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #cc66cc;">2</span> <span style="color: #cc66cc;">3</span> <span style="color: #cc66cc;">4</span> <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>lst <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">=&gt;</span> <span style="color: #cc66cc;">4</span></pre></div></div>

<p>It also works for nested lists:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>lst '<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #cc66cc;">2</span> <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span> <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>lst <span style="color: #cc66cc;">3</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">=&gt;</span> <span style="color: #cc66cc;">5</span></pre></div></div>

<p>Prospective users often remark that this syntax breaks conventional semantics and makes it far more difficult to do meta-programming.  The function <code>nth</code> exists in the language and may still be used for this purpose:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>lst '<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #cc66cc;">2</span> <span style="color: #cc66cc;">3</span> <span style="color: #cc66cc;">4</span> <span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">nth</span> <span style="color: #cc66cc;">3</span> lst<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">=&gt;</span> <span style="color: #cc66cc;">4</span></pre></div></div>

<h4>Concurrency and distributed computing</h4>
<p>newLISP is not threaded.  This in particular was a challenge for me.  However, I have found that due to newLISP&#8217;s small size and quick start-up, forking new processes is quite painless.  There are few programs where one would want to start hundreds or thousands of threads, and newLISP is able to launch a large number of processes in less space than a single instance of the Python interpreter.</p>
<p>Using the new <a href="http://supertech.csail.mit.edu/cilk/">Cilk</a>-inspired <a href="http://www.newlisp.org/downloads/newlisp_manual.html#multi_processing">API</a>, concurrent programming is simple, cheap, and expressive.  Additionally, there are few of the challenges associated with threaded programming.</p>
<p>newLISP also comes with <a href="http://www.newlisp.org/downloads/newlisp_manual.html#net-eval">built-in functions</a> for distributed computing, permitting forms to be easily sent to other nodes over TCP/IP for evaluation:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>net-<span style="color: #b1b100;">eval</span> remote-server-ip expr-to-evaluate timeout response-handler<span style="color: #66cc66;">&#41;</span></pre></div></div>

<h4>Conclusion</h4>
<p>newLISP packs a lot of power into its small size.  Some of its more powerful built-in features include:</p>
<ul>
<li> a fast, simple concurrency API</li>
<li> regular expressions (PCRE)</li>
<li> native C library access</li>
<li> XML parsing</li>
<li> pattern matching</li>
<li> HTTP networking</li>
<li> sockets</li>
<li> cross platform GUI server (using Java)</li>
<li> bayesian training and probability analysis</li>
<li> cross platform support &#8211; newLISP uses only standard libraries</li>
</ul>
<p>newLISP does not deserve the pariah status to which many relegate it. While newLISP cannot replace a compiled language for the most intensive tasks, it remains a fun, <em>artful</em> language and is excellent for exploratory programming and rapid prototyping, while remaining fast and powerful enough for the final product.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fin-defense-newlisp%2F&amp;title=In+defense+of+newLISP" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fin-defense-newlisp%2F&amp;title=In+defense+of+newLISP" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=In+defense+of+newLISP&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fin-defense-newlisp%2F&amp;title=In+defense+of+newLISP" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fin-defense-newlisp%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fin-defense-newlisp%2F&amp;title=In+defense+of+newLISP" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fin-defense-newlisp%2F&amp;title=In+defense+of+newLISP" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fin-defense-newlisp%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+In+defense+of+newLISP+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fin-defense-newlisp%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/in-defense-newlisp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Java from a functional perspective</title>
		<link>http://www.artfulcode.net/articles/java-functional-perspective/</link>
		<comments>http://www.artfulcode.net/articles/java-functional-perspective/#comments</comments>
		<pubDate>Mon, 15 Oct 2007 16:11:00 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Soap box]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/articles/java-functional-perspective/</guid>
		<description><![CDATA[Not long ago a project required me to learn a little Java. As a long-time elitist functional programmer, I was not extremely excited. Due to the low quality of Java software I have used, I assumed, like many, that Java produced slow, bloated, and buggy software. Some languages just feel clunky. My previous experience with [...]]]></description>
			<content:encoded><![CDATA[<p>Not long ago a project required me to learn a little Java.  As a long-time elitist functional programmer, I was not extremely excited.  Due to the low quality of Java software I have used, I assumed, like many, that Java produced slow, bloated, and buggy software.  Some languages just feel clunky.<span id="more-45"></span></p>
<p>My previous experience with Java was as a less experienced programmer and I had some difficulty with the type system.  I learned on dynamically typed languages.  My first experience with static typing was in modern functional languages, where type was inferred automatically by the compiler.  Explicit type declarations felt archaic and overly wordy.</p>
<p>My experience this time around, however, was more positive.  This is primarily due to three factors.</p>
<h4>NetBeans</h4>
<p>NetBeans is Sun&#8217;s Java IDE.  Because it is mostly limited to Java, its syntax formating is excellent.  It takes a lot of code to abstract the ability of an IDE to format multiple languages (in particular, the ability to format both C-style languages and Lisp-style languages using the same application primitives presents difficulty).  NetBeans has the Apple advantage in this; one language to support means that it can have excellent support for that language.  Of course, this means that projects that use multiple languages are more difficult to develop using NetBeans, so perhaps this tradeoff is not worth it.</p>
<p>Java&#8217;s self-documentation is very nice, too.  NetBean&#8217;s code-hinting is superior to most, although it can get in the way.</p>
<p>The GUI builder is also extremely nice.  Swig and AWT can be a real trial in a language as wordy as Java (although I think Sun prefers us to call it &#8220;explicit.&#8221;)</p>
<h4>Classes</h4>
<p>I initially had some difficulty writing entire programs in objects.  Most languages I use that are object oriented are multi-paradigm.  Classes are available, but then utilized within functional or procedural code.  Because of this, I tend to regard classes as a sort of extra-powerful type struct, only to be used when a type becomes complex enough that the extra work of encapsulated it within a class becomes advantageous.</p>
<p>It&#8217;s (unfortunately) common to see new Lisp programmers try to simulate OO in Lisp using closures and hashes (especially if they&#8217;ve read a few Paul Graham essays).  I don&#8217;t particularly see that OO improves Lisp; closures and templates provide roughly the same functionality.  Exactly replicating closures in OOP or objects in functional programming would be moot.  They are different styles; Java-style programming is as uncomfortable in Lisp as Lisp-style programming is in Java.</p>
<p>While writing my initial applications, though, I realized something: classes are a formalized closure syntax.  They are a function that builds functions and closes over their variables.</p>
<p>This freed me to use a style of abstraction in Java that felt much more comfortable to me without the drawback of attempting to use the wrong paradigm for the language.  I could now program using classes and objects in a manner consistent with how I mentally model my applications.</p>
<p>Something I missed quite a bit was pattern matching.  It is very helpful to declare local variables based on the pattern of the argument(s) passed to a function, but that would not be useful in Java, since the primary type mechanism in Java is the class rather than the list.  Method overloading provides much of the same functionality, but idiomatic of Java.</p>
<h4>Write once, run everywhere</h4>
<p>Lisp pioneered the virtual machine.  Lisp is compiled into code that is run within the Lisp interpreter.  But Lisp is not commonly installed on computers, so distribution of Lisp software becomes a real challenge.  One of the advantages of having a huge amount of money behind a language is that Java is installed on virtually every computer a program may end up on.</p>
<p>It&#8217;s common in Lisp to have to code various parts of the program differently depending on the operating system and Lisp distribution.  For example, very few Lisps support multi-threading on OSX.  It makes it agonizing to write threaded software for a multi-platform application.</p>
<p>Java does not have this problem.  A feature is available on all platforms or none at all.  While this means that the language sometimes suffers from the lack of a particular feature, it also means that there is a guarantee against discovering too late that a feature used in the core of your program will not limit its utility on other operating systems.</p>
<h4>Conclusion</h4>
<p>Java is better than I had given it credit for.  With NetBeans taking care of checking your work for you, I am beginning to suspect that the many buggy Java programs are due to poor programming rather than a problem inherent in Java itself.</p>
<p>I still have some doubts as to how useful it would be for a very large project; my experience has been that object orientation and inheritance results in unnecessary complexity.</p>
<p>For small projects and GUI applications, though, Java seems to be a fair choice.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Java+from+a+functional+perspective&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F&amp;title=Java+from+a+functional+perspective" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Java+from+a+functional+perspective+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fjava-functional-perspective%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/java-functional-perspective/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evolving lisp</title>
		<link>http://www.artfulcode.net/articles/evolving-lisp/</link>
		<comments>http://www.artfulcode.net/articles/evolving-lisp/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 01:58:00 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Soap box]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[newlisp]]></category>

		<guid isPermaLink="false">http://www.artfulcode.net/articles/evolving-lisp/</guid>
		<description><![CDATA[Paul Graham notes that, &#8220;A popular recipe for new programming languages in the past 20 years has been to take the C model of computing and add to it, piecemeal, parts taken from the Lisp model, like runtime typing and garbage collection.&#8221; This is what has made Python such a wonderful, elegant, and concise language. [...]]]></description>
			<content:encoded><![CDATA[<p>Paul Graham <a href="http://www.paulgraham.com/rootsoflisp.html">notes</a> that, &#8220;A popular recipe for new programming languages in the past 20 years has been to take the C model of computing and add to it, piecemeal, parts taken from the Lisp model, like runtime typing and garbage collection.&#8221;  This is what has made Python such a wonderful, elegant, and concise language.  Why say with iteration what can be done in one easily readable line with a list comprehension?<span id="more-58"></span></p>
<p>This has also kept many imperative languages moving forward.  Python may be the most lispy, but there is also Ruby, which conceptually borrows heavily from languages like lisp and Smalltalk.  Even Javascript has lambda functions (although in JS they are called function literals), which has made possible powerful libraries such as <a href="http://www.prototypejs.org">Prototype</a>.</p>
<p>Few lisps have ever borrowed from imperative languages, though, as if the borrowers have absolutely nothing to offer themselves.  A few concepts have made it in.  OOP, via CLOS, although OOP is often just extra weight in lisp.  Storing functions as data makes much of OOP needless in lisp.</p>
<p><a href="http://www.newlisp.org">newLisp</a>, a dialect of lisp that uses s-expressions in a high level, interpreted language, has borrowed from imperative languages, and has done an excellent job of maintaining its lispy character despite it.  Regex is built into the interpreter and is used in many functions:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>regexp <span style="color: #66cc66;">&#123;</span>brown fox$<span style="color: #66cc66;">&#125;</span> <span style="color: #ff0000;">&quot;the quick brown fox&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>replace <span style="color: #66cc66;">&#123;</span>brown fox$<span style="color: #66cc66;">&#125;</span> <span style="color: #ff0000;">&quot;the quick brown fox&quot;</span> <span style="color: #66cc66;">&#40;</span>upper-<span style="color: #b1b100;">case</span> $<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Iterative control structures are built into the interpreter, rather than be implemented through macros.  Common Lisp&#8217;s LOOP is very powerful but not very idiomatic of lisp and not very elegant to use (in fact, many of those involved in the original development of the language did not like LOOP, feeling that it was not lispy enough).  In newLisp, iterators definitely have a lispy feel to them:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">dotimes</span> <span style="color: #66cc66;">&#40;</span>i <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>println i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">dolist</span> <span style="color: #66cc66;">&#40;</span>n '<span style="color: #66cc66;">&#40;</span>foo bar baz bat<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>println n<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Other similar looping functions in newLisp are dolist, doargs, and dotree.  There are also while, until, unless, and do functions, which all work about as you would imagine in a lisp.</p>
<p>No language will survive in a pure form.  Concepts may &#8211; s-expressions and lists &#8211; but lisp must be willing to evolve on a larger scale.  Lisp was built to evolve, so it&#8217;s a shame that so few of the people who continue to plough ahead in the language want it to.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Submit article</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fevolving-lisp%2F&amp;title=Evolving+lisp" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fevolving-lisp%2F&amp;title=Evolving+lisp" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Evolving+lisp&amp;url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fevolving-lisp%2F&amp;title=Evolving+lisp" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fevolving-lisp%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fevolving-lisp%2F&amp;title=Evolving+lisp" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fevolving-lisp%2F&amp;title=Evolving+lisp" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fevolving-lisp%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Evolving+lisp+@+http%3A%2F%2Fwww.artfulcode.net%2Farticles%2Fevolving-lisp%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.artfulcode.net/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.artfulcode.net/articles/evolving-lisp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

