<?xml version="1.0" encoding="windows-1252"?>
<node id="169316" title="Re: Perl6 and Extreme Programming" created="2002-05-25 18:26:38" updated="2005-07-19 14:08:11">
<type id="11">
note</type>
<author id="107600">
TheDamian</author>
<data>
<field name="doctext">
Here are some of the tenets of XP (stolen from 
&lt;a href="http://www.extremeprogramming.org/rules.html"&gt;extremeprogramming.org&lt;/a&gt;)
that we intend Perl 6 to support.
And some practical examples of Perl 6 features that will support each
of them. This list is by no means exhaustive (either of tenets or
or supportive features) -- it's more to demonstrate that we aren't
(just) marketing geniuses &lt;tt&gt;;-)&lt;/tt&gt;

&lt;dl&gt;

&lt;dt&gt; &lt;b&gt;&lt;i&gt;The project is divided into iterations/No functionality is added early.&lt;/i&gt;&lt;/b&gt;
&lt;dd&gt; To do that, you need to be able to build applications incrementally.
     That implies leaving stubs representing components that are essential but not yet built.
     That's particularly easy in Perl 6:
     &lt;code&gt;
     sub print_report {...}
     &lt;/code&gt;&lt;p&gt;

&lt;dt&gt; &lt;b&gt;&lt;i&gt;Move people around/Use collective code ownership.&lt;/i&gt;&lt;/b&gt;
&lt;dd&gt; To do those things, you need to leave behind code that others can pick up 
     easily. Many of the changes we're making to Perl 6 support that. For a simple
     (but non-trivial) example, rationalizing variable sigils cleans up code
     dramatically, making it easier to grok quickly. For a more complex example,
     Larry showed the design team the first draft
     of A5 yesterday. It's sensational! He's heavily refactored the regex syntax,
     and the result is that simple regexes become vastly more readable, and complex
     regexes vastly easier to get right.&lt;p&gt;

&lt;dt&gt; &lt;b&gt;&lt;i&gt;Refactor whenever and wherever possible. &lt;/i&gt;&lt;/b&gt;
&lt;dd&gt; One of the unexpected benefits of the structural unification we've been 
     making is that refactoring does become significantly easier. For example,
     every loop block is now actually a subroutine/closure specification. And
     if you use the &lt;code&gt;-&gt; $var {...}&lt;/code&gt; iterator specification, the loop block is
     actually a subroutine with parameters. So hoisting that code into a 
     subroutine becomes utterly trivial.&lt;p&gt;

&lt;dt&gt; &lt;b&gt;&lt;i&gt;Code must be written to agreed standards.&lt;/i&gt;&lt;/b&gt;
&lt;dd&gt; Perl 6 will make it easier to create, impose, and verify compliance
     with coding standards. Two examples: 
     &lt;ul&gt;
     &lt;li&gt; Sandboxing will be much easier
     to use, so it will be possible to turn off language features whose use
     contravenes the agreed standard. For example, it will be simple to turn
     off the use of backticks, and have them "caught" at compile-time.
     
     &lt;li&gt; It will also be comparatively easy to intercept code in the middle of
     compilation (e.g. at the optree level) and write Perl modules that 
     verify particular code structures...as opposed to individual constructs.
     For example, you might decree that variable names must conform to the
     project's data dictionary, and have a "policy test" module check every VAR node in
     the optree as the program is compiled. Or you might 
	require that all pattern matches use an explicit &lt;code&gt;$var =~&lt;/code&gt; (rather than implicitly matching against the current topic). You'll be able to write a parse-tree analyser to verify that too.&lt;p&gt;
     &lt;/ul&gt;

&lt;dt&gt; &lt;b&gt;&lt;i&gt;Leave optimization till last.&lt;/i&gt;&lt;/b&gt;
&lt;dd&gt; ...or leave it to the machine. An important design goal for both Perl 6 and
     the underlying Parrot engine is to automate optimization as far as possible.
     The introduction of variable typing (in addition to Perl 5's value typing)
     helps there, as does the unification of blocks and closures. At the other
     end of the spectrum, Parrot's register-based architecture allows us to
     draw on the extensive literature on hardware and assembler optimization.
     BTW, where optimization at the higher, human level &lt;b&gt;is&lt;/b&gt; desirable, it's almost always 
     optimization of algorithm, not code. Many of the new, more advanced features
     that Perl 6 will add (e.g. higher order functions, lazy data structures,
     generators, coroutines, superpositions, smart matching, etc.) are specifically
     designed to support those more sophisticated algorithms.&lt;p&gt;

&lt;dt&gt; &lt;b&gt;&lt;i&gt;No overtime.&lt;/i&gt;&lt;/b&gt; 
&lt;dd&gt; Hardly new. Perl is already a "no overtime" language, since it allows you
     to get more done, more quickly, without the mechanics of the language 
     getting in the way. We have no intention of changing that aspect of the
     language. In fact, every change we consider for Perl 6 is explicitly weighed against 
     our stated goal that "Easy things should stay easy, hard things should
     become easier, and impossible things should become merely hard."&lt;p&gt;

&lt;/dl&gt; </field>
<field name="root_node">
169289</field>
<field name="parent_node">
169289</field>
</data>
</node>
