<?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>Stupid Idea &#187; Technical</title>
	<atom:link href="http://www.stupididea.com/category/technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stupididea.com</link>
	<description></description>
	<lastBuildDate>Tue, 30 Aug 2011 00:10:07 +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>Rails and Ext non-Ajax Signup Form with Password Confirmation</title>
		<link>http://www.stupididea.com/2008/07/02/rails-and-ext-non-ajax-signup-form/</link>
		<comments>http://www.stupididea.com/2008/07/02/rails-and-ext-non-ajax-signup-form/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 01:08:43 +0000</pubDate>
		<dc:creator>method</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.stupididea.com/?p=98</guid>
		<description><![CDATA[This is, uh, a technical post. Probably there are others who want to do the same somewhat senseless thing: use Ext to do form validation while keeping a boring non-Ajax post-and-response. The bottom line is that Ext favors doing it &#8230; <a href="http://www.stupididea.com/2008/07/02/rails-and-ext-non-ajax-signup-form/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is, uh, a technical post.</p>
<p>Probably there are others who want to do the same somewhat senseless thing: use Ext to do form validation while keeping a boring non-Ajax post-and-response. The bottom line is that Ext favors doing it the Ajax way, and the Ajax way isn&#8217;t that hard to set up with Rails (just handle the form submission as normal but return JSON or XML to signal success or failure). But if you&#8217;re like me and working on a deadline, there can be a cognitive burden to switching to Ajax posting that you might want to avoid. Paradoxically, you might find yourself wasting a lot of time trying to figure out how to do it the &#8220;old-fashioned&#8221; way. Well, here&#8217;s one working standard-submission Signup Form, with fancy validations and all the kinks worked out.</p>
<p>Here&#8217;s the top half of the file <code>users/new.html.erb</code>, which is nearly the same as the code generated by restful-authentication:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">password</span> = <span style="color:#0066ff; font-weight:bold;">@user</span>.<span style="color:#9900CC;">password_confirmation</span> = <span style="color:#0000FF; font-weight:bold;">nil</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
<span style="color:#006600; font-weight:bold;">&lt;%</span>= <span style="color:#5A0A0A; font-weight:bold;">error_messages_for</span> <span style="color:#ff3333; font-weight:bold;">:user</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
&lt;div id=&quot;no-js-form&quot;&gt;
    <span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#5A0A0A; font-weight:bold;">form_for</span> <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#ff3333; font-weight:bold;">:url</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> users_path, <span style="color:#ff3333; font-weight:bold;">:html</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>:id <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;signup-form&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>f<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#006600; font-weight:bold;">-%&gt;</span>
    &lt;p&gt;
        &lt;label for=&quot;login&quot;&gt;
            Real Name
        &lt;/label&gt;
        &lt;br/&gt;
        <span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">text_field</span> <span style="color:#ff3333; font-weight:bold;">:name</span>, <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;signup_name_field&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
    &lt;/p&gt;
    &lt;p&gt;
        &lt;label for=&quot;login&quot;&gt;
            User Name
        &lt;/label&gt;
        &lt;br/&gt;
        <span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">text_field</span> <span style="color:#ff3333; font-weight:bold;">:login</span>, <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;signup_login_field&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
    &lt;/p&gt;
    &lt;p&gt;
        &lt;label for=&quot;email&quot;&gt;
            Email
        &lt;/label&gt;
        &lt;br/&gt;
        <span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#9900CC;">text_field</span> <span style="color:#ff3333; font-weight:bold;">:email</span>, <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;signup_email_field&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
    &lt;/p&gt;
    &lt;p&gt;
        &lt;label for=&quot;password&quot;&gt;
            Password
        &lt;/label&gt;
        &lt;br/&gt;
        <span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#5A0A0A; font-weight:bold;">password_field</span> <span style="color:#ff3333; font-weight:bold;">:password</span>, <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;signup_password_field&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
    &lt;/p&gt;
    &lt;p&gt;
        &lt;label for=&quot;password_confirmation&quot;&gt;
            Confirm Password
        &lt;/label&gt;
        &lt;br/&gt;
        <span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#5A0A0A; font-weight:bold;">password_field</span> <span style="color:#ff3333; font-weight:bold;">:password_confirmation</span>, <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;signup_password_confirmation_field&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
    &lt;/p&gt;
    &lt;p&gt;
        &lt;label for=&quot;password_confirmation&quot;&gt;
            Role
        &lt;/label&gt;
        &lt;br/&gt;
        <span style="color:#006600; font-weight:bold;">&lt;%</span>= f.<span style="color:#CC0066; font-weight:bold;">select</span> <span style="color:#ff3333; font-weight:bold;">:role</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;consumer&quot;</span>,<span style="color:#996600;">&quot;consumer&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;vendor&quot;</span>,<span style="color:#996600;">&quot;vendor&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>, <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;signup_role_field&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
    &lt;/p&gt;
    &lt;p&gt;
        <span style="color:#006600; font-weight:bold;">&lt;%</span>= submit_tag <span style="color:#996600;">'Sign up'</span>, <span style="color:#ff3333; font-weight:bold;">:id</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;signup_submit_button&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
    &lt;/p&gt;
    <span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">-%&gt;</span>
&lt;/div&gt;
&lt;div id=&quot;js-form-panel&quot;&gt;
&lt;/div&gt;</pre></div></div>

<p>The only differences are a div wrapping the form (&#8220;no-js-form&#8221;) and the &#8220;js-form-panel&#8221; at the end. You&#8217;re going to laugh at me, but this form is buzzword-friendly; it&#8217;s <strong>unobtrusive</strong> in an ugly way. If javascript is turned on, the form will work, and the following will fail:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #006600; font-style: italic;">/* 
     Thanks to:
     http://www.extjswithrails.com/2008_03_01_archive.html for standardSubmit tip (hard to find!)
     http://extjs.com/forum/showthread.php?t=23068 for password confirmation
     Anyone else I stole semantics from
     */</span>
    <span style="color: #006600; font-style: italic;">// Look, I'm copying over the authenticity token to send in the JS-generated form. LOL!</span>
    <span style="color: #003366; font-weight: bold;">var</span> authenticity_token <span style="color: #339933;">=</span> document<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'forms'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'authenticity_token'</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">value</span><span style="color: #339933;">;</span>
&nbsp;
    Ext.<span style="color: #660066;">onReady</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'no-js-form'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> myForm<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">function</span> submitHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            form <span style="color: #339933;">=</span> myForm.<span style="color: #660066;">getForm</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            form_as_dom <span style="color: #339933;">=</span> form.<span style="color: #660066;">getEl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">dom</span><span style="color: #339933;">;</span>
            form_as_dom.<span style="color: #660066;">action</span> <span style="color: #339933;">=</span> form.<span style="color: #660066;">url</span><span style="color: #339933;">;</span>
            form_as_dom.<span style="color: #660066;">submit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        myForm <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">FormPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
            monitorValid<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
            standardSubmit<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
            url<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;/users&quot;</span><span style="color: #339933;">,</span>
            applyTo<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;js-form-panel&quot;</span><span style="color: #339933;">,</span>
            title<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Signup as a New User&quot;</span><span style="color: #339933;">,</span>
            width<span style="color: #339933;">:</span> <span style="color: #CC0000;">310</span><span style="color: #339933;">,</span>
            autoHeight<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
            items<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">TextField</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                allowBlank<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
                msgTarget<span style="color: #339933;">:</span> <span style="color: #3366CC;">'side'</span><span style="color: #339933;">,</span>
                <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;user[name]&quot;</span><span style="color: #339933;">,</span>
                id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'js_signup_name_field'</span><span style="color: #339933;">,</span>
                fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Real Name&quot;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">TextField</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                allowBlank<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
                vtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'alphanum'</span><span style="color: #339933;">,</span>
                msgTarget<span style="color: #339933;">:</span> <span style="color: #3366CC;">'side'</span><span style="color: #339933;">,</span>
                <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;user[login]&quot;</span><span style="color: #339933;">,</span>
                id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'js_signup_login_field'</span><span style="color: #339933;">,</span>
                fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Username&quot;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">TextField</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                allowBlank<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
                vtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'email'</span><span style="color: #339933;">,</span>
                msgTarget<span style="color: #339933;">:</span> <span style="color: #3366CC;">'side'</span><span style="color: #339933;">,</span>
                <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;user[email]&quot;</span><span style="color: #339933;">,</span>
                id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'js_signup_email_field'</span><span style="color: #339933;">,</span>
                fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Email&quot;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">TextField</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                allowBlank<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
                inputType<span style="color: #339933;">:</span> <span style="color: #3366CC;">'password'</span><span style="color: #339933;">,</span>
                vType<span style="color: #339933;">:</span> <span style="color: #3366CC;">'password'</span><span style="color: #339933;">,</span>
                msgTarget<span style="color: #339933;">:</span> <span style="color: #3366CC;">'side'</span><span style="color: #339933;">,</span>
                <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;user[password]&quot;</span><span style="color: #339933;">,</span>
                id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'js_signup_password_field'</span><span style="color: #339933;">,</span>
                fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Password&quot;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">TextField</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Password Confirm:&quot;</span><span style="color: #339933;">,</span>
                allowBlank<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
                inputType<span style="color: #339933;">:</span> <span style="color: #3366CC;">'password'</span><span style="color: #339933;">,</span>
                <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;user[password_confirmation]&quot;</span><span style="color: #339933;">,</span>
                initialPasswordField<span style="color: #339933;">:</span> <span style="color: #3366CC;">'signup_password_field'</span><span style="color: #339933;">,</span>
                vType<span style="color: #339933;">:</span> <span style="color: #3366CC;">'password'</span><span style="color: #339933;">,</span>
                msgTarget<span style="color: #339933;">:</span> <span style="color: #3366CC;">'side'</span><span style="color: #339933;">,</span>
                id<span style="color: #339933;">:</span> <span style="color: #3366CC;">'js_signup_password_confirmation_field'</span><span style="color: #339933;">,</span>
                fieldLabel<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Confirm Password&quot;</span><span style="color: #339933;">,</span>
                validator<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>value <span style="color: #339933;">==</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;js_signup_password_field&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span> 
<span style="color: #339933;">||</span> <span style="color: #3366CC;">&quot;Your passwords do not match&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">Hidden</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;authenticity_token&quot;</span><span style="color: #339933;">,</span>
                value<span style="color: #339933;">:</span> authenticity_token
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> Ext.<span style="color: #660066;">form</span>.<span style="color: #660066;">Hidden</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000066;">name</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;user[role]&quot;</span><span style="color: #339933;">,</span>
                value<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;consumer&quot;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
            buttons<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#123;</span>
                handler<span style="color: #339933;">:</span> submitHandler<span style="color: #339933;">,</span>
                text<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Signup&quot;</span><span style="color: #339933;">,</span>
                formBind<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#93;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>The noteworthy steps are: first, I hide the &#8216;no-js-form&#8217;, then I copy the authenticity_token that gets generated by a rails form to put in the js-generated form.  Then, <code>standardSubmit : true</code> is the config option that makes a FormPanel <strong>not</strong> submit as an XmlHttpRequest.  The funny code in the submitHandler is getting the underlying form object and calling submit on it, but as I write this it doesn&#8217;t make sense why both would be necessary. Finally, <code>formbind : true</code> causes the submit button to be deactivated while there are failing validations, and there&#8217;s some handy code for making sure that the password_confirmation matches password (totally lifted from somewhere else, see above).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stupididea.com/2008/07/02/rails-and-ext-non-ajax-signup-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple Cocoa Cavil</title>
		<link>http://www.stupididea.com/2008/05/26/apple-cocoa-cavil/</link>
		<comments>http://www.stupididea.com/2008/05/26/apple-cocoa-cavil/#comments</comments>
		<pubDate>Mon, 26 May 2008 17:08:11 +0000</pubDate>
		<dc:creator>method</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.stupididea.com/?p=90</guid>
		<description><![CDATA[I&#8217;m going to try to sound more like Andy Rooney1 up here on this blog. Also, how about I indicate when the boooring technical notes begin and end with technical and interesting. This is one of my favorite xkcd comics. &#8230; <a href="http://www.stupididea.com/2008/05/26/apple-cocoa-cavil/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to try to sound more like <a href="http://en.wikipedia.org/wiki/Andy_Rooney">Andy Rooney</a><sup><a href="http://www.stupididea.com/2008/05/26/apple-cocoa-cavil/#footnote_0_90" id="identifier_0_90" class="footnote-link footnote-identifier-link" title="I include this link because I think this already marginal reference will become incomprehensible in ten years.">1</a></sup> up here on this blog. Also, how about I indicate when the <em>boooring</em> technical notes begin and end with <strong>technical</strong> and <strong>interesting</strong>.</p>
<p><a href="http://xkcd.com/386/">This</a> is one of my favorite <a href="http://xkcd.com">xkcd</a> comics. It really speaks to my experience. Usually I can pull away before I&#8217;ve finished registering for comments. Sometimes I&#8217;m halfway through a closely reasoned argument when I realize how perfectly pointless and non-personal-goal-advancing my actions are. Then, in the worst case scenario, there I am mixing it up with the other comment-warriors. Here&#8217;s me windmilling my way through a <a href="http://www.japanprobe.com/?p=4193">post about dolphin killing</a> on Japanprobe. <a href="http://ventnorsblog.blogspot.com/2008/03/oh-miguel.html">This</a> used to be the url for a pitched brawl in which I interjected a few uninformed comments. Etcetera.</p>
<p>Anyway, I thought I&#8217;d write this post at a more meta level to dissuade myself from commenting elsewhere. So here goes (<strong>technical</strong>):</p>
<p><em>Have you ever noticed</em> that Objective-C is really, really weird? Like, they just took all the C- and C++- style conventions and changed them? Me too. And on top of that it&#8217;s compiled and you do memory management and the engineers make APIs that have objects called NSCamelCasedFactoryMethodObjectFacilitator<sup><a href="http://www.stupididea.com/2008/05/26/apple-cocoa-cavil/#footnote_1_90" id="identifier_1_90" class="footnote-link footnote-identifier-link" title="Yeah, I&amp;#8217;ve got their number all right.">2</a></sup>. Okay, so then someone makes a script-y dynamic thing for managing the Objective-C stuff, good idea. And when designing this scripting interface they make the following language syntax design decisions:</p>
<blockquote><p>
Finally, the instruction separator is a dot, like in English sentences:<br />
myString := &#8216;hello&#8217;.</p>
<p>The following example shows how to send a message to an object:<br />
myString class
</p></blockquote>
<p>See, this is funny, because it&#8217;s completely different from every other programming language<sup><a href="http://www.stupididea.com/2008/05/26/apple-cocoa-cavil/#footnote_2_90" id="identifier_2_90" class="footnote-link footnote-identifier-link" title=" Actually, these are pretty interesting design decisions. The := assignment syntax is wack, but probably necessary for named arguments or something. The dot on the end is okay, but you&amp;#8217;re moving the OO-messaging operator into the generally useless semicolon position. By using the space for messaging, you&amp;#8217;re now saying &amp;#8220;subject verbs(args)&amp;#8221; instead of &amp;#8220;subject.verb object, args&amp;#8221; (in Ruby you can omit the parens for a function). ">3</a></sup>. That is all.</p>
<p>Umm, but there is a somewhat <strong>interesting</strong> take-away. Both Apple and Microsoft have designed really sucky APIs (in terms of intuitability rather than functionality) , compared to which GTK is fairly sane (it gets a bit clunky when dealing with &#8220;GtkIter&#8221; operations). But the MacOS developers follow Apple&#8217;s improvements of this API, cooing over the increased simplicity afforded by the new NSMakesYourToastRegistry. It&#8217;s the same with new C#/ Windows API developments. So (this is actually the <strong>interesting</strong> part) the lesson is that when people work within a &#8220;closed&#8221; development system, they <em>lose their sense about good and bad design</em>!<sup><a href="http://www.stupididea.com/2008/05/26/apple-cocoa-cavil/#footnote_3_90" id="identifier_3_90" class="footnote-link footnote-identifier-link" title="So I sort of believe that. Mainly I&amp;#8217;m bitter because I can&amp;#8217;t get some code to work on MacOS.">4</a></sup> </p>
<p>Here&#8217;s the idea. Closed development systems don&#8217;t get good feedback and don&#8217;t have good change mechanisms, so even very good engineers (probably Apple&#8217;s are some of the best) end up working in the dark a little. It gets all <strong>culty</strong>, because there&#8217;s an elect that makes the design decisions and a laity that passively learns the new scripture. And everyone&#8217;s straining so hard to understand what the design class hath laid down that they&#8217;re no longer perceiving the design objectively. And proprietary lock-in helps, because it leads to fatalism (&#8220;what can I do, switch to Windows?&#8221;). There are all these weird little island communities where the natives are effectively locked-in to a platform because they&#8217;ve already invested the energy to understand its weird design. This isn&#8217;t even necessarily a proprietary vs. opensource thing. There are strange over-designed opensource projects that aren&#8217;t particularly open because of this class division (and most opensource projects rely on only 1-3 main contributors, it seems). All I&#8217;m saying is that bad APIs / development languages happen when designers aren&#8217;t being influenced in the right way by the end-user developers, and I&#8217;m speculating that this has to do with particular attitudes and processes associated with proprietary code and also a kind of design elitism. I mean, doesn&#8217;t Objective-C code (as code) suck?</p>
<p>---</p><ol class="footnotes"><li id="footnote_0_90" class="footnote">I include this link because I think this already marginal reference will become incomprehensible in ten years.</li><li id="footnote_1_90" class="footnote">Yeah, I&#8217;ve got their number all right.</li><li id="footnote_2_90" class="footnote"> Actually, these are pretty interesting design decisions. The := assignment syntax is wack, but probably necessary for named arguments or something. The dot on the end is okay, but you&#8217;re moving the OO-messaging operator into the generally useless semicolon position. By using the space for messaging, you&#8217;re now saying &#8220;subject verbs(args)&#8221; instead of &#8220;subject.verb object, args&#8221; (in Ruby you can omit the parens for a function). </li><li id="footnote_3_90" class="footnote">So I sort of believe that. Mainly I&#8217;m bitter because I can&#8217;t get some code to work on MacOS.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.stupididea.com/2008/05/26/apple-cocoa-cavil/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Example</title>
		<link>http://www.stupididea.com/2008/05/25/example/</link>
		<comments>http://www.stupididea.com/2008/05/25/example/#comments</comments>
		<pubDate>Sun, 25 May 2008 23:19:14 +0000</pubDate>
		<dc:creator>method</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.stupididea.com/?p=89</guid>
		<description><![CDATA[An instance of obsessive behavior: trying out various WordPress themes, tweaking the CSS to look right, making sure the code highlighting is the same color as my gvim theme. Perhaps for hours. This by way of giving myself permission to &#8230; <a href="http://www.stupididea.com/2008/05/25/example/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>An instance of obsessive behavior: trying out various WordPress themes, tweaking the CSS to look right, making sure the code highlighting is the same color as my <strong>gvim</strong> theme. Perhaps for hours. This by way of giving myself permission to <em>stop</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stupididea.com/2008/05/25/example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup for Alexandria Development: Part II</title>
		<link>http://www.stupididea.com/2007/12/19/87/</link>
		<comments>http://www.stupididea.com/2007/12/19/87/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 20:06:35 +0000</pubDate>
		<dc:creator>method</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.stupididea.com/?p=87</guid>
		<description><![CDATA[(…after too much grief today installing Mephisto and mucking with Apache virtualhosts; I’ll get Part I back from the ether eventually) Update: Done. Update: This is a post moved over from the short-lived Mephisto blog, and ported back in time. &#8230; <a href="http://www.stupididea.com/2007/12/19/87/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><small>(…after too much grief today installing Mephisto and mucking with Apache virtualhosts; I’ll get Part I back from the ether eventually) <strong>Update</strong>: Done. <strong>Update</strong>: This is a post moved over from the short-lived Mephisto blog, and ported back in time.</small></p>
<p>First of all, the alexandria binary is just a ruby script that does a require &#8216;alexandria&#8217; and runs Alexandria.main.</p>
<p>Alexandria.main is a method on the Alexandria ‘module’ that is used throughout the code (modules are ‘namespaces’ to avoid naming conflicts). This method is found in lib/alexandria.rb:</p>
<pre lang="ruby>
module Alexandria
# ... bunch of constants used in the 'about' dialogue
  def self.main
    $DEBUG = !ENV['DEBUG'].nil?
    $DEBUG = true if ARGV.include? "--debug"
    if $DEBUG
      Alexandria.log.level = Logger::DEBUG
    end
    Alexandria.log.debug { "Initializing Alexandria..." }

    ENV['http_proxy'] = nil if !ENV['http_proxy'].nil? \
    and URI.parse(ENV['http_proxy']).userinfo.nil?
    Alexandria::UI.main
  end
# ... bunch of requires below here
end
</pre>
<p>As you should be able to see, this method isn’t doing anything but setting up some global variables (like $DEBUG) and logging, and doing something weird with http_proxy. The real line is Alexandria::UI.main. That’s in lib/alexandria/ui.rb:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> Pango
  <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">ellipsizable</span>?
    <span style="color:#0066ff; font-weight:bold;">@ellipsizable</span> <span style="color:#006600; font-weight:bold;">||</span>= Pango.<span style="color:#9900CC;">constants</span>.<span style="color:#9966CC; font-weight:bold;">include</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'ELLIPSIZE_END'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> Alexandria
  <span style="color:#9966CC; font-weight:bold;">module</span> UI
    <span style="color:#9966CC; font-weight:bold;">def</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">main</span>
      <span style="color:#6666ff; font-weight:bold;">Gnome::Program</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'alexandria'</span>, VERSION<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">app_datadir</span> =
        <span style="color:#6666ff; font-weight:bold;">Config::MAIN_DATA_DIR</span>
      Icons.<span style="color:#9900CC;">init</span>
      MainApp.<span style="color:#9900CC;">new</span>
      Gtk.<span style="color:#9900CC;">main</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Gtk.main is the main loop of a gtk program. You set up your windows and widgets before running it, and it makes them all spin until you exit. So, after Icons.init runs (guess what that does), MainApp.new does all the work from now on.</p>
<p>The Pango code above this is interesting for seeing some Ruby syntax and features. Pango is a text-rendering and layout library inside gtk. The code is adding an elipsizable? “question” method (return true/false) to the Pango module. self.elipsizable? means that it’s defining a class method, a method on a class that doesn’t depend on instance data. ||= is a way of saying, “set the variable to this unless it’s already been set to something else (ie, it’s not nil)”.</p>
<p>Unfortunately, MainApp.new is in the massive MainApp class at lib/alexandria/ui/main_app.rb. This class does a lot (too much). The main thing it does is handle all the callbacks from the main window and its widgets. Let’s just take a look at the top:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> Alexandria
  <span style="color:#9966CC; font-weight:bold;">module</span> UI
    <span style="color:#9966CC; font-weight:bold;">class</span> MainApp <span style="color:#006600; font-weight:bold;">&lt;</span> GladeBase
      attr_accessor <span style="color:#ff3333; font-weight:bold;">:main_app</span>, <span style="color:#ff3333; font-weight:bold;">:actiongroup</span>, <span style="color:#ff3333; font-weight:bold;">:appbar</span>
      <span style="color:#9966CC; font-weight:bold;">include</span> Logging
      <span style="color:#9966CC; font-weight:bold;">include</span> GetText
      GetText.<span style="color:#9900CC;">bindtextdomain</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">Alexandria::TEXTDOMAIN</span>, <span style="color:#0000FF; font-weight:bold;">nil</span>, <span style="color:#0000FF; font-weight:bold;">nil</span>, <span style="color:#996600;">&quot;UTF-8&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">module</span> Columns
        COVER_LIST, COVER_ICON, TITLE, TITLE_REDUCED, AUTHORS,
        ISBN, PUBLISHER, PUBLISH_DATE, EDITION, RATING, IDENT,
        NOTES, REDD, OWN, WANT, TAGS = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span>..<span style="color:#006666;">16</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">to_a</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      <span style="color:#008000; font-style:italic;"># The maximum number of rating stars displayed.</span>
      MAX_RATING_STARS = <span style="color:#006666;">5</span>
&nbsp;
      <span style="color:#9966CC; font-weight:bold;">def</span> initialize
        <span style="color:#9966CC; font-weight:bold;">super</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;main_app.glade&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#0066ff; font-weight:bold;">@prefs</span> = Preferences.<span style="color:#9900CC;">instance</span>
        load_libraries
        initialize_ui
        on_books_selection_changed
        restore_preferences
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#008000; font-style:italic;">#... snip</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#008000; font-style:italic;"># ... snip</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>A couple points here. MainApp inherits from GladeBase. The attr_accessor is a declaration that makes the @main_app, @actiongroup and @appbar instance variables publicly readable and settable. super(&#8220;main_app.glade&#8221;) calls the initialize method on GladeBase with the glade file that contains the definitions for all the widgets Alexandria uses. The names of the methods tell you about what they do (good!). Because these methods need to know about what the user’s preferences are, @prefs has been made available before they are called.</p>
<p>To understand what MainApp is doing, it seems like we need to understand what GladeBase is.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> Alexandria
  <span style="color:#9966CC; font-weight:bold;">module</span> UI
    <span style="color:#9966CC; font-weight:bold;">class</span> GladeBase
      <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>filename<span style="color:#006600; font-weight:bold;">&#41;</span>
        file = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">Alexandria::Config::DATA_DIR</span>, <span style="color:#996600;">'glade'</span>, filename<span style="color:#006600; font-weight:bold;">&#41;</span>
        glade = GladeXML.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>file, <span style="color:#0000FF; font-weight:bold;">nil</span>, <span style="color:#6666ff; font-weight:bold;">Alexandria::TEXTDOMAIN</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>handler<span style="color:#006600; font-weight:bold;">|</span> method<span style="color:#006600; font-weight:bold;">&#40;</span>handler<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
        glade.<span style="color:#9900CC;">widget_names</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>name<span style="color:#006600; font-weight:bold;">|</span>
          <span style="color:#9966CC; font-weight:bold;">begin</span>
            instance_variable_set<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;@#{name}&quot;</span>.<span style="color:#9900CC;">intern</span>, glade<span style="color:#006600; font-weight:bold;">&#91;</span>name<span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
          <span style="color:#9966CC; font-weight:bold;">rescue</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>So GladeBase is using GladeXML to get the widgets out of the xml file and load them into memory. It then iterates through them, *adding them to MainApp (instance_variable_set is doing the work). So if there’s a widget called @main_menu, MainApp will get this variable to work with. These widgets work exactly as though they had been created “by hand”.</p>
<p>If you’ve been following, take a look at load_libraries and see if the code there makes sense. Here’s a short snippet:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">      <span style="color:#9966CC; font-weight:bold;">def</span> load_libraries
        completion_models = CompletionModels.<span style="color:#9900CC;">instance</span>
        <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#0066ff; font-weight:bold;">@libraries</span>
          <span style="color:#0066ff; font-weight:bold;">@libraries</span>.<span style="color:#9900CC;">all_regular_libraries</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>library<span style="color:#006600; font-weight:bold;">|</span>
            <span style="color:#9966CC; font-weight:bold;">if</span> library.<span style="color:#9900CC;">is_a</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>Library<span style="color:#006600; font-weight:bold;">&#41;</span>
              library.<span style="color:#9900CC;">delete_observer</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span><span style="color:#006600; font-weight:bold;">&#41;</span>
              completion_models.<span style="color:#9900CC;">remove_source</span><span style="color:#006600; font-weight:bold;">&#40;</span>library<span style="color:#006600; font-weight:bold;">&#41;</span>
            <span style="color:#9966CC; font-weight:bold;">end</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
          <span style="color:#0066ff; font-weight:bold;">@libraries</span>.<span style="color:#9900CC;">reload</span>
        <span style="color:#9966CC; font-weight:bold;">else</span>
          <span style="color:#008000; font-style:italic;">#On start</span>
&nbsp;
          <span style="color:#0066ff; font-weight:bold;">@libraries</span> = Libraries.<span style="color:#9900CC;">instance</span>
          <span style="color:#0066ff; font-weight:bold;">@libraries</span>.<span style="color:#9900CC;">reload</span>
<span style="color:#008000; font-style:italic;"># ...</span></pre></div></div>

<p>This is where things start to get confusing. load_libraries is also being used to reload libraries, so first it checks to see if @library has been defined already (refactoring opportunity). In the normal case, Libraries gets called by by invoking Libraries.instance. To understand this, you have to know that Libraries uses a factory class method to make sure that Libraries only gets created once (making the Libraries instance a “singleton”).</p>
<p>At the bottom of load_libraries is some interesting code:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># ...</span>
        <span style="color:#0066ff; font-weight:bold;">@libraries</span>.<span style="color:#9900CC;">all_regular_libraries</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>library<span style="color:#006600; font-weight:bold;">|</span>
          library.<span style="color:#9900CC;">add_observer</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span><span style="color:#006600; font-weight:bold;">&#41;</span>
          completion_models.<span style="color:#9900CC;">add_source</span><span style="color:#006600; font-weight:bold;">&#40;</span>library<span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#008000; font-style:italic;"># ...</span></pre></div></div>

<p>This is telling each library in @libraries (the Libraries singleton) to add self as an “observer”. What does this mean? It means that class Library is “observable”. To see what that means you have to look at Library. First let’s look at Libraries, in lib/alexandria/library.rb:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">class</span> Libraries
    attr_reader <span style="color:#ff3333; font-weight:bold;">:all_libraries</span>, <span style="color:#ff3333; font-weight:bold;">:ruined_books</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#CC00FF; font-weight:bold;">Observable</span>
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#CC00FF; font-weight:bold;">Singleton</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># ... snip</span>
&nbsp;
    <span style="color:#008000; font-style:italic;">#######</span>
    private
    <span style="color:#008000; font-style:italic;">#######</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> initialize
      <span style="color:#0066ff; font-weight:bold;">@all_libraries</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">def</span> notify<span style="color:#006600; font-weight:bold;">&#40;</span>action, library<span style="color:#006600; font-weight:bold;">&#41;</span>
      changed
      notify_observers<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span>, action, library<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Libraries is including the Observable and Singleton modules to give it special methods (in Python these are called “mixins”). Singleton gave it the instance method. Observable is giving it the notify_observers method. What this method does is “call up” all the observers of this instance by calling their update methods.</p>
<p>Libraries has many Librarys (it’s a little weird to give a class a plural name). Each library is an observer of Libraries. Library is also Observable:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">&nbsp;
  <span style="color:#9966CC; font-weight:bold;">class</span> Library <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#CC0066; font-weight:bold;">Array</span>
    <span style="color:#9966CC; font-weight:bold;">include</span> Logging
<span style="color:#008000; font-style:italic;"># ...</span>
    <span style="color:#9966CC; font-weight:bold;">include</span> <span style="color:#CC00FF; font-weight:bold;">Observable</span></pre></div></div>

<p>As we saw above, MainApp adds itself as an observer to each library. If you look on MainApp you’ll see that it has an update method:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> update<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">*</span>ary<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#008000; font-style:italic;"># ...</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>*ary means that it accepts an array as its argument. This method gets called from many places in Library, like this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">        source_library.<span style="color:#9900CC;">notify_observers</span><span style="color:#006600; font-weight:bold;">&#40;</span>source_library,
                                        BOOK_REMOVED,
                                        book<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>That’s all for now. To learn more about Observers read <a href="http://ruby-doc.org/stdlib/libdoc/observer/rdoc/index.html">this</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stupididea.com/2007/12/19/87/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup for Alexandria Development: Part I</title>
		<link>http://www.stupididea.com/2007/12/19/setup-for-alexandria-development-part-i/</link>
		<comments>http://www.stupididea.com/2007/12/19/setup-for-alexandria-development-part-i/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 05:24:53 +0000</pubDate>
		<dc:creator>method</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.stupididea.com/?p=84</guid>
		<description><![CDATA[This is the first in a series of brain-dumps of my knowledge about Alexandria and related development issues. Be warned, the approach I will take in these posts will be to discuss boring and perhaps obvious details as they occur &#8230; <a href="http://www.stupididea.com/2007/12/19/setup-for-alexandria-development-part-i/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is the first in a series of brain-dumps of my knowledge about Alexandria and related development issues. Be warned, the approach I will take in these posts will be to discuss boring and perhaps obvious details as they occur to me. You are advised to <strong>skim</strong>.</p>
<p><strong>Getting the code</strong></p>
<p>First things first, you should be able to checkout a copy of Alexandria from <a href="http://subversion.tigris.org/">subversion</a>. You can find instructions <a href="http://rubyforge.org/scm/?group_id=205">here</a>, but unless you want to pull down the entire tree this is the actual URL you want:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">svn co svn+ssh://method@rubyforge.org/var/svn/alexandria/trunk/alexandria</pre></div></div>

<p>Btw, <a href="http://drnicwilliams.com/2007/11/22/going-offline-without-your-favourite-subversion-repository/">this</a> is worth looking at if you want to play around with code without committing to a central repository.</p>
<p><strong>Initial setup</strong></p>
<p>Let&#8217;s look at the directory structure of the checked out copy (called the working directory).</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">(alexandria root)
alexandria.desktop.in (Used to add Alexandria to the Gnome menu)
Rakefile                         (The `rake` command looks for this)
/spec                            (Specs go in here)
alexandria.xcodeproj        (MacOS XCode project file)
/data                            (Configuration files go here)
/lib                               (Alexandria code libraries are here)
tasks.rb                        (Rakefile uses this file)
/bin                              (Actual system-wide alexandria command goes here)
/debian                         (Contains templates needed to create debs)
/tests                           (For old 'test/unit' tests)
/doc                             (Docs go here)
/po                               (Language files go here)
/schemas                       (Used in gconf, configuration file like Windows registry)</pre></div></div>

<p>You will need to get a copy of <a href="http://rubygems.org/">rubygems</a>. For some reason, the Ubuntu packaged rubygem never seems to actually work, so you should just compile and install rubygems from <a href="http://rubyforge.org/frs/?group_id=126">here</a>. On Ubuntu or Debian, you should run <code>sudo apt-get install build-essential ruby1.8-dev</code> because some gems will need to build &#8220;extensions&#8221;. You can use either your distro&#8217;s rake or install rake from gem. You install gems with:</p>
<p><code>
<pre>sudo gem install (package)</pre>
<p></code> </p>
<p>You should install rake, rspec, rcov and zentest (autotest):</p>
<p><code>sudo gem install rake rspec rcov zentest</code></p>
<p>To work on the website you will also need <code><a href="http://staticmatic.rubyforge.org/">staticmatic</a></code>.</p>
<p><strong>Rake and Testing</strong></p>
<p>In the root of your working directory you should now be able to type <code>rake -T</code> and you will see a long list of <a href="http://rake.rubyforge.org/">rake</a> &#8220;tasks&#8221; defined in the <code>Rakefile</code> and <code>tasks.rb</code>. The most important tasks for development purposes are <code>sudo rake install</code> to install to your system (it installs in <code>/usr/lib/</code> so be careful)  and <code>rake spec</code>, for running the test suite.</p>
<p><a href="http://rspec.info/">Rspec</a> is super cool, but you&#8217;ll have to study the tutorials to learn how to use it. A <strong>great</strong> way to learn Ruby and Rspec at the same time is to &#8216;spec out&#8217; basic Ruby types! For example, if you&#8217;re unsure about how an array method works, you can do this:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe <span style="color:#CC0066; font-weight:bold;">Array</span> <span style="color:#9966CC; font-weight:bold;">do</span>
   it <span style="color:#996600;">&quot;should sort strings alphabetically&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;b&quot;</span>, <span style="color:#996600;">&quot;a&quot;</span>, <span style="color:#996600;">&quot;c&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">sort</span>.<span style="color:#9900CC;">first</span>.<span style="color:#9900CC;">should</span> == <span style="color:#996600;">&quot;a&quot;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Just don&#8217;t get confused by the pattern of writing specs to cover code that&#8217;s already been written. The basic idea behind Behavior-Driven Development is that you write tests that show how your code will behave <em>before writing the code</em>. The only way to really learn how to do this is to force yourself to write some code this way. </p>
<p>Because BDD is supposed to happen <em>before</em> you write code, Alexandria has very poor test &#8220;coverage&#8221; at the moment, and its not easy to add specs to the code the way it is now. Still, it&#8217;s good practice to try and understand the behavior of a method on a class and write a spec for it. Take a look at the files in <code>specs/alexandria</code> for examples.</p>
<p>When a project has good test coverage it&#8217;s possible to work according to a very fast &#8220;red-to-green&#8221; development cycle. <a href="http://http://www.zenspider.com/ZSS/Products/ZenTest">Autotest</a> is a tool that will run &#8216;rake spec&#8217; every time you change a file that&#8217;s being monitored. This is great because, again if the test suite is good, you can know the second you break the code! It&#8217;s even better if you use desktop notifications with Autotest. <a href="http://www.ikhono.net/2007/12/16/gnome-autotest-notifications">This</a> is the version I use with Ubuntu Gutsy. One note: the file he links to is only good for Gentoo, you want <a href="http://rubyforge.org/frs/download.php/27134/ruby-libnotify-0.3.3.tar.bz2">this</a> one. </p>
<p>That&#8217;s all for now. I&#8217;ll do another one tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stupididea.com/2007/12/19/setup-for-alexandria-development-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s this?</title>
		<link>http://www.stupididea.com/2007/04/26/whats-this/</link>
		<comments>http://www.stupididea.com/2007/04/26/whats-this/#comments</comments>
		<pubDate>Thu, 26 Apr 2007 19:14:28 +0000</pubDate>
		<dc:creator>method</dc:creator>
				<category><![CDATA[Culture]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.stupididea.com/?p=82</guid>
		<description><![CDATA[I just got this at the top of a search for &#8220;ruby rake&#8221; on Google. Ruby — Rake: 4 According to http://jimweirich.umlcoop.net/index.cgi/Tech/Ruby - More sources » The url under &#8220;More sources&#8221; goes here. All I can figure is that this &#8230; <a href="http://www.stupididea.com/2007/04/26/whats-this/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just got this at the top of a search for &#8220;ruby rake&#8221; on Google.</p>
<pre>Ruby — Rake: 4
According to http://jimweirich.umlcoop.net/index.cgi/Tech/Ruby - More sources »</pre>
<p>The url under &#8220;More sources&#8221; goes <a href="http://www.google.com/search?q=ruby+rake&amp;fsrc=1&amp;hl=en&amp;sa=X&amp;oi=answers&amp;ct=more-sources">here</a>. All I can figure is that this is some kind of authority thing, or like the <a href="http://technorati.com/wtf/">wtf </a>feature on Technorati. jimweirich is a 4 or something. Maybe this is nothing, or maybe this is the beginning of <em>semantic categorization on Google</em>!!! ??? Why is this important? Well, if you search for Martin Luther King, one of the top links goes to a white supremacist hate page. It may be that Google is moving away from its raw algorithm, which can be gamed, and toward a trustweb system. Actually, it just occurred to me that that result could be from the Google search results tagging system that is already in place. So, is this old news?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stupididea.com/2007/04/26/whats-this/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>religion.</title>
		<link>http://www.stupididea.com/2007/04/24/religion/</link>
		<comments>http://www.stupididea.com/2007/04/24/religion/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 17:09:26 +0000</pubDate>
		<dc:creator>method</dc:creator>
				<category><![CDATA[Funny]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.stupididea.com/?p=81</guid>
		<description><![CDATA[<span style="display: block; float: left; color: #888888">12:00 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Does [your company] use whitespace or tabs?</span></span>

<span style="display: block; float: left; color: #888888">12:01 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: you mean spaces?</span></span>

<span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>everyone uses spaces.</span></span>

<span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>four spaces, in fact.</span></span>

<span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>It's Guido gospel.</span></span> <a href="http://www.stupididea.com/2007/04/24/religion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="display: block; float: left; color: #888888">12:00 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Does [your company] use whitespace or tabs?</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:01 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: you mean spaces?</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>everyone uses spaces.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>four spaces, in fact.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>It&#8217;s Guido gospel.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: But spaces suck.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:02 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: not even remotely.</span></span></p>
<p><script><!-- D(["mb","\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: I know that&#39;s the gospel, but it doesn&#39;t make sense.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: It makes excellent sense.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Easier to deal with. Only one kind of whitespace.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Do Windows and Linux use different tab characters?\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: no.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:03 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Dude, two-space tabs.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Google uses two-space whitespace, btw.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: well, nobody else does.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: I know. It drives me crazy.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:04 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>",1] );  //--></script><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: I know that&#8217;s the gospel, but it doesn&#8217;t make sense.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: It makes excellent sense.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Easier to deal with. Only one kind of whitespace.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Do Windows and Linux use different tab characters?</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: no.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:03 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Dude, two-space tabs.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Google uses two-space whitespace, btw.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: well, nobody else does.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: I know. It drives me crazy.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:04 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"></span></p>
<p><script><!-- D(["mb","\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: I like four. Everything lines up properly. \u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>\u003cbr\>def myfunc():\u003cbr\>____blah\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Eh. I use two-space tabs in Ruby, and I don&#39;t like to change when I program in Python. Gajim uses tabs, though.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: We were never told this, it&#39;s just the general rule.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:05 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Well, it&#39;ll break if you mix them.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: I am aware.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: That&#39;s retarded.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Not really. It has to break.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:06 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: I know, but it&#39;s still retarded.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:07 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>",1] );  //--></script><span><span style="font-weight: bold">   Ian</span>: I like four. Everything lines up properly. </span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span><br />
def myfunc():<br />
____blah</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Eh. I use two-space tabs in Ruby, and I don&#8217;t like to change when I program in Python. Gajim uses tabs, though.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: We were never told this, it&#8217;s just the general rule.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:05 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Well, it&#8217;ll break if you mix them.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: I am aware.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: That&#8217;s retarded.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Not really. It has to break.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:06 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: I know, but it&#8217;s still retarded.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:07 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"></span></p>
<p><script><!-- D(["mb","\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: I mean, it&#39;s been the standard forever. Tabs are bloody annoying, since they look like spaces but aren&#39;t.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: But tabs are semantic! Just turn on printer&#39;s symbols if it bothers you.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:08 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>What&#39;s annoying is backspacing and it goes back...one...character...at..\u003cWBR\>.a..time.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:10 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>I swear, future generation will look back on this as utter madness.\u003c/span\>\u003c/span\>\u003c/div\>\u003ctable cellpadding\u003d\"0\" cellspacing\u003d\"1\"\>\u003ctr\>\u003ctd style\u003d\"font-size:1;width:100%\"\>\u003chr noshade size\u003d\"1\" color\u003d\"#cccccc\"\>\u003ctd nowrap style\u003d\"font-size:80%;color:#aaa\"\>6 minutes\u003c/td\>\u003c/td\>\u003c/tr\>\u003c/table\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:17 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: well. I don&#39;t have to do that.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Vim does tht for me.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:18 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: I thought so.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: it backspaces a tab at a time if appropriate, otherwise space. It&#39;s perfectly natural.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>",1] );  //--></script><span><span style="font-weight: bold">   Ian</span>: I mean, it&#8217;s been the standard forever. Tabs are bloody annoying, since they look like spaces but aren&#8217;t.</span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: But tabs are semantic! Just turn on printer&#8217;s symbols if it bothers you.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:08 PM </span><span style="display: block; padding-left: 6em"><span>What&#8217;s annoying is backspacing and it goes back&#8230;one&#8230;character&#8230;at..<wbr></wbr>.a..time.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:10 PM </span><span style="display: block; padding-left: 6em"><span>I swear, future generation will look back on this as utter madness.</span></span></p>
<table cellpadding="0" cellspacing="1" height="22" width="870">
<tr>
<td style="font-size: 1px; width: 100%">
<hr color="#cccccc" noshade="noshade" size="1" /></td>
<td style="font-size: 80%; color: #aaaaaa" nowrap="nowrap">6 minutes</td>
</tr>
</table>
<p><span style="display: block; float: left; color: #888888">12:17 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: well. I don&#8217;t have to do that.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Vim does tht for me.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:18 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: I thought so.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: it backspaces a tab at a time if appropriate, otherwise space. It&#8217;s perfectly natural.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"></span></p>
<p><script><!-- D(["mb","\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Well, that&#39;s not so bad.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: but my code will always render in exactly the same way on everyone&#39;s machine. Lines will have the same length.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:19 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>if it&#39;s 79 chars, it won&#39;t wrap on somebody else&#39;s editor who has their tabs set to 8 or something\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: I&#39;m right, though. But it is utter gibbering insanity.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>What is sacred in web pages is verboten in code. This is ridiculous to me.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:20 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: what is sacred in web pages?\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>whitespace is ignored.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Tab means indent!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: tab doesn&#39;t mean a damn thing in a web page\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>",1] );  //--></script><span><span style="font-weight: bold">                    me</span>: Well, that&#8217;s not so bad.</span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: but my code will always render in exactly the same way on everyone&#8217;s machine. Lines will have the same length.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:19 PM </span><span style="display: block; padding-left: 6em"><span>if it&#8217;s 79 chars, it won&#8217;t wrap on somebody else&#8217;s editor who has their tabs set to 8 or something</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: I&#8217;m right, though. But it is utter gibbering insanity.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>What is sacred in web pages is verboten in code. This is ridiculous to me.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:20 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: what is sacred in web pages?</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>whitespace is ignored.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Tab means indent!</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: tab doesn&#8217;t mean a damn thing in a web page</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"></span></p>
<p><script><!-- D(["mb","\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: User sets the indent!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>I know. Using space is like using &amp;lt;br /&amp;gt; in webpages.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:21 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>You&#39;re trying to control display.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>And you call it a virtue.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: well, yeah. html isn&#39;t for content.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Madness.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: indentation is set in CSS\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Yes!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>That&#39;s my point.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:22 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Tab means &amp;lt;indent /&amp;gt;\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: But it doesn&#39;t.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>",1] );  //--></script><span><span style="font-weight: bold">                    me</span>: User sets the indent!</span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>I know. Using space is like using &lt;br /&gt; in webpages.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:21 PM </span><span style="display: block; padding-left: 6em"><span>You&#8217;re trying to control display.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>And you call it a virtue.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: well, yeah. html isn&#8217;t for content.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Madness.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: indentation is set in CSS</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Yes!</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>That&#8217;s my point.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:22 PM </span><span style="display: block; padding-left: 6em"><span>Tab means &lt;indent /&gt;</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: But it doesn&#8217;t.</span></span></p>
<p><span style="display: block; float: left; color: #888888"></span></p>
<p><script><!-- D(["mb","  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>In a web page, &quot;beginning of paragraph&quot; means &amp;lt;indent/&amp;gt;\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:23 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>there&#39;s no tabbing.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>You can&#39;t artificially insert a tab character.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: If someone said, don&#39;t use &amp;lt;p&amp;gt;, use &amp;lt;br /&amp;gt;, some users change the margins on paragraphs, you&#39;d say he was an idiot.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: You can&#39;t double-tab.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>no users change the margins on paragraphs. My own CSS does.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: I understand. I&#39;m saying tab means indent, a semantic element. It means level of scope in Python.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:24 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: but it doesn&#39;t. whitespace means level of scope.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: But if they wanted to, they could. Then it wouldn&#39;t display properly. Best to use &amp;lt;br /&amp;gt;",1] );  //--></script> <span style="display: block; padding-left: 6em"><span>In a web page, &#8220;beginning of paragraph&#8221; means &lt;indent/&gt;</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:23 PM </span><span style="display: block; padding-left: 6em"><span>there&#8217;s no tabbing.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>You can&#8217;t artificially insert a tab character.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: If someone said, don&#8217;t use &lt;p&gt;, use &lt;br /&gt;, some users change the margins on paragraphs, you&#8217;d say he was an idiot.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: You can&#8217;t double-tab.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>no users change the margins on paragraphs. My own CSS does.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: I understand. I&#8217;m saying tab means indent, a semantic element. It means level of scope in Python.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:24 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: but it doesn&#8217;t. whitespace means level of scope.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: But if they wanted to, they could. Then it wouldn&#8217;t display properly. Best to use &lt;br /&gt;</span></span></p>
<p><script><!-- D(["mb","\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: no, they couldn&#39;t.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Ahh!!!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:25 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Yes, they could. They could change the default stylesheet, and make it !important.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: The end user doesn&#39;t control the display of a web page, except for text size.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Ugh.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>They have a degenerative sight disorder that requires the paragraphs to be widely spaced.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:27 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>I&#39;m saying the principle that is sacred in web pages is considered a liability in code, and only really in Python and shell scripts, because indentation is just for looks in C++, Ruby, Java, etc.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: But no one will ever do that. I don&#39;t understand how this is at all relevant. Code display has nothing to do with layout. The goal is to do it the same way as everybody else.",1] );  //--></script><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: no, they couldn&#8217;t.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Ahh!!!</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:25 PM </span><span style="display: block; padding-left: 6em"><span>Yes, they could. They could change the default stylesheet, and make it !important.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: The end user doesn&#8217;t control the display of a web page, except for text size.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Ugh.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>They have a degenerative sight disorder that requires the paragraphs to be widely spaced.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:27 PM </span><span style="display: block; padding-left: 6em"><span>I&#8217;m saying the principle that is sacred in web pages is considered a liability in code, and only really in Python and shell scripts, because indentation is just for looks in C++, Ruby, Java, etc.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: But no one will ever do that. I don&#8217;t understand how this is at all relevant. Code display has nothing to do with layout. The goal is to do it the same way as everybody else.</span></span></p>
<p><script><!-- D(["mb","\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>and that sacred principle is...?\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>i still don&#39;t get it.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Since there are no tab characters in web pages.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:28 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Let the user determine presentation. That&#39;s the principle. If they want to apply another stylesheet that makes your page look stupid, so be it.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: But that isn&#39;t a sacred principle in web pages.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Yes it is.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>It&#39;s why we don&#39;t use tables and &amp;lt;br /&amp;gt; for everything. It&#39;s why we don&#39;t compose web pages in Word.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:29 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: No, it isn&#39;t.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>We don&#39;t do it that way because it&#39;s extremely limited.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>",1] );  //--></script><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>and that sacred principle is&#8230;?</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>i still don&#8217;t get it.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Since there are no tab characters in web pages.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:28 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Let the user determine presentation. That&#8217;s the principle. If they want to apply another stylesheet that makes your page look stupid, so be it.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: But that isn&#8217;t a sacred principle in web pages.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Yes it is.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>It&#8217;s why we don&#8217;t use tables and &lt;br /&gt; for everything. It&#8217;s why we don&#8217;t compose web pages in Word.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:29 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: No, it isn&#8217;t.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>We don&#8217;t do it that way because it&#8217;s extremely limited.</span></span></p>
<p><span style="display: block; float: left; color: #888888"></span></p>
<p><script><!-- D(["mb","  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>And it won&#39;t display the way /we/ want it to.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Dude, wtf? Use flash if you want to control display.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:30 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: But that&#39;s totally wrong! That&#39;s warped!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: I understand that the user usually views a page the way you want him to.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>But he doesn&#39;t have to.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Always. Unless they&#39;re hacking it.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>In which case I don&#39;t care.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:31 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Build the page to deal with big text and small viewports, but otherwise whatever.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: What are you talking about? They can view a page in Lynx, or with a screen reader, or using a Greasemonkey script, or whatever.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:32 PM ",1] );  //--></script> <span style="display: block; padding-left: 6em"><span>And it won&#8217;t display the way /we/ want it to.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Dude, wtf? Use flash if you want to control display.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:30 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: But that&#8217;s totally wrong! That&#8217;s warped!</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: I understand that the user usually views a page the way you want him to.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>But he doesn&#8217;t have to.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Always. Unless they&#8217;re hacking it.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>In which case I don&#8217;t care.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:31 PM </span><span style="display: block; padding-left: 6em"><span>Build the page to deal with big text and small viewports, but otherwise whatever.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: What are you talking about? They can view a page in Lynx, or with a screen reader, or using a Greasemonkey script, or whatever.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:32 PM</span></p>
<p><script><!-- D(["mb","\u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: There aren&#39;t other variations, except for the extreme outliers where people hack your CSS.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: If it&#39;s important to have code displayed with a certain size tab, you could include a hint at the top.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: People using greasemonkey scripts know the page will be fucked up. Lynx doesn&#39;t apply, since it strips CSS. Screen readers are a completely different thing.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:33 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: I am horrified.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: I dunno where you get this insane idea.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: I don&#39;t know why you&#39;re fighting me on this. The whitespace thing, sure. But not this principle.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:34 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: You can&#39;t account for all users. Especially not if they are making up their own CSS.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>",1] );  //--></script> <span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: There aren&#8217;t other variations, except for the extreme outliers where people hack your CSS.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: If it&#8217;s important to have code displayed with a certain size tab, you could include a hint at the top.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: People using greasemonkey scripts know the page will be fucked up. Lynx doesn&#8217;t apply, since it strips CSS. Screen readers are a completely different thing.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:33 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: I am horrified.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: I dunno where you get this insane idea.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: I don&#8217;t know why you&#8217;re fighting me on this. The whitespace thing, sure. But not this principle.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:34 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: You can&#8217;t account for all users. Especially not if they are making up their own CSS.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span></span></span></p>
<p><script><!-- D(["mb","\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: &amp;lt;br /&amp;gt;This is a paragraph.&amp;lt;br /&amp;gt; See, it&#39;s better? Works every time, no matter what the user does.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: It&#39;s impossible to predict that.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Except you can&#39;t do anything. That&#39;s idiotic.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:35 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Yes, because it&#39;s attempting to define display with markup.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: but &amp;lt;p&amp;gt; tags aren&#39;t for the benefit of the user\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>they are boxes with default CSS that you, the designer, change.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:36 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>They&#39;re roughly semantic, but you don&#39;t use them wherever you have text.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Okay, I get you.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>But a screen reader would use the paragraphs to know where to pause, for example.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>",1] );  //--></script><span style="font-weight: bold">                    me</span>: &lt;br /&gt;This is a paragraph.&lt;br /&gt; See, it&#8217;s better? Works every time, no matter what the user does.</p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: It&#8217;s impossible to predict that.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Except you can&#8217;t do anything. That&#8217;s idiotic.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:35 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Yes, because it&#8217;s attempting to define display with markup.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: but &lt;p&gt; tags aren&#8217;t for the benefit of the user</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>they are boxes with default CSS that you, the designer, change.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:36 PM </span><span style="display: block; padding-left: 6em"><span>They&#8217;re roughly semantic, but you don&#8217;t use them wherever you have text.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Okay, I get you.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>But a screen reader would use the paragraphs to know where to pause, for example.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"></span></p>
<p><script><!-- D(["mb","\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: They certainly don&#39;t mean &quot;paragraph,&quot; and they&#39;re only indented if you explicitly set text-indent.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>If it&#39;s a screen reader, you have a different style sheet\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:37 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Yes!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: and you use pause-before:blah\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>in the CSS\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Do you define a css audio stylesheet for your pages?\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Hell no.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: So they use the default settings.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Certainly not for zenoss.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:38 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: It&#39;s whatever they want.",1] );  //--></script><span><span style="font-weight: bold">                    Ian</span>: They certainly don&#8217;t mean &#8220;paragraph,&#8221; and they&#8217;re only indented if you explicitly set text-indent.</span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>If it&#8217;s a screen reader, you have a different style sheet</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:37 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Yes!</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: and you use pause-before:blah</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>in the CSS</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Do you define a css audio stylesheet for your pages?</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Hell no.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: So they use the default settings.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Certainly not for [my company].</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:38 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: It&#8217;s whatever they want.</span></span></p>
<p><script><!-- D(["mb","\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>And you can override stylesheet settings with !important.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Also it strips out all layout, so it&#39;s irrelevant.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Huh? That&#39;s layout. It doesn&#39;t read them in any order.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:39 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: WHO can? \u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>The blind greasemonkey users?\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Yes.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: I will never, ever design a page for a blind greasemonkey user.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Argh.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Please see the analogy.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:40 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>",1] );  //--></script><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>And you can override stylesheet settings with !important.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Also it strips out all layout, so it&#8217;s irrelevant.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Huh? That&#8217;s layout. It doesn&#8217;t read them in any order.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:39 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: WHO can? </span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>The blind greasemonkey users?</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Yes.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: I will never, ever design a page for a blind greasemonkey user.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Argh.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Please see the analogy.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:40 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold"></span></span></span></p>
<p><script><!-- D(["mb","Ian\u003c/span\>: I see what you&#39;re getting at, but I think you&#39;re totally wrong.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>The user /can/ define presentation, but only by /breaking/ the original code and rewriting it.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Or using an application that discards certain things, like a screen reader.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: &quot;As god is my witness, I will never allow another programmer to view my code at anything but four spaces to an indent level. I would rather die.&quot;\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Or lynx.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:41 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>So if you really want to, you can, before editing any code, translate all spaces into tabs, then do your editing, then retranslate and save.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>That is roughly comparable.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>It&#39;s a simple greasemonkey script.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: You&#39;re saying it&#39;s something freaky, because it&#39;s rare. But it&#39;s just rare. It&#39;s something that&#39;s built in to html.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>",1] );  //--></script>  <strong>Ian:</strong> I see what you&#8217;re getting at, but I think you&#8217;re totally wrong.</p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>The user /can/ define presentation, but only by /breaking/ the original code and rewriting it.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Or using an application that discards certain things, like a screen reader.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: &#8220;As god is my witness, I will never allow another programmer to view my code at anything but four spaces to an indent level. I would rather die.&#8221;</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Or lynx.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:41 PM </span><span style="display: block; padding-left: 6em"><span>So if you really want to, you can, before editing any code, translate all spaces into tabs, then do your editing, then retranslate and save.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>That is roughly comparable.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>It&#8217;s a simple greasemonkey script.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: You&#8217;re saying it&#8217;s something freaky, because it&#8217;s rare. But it&#8217;s just rare. It&#8217;s something that&#8217;s built in to html.</span></span></p>
<p><span style="display: block; float: left; color: #888888"></span></p>
<p><script><!-- D(["mb","12:42 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: if you just have to have your indentation be a certain width, you can. But who the hell cares? The end user of code is the computer.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>You make it useful for future coders, of course\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: You do know that all the CSS Zen Garden sheets refer to the same page, right?\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Make it readable and whatnot\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Yes.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>It&#39;s a basic HTML structure.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:44 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>divs with some ps and uls\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Anyways, I can&#39;t change the whitespace to tabs. People would yell at me.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Well, then you change it back, before saving.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>",1] );  //--></script>12:42 PM</p>
<p><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: if you just have to have your indentation be a certain width, you can. But who the hell cares? The end user of code is the computer.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>You make it useful for future coders, of course</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: You do know that all the CSS Zen Garden sheets refer to the same page, right?</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Make it readable and whatnot</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Yes.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>It&#8217;s a basic HTML structure.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:44 PM </span><span style="display: block; padding-left: 6em"><span>divs with some ps and uls</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Anyways, I can&#8217;t change the whitespace to tabs. People would yell at me.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Well, then you change it back, before saving.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"></span></p>
<p><script><!-- D(["mb","\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Whywhywhy?\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Because code isn&#39;t written for you.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>It&#39;s written for everyone.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:45 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>I take that back: it isn&#39;t written for anyone.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>it&#39;s written to be run. \u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>You make it readable, not pretty\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>more to the point: you make it /editable/\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:46 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>(which web pages aren&#39;t)\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: What&#39;s so bad about tabs??? They only occur at the beginning of the line. If there&#39;s one, it means one level of indent, two two levels, etc.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>If the user chooses to view them at 4 spaces per tab, they display like that, if 2, then that.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:47 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>",1] );  //--></script><span><span style="font-weight: bold">                    me</span>: Whywhywhy?</span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Because code isn&#8217;t written for you.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>It&#8217;s written for everyone.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:45 PM </span><span style="display: block; padding-left: 6em"><span>I take that back: it isn&#8217;t written for anyone.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>it&#8217;s written to be run. </span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>You make it readable, not pretty</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>more to the point: you make it /editable/</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:46 PM </span><span style="display: block; padding-left: 6em"><span>(which web pages aren&#8217;t)</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: What&#8217;s so bad about tabs??? They only occur at the beginning of the line. If there&#8217;s one, it means one level of indent, two two levels, etc.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>If the user chooses to view them at 4 spaces per tab, they display like that, if 2, then that.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:47 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span></span></span></p>
<p><script><!-- D(["mb","\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Nothing in particular, except it&#39;s a whole nother character to deal with. If &quot;whitespace\u003dspace&quot; it&#39;s easier.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>From a coding perspective.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>I don&#39;t have to wonder if there are tabs anywhere, because they&#39;re all spaces.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:48 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: The thing is, it doesn&#39;t even matter in Ruby! I can write the whole script without any beginning of line spaces at all! It&#39;s only Python that cares! And Guido bases it on the C++ coding standard, where it also doesn&#39;t matter!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: If I want to indent only one space, I can.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>If I want to line up my dictionary values, I can.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:49 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: In Gedit, tabs are arrows and spaces are dots.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: If you turn that shit on. But most people don&#39;t. Most people use emacs and vim.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>",1] );  //--></script><span style="font-weight: bold">  Ian</span>: Nothing in particular, except it&#8217;s a whole nother character to deal with. If &#8220;whitespace=space&#8221; it&#8217;s easier.</p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>From a coding perspective.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>I don&#8217;t have to wonder if there are tabs anywhere, because they&#8217;re all spaces.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:48 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: The thing is, it doesn&#8217;t even matter in Ruby! I can write the whole script without any beginning of line spaces at all! It&#8217;s only Python that cares! And Guido bases it on the C++ coding standard, where it also doesn&#8217;t matter!</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: If I want to indent only one space, I can.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>If I want to line up my dictionary values, I can.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:49 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: In Gedit, tabs are arrows and spaces are dots.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: If you turn that shit on. But most people don&#8217;t. Most people use emacs and vim.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"></span></p>
<p><script><!-- D(["mb","\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Well, okay, there&#39;s something.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:50 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Things only get out of whack if you mix tabs and spaces, it&#39;s true.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: mostly it&#39;s just annoying to have arrows and dots scattered throughout your code.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: It makes it clear for me.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:51 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>I don&#39;t understand why &quot;knowing if whitespace is a tab or a space&quot; is more important than knowing that you haven&#39;t accidentally backspaced and set a line to three space indent instead of four.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>That happens all the time.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:52 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: that never happens.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>I have autoindentation on.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: It&#39;s happened to me. It&#39;s happened in code that I&#39;ve downloaded.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>",1] );  //--></script><span><span style="font-weight: bold">                    me</span>: Well, okay, there&#8217;s something.</span></p>
<p><span style="display: block; float: left; color: #888888">12:50 PM</span><span style="display: block; padding-left: 6em"><span>Things only get out of whack if you mix tabs and spaces, it&#8217;s true.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: mostly it&#8217;s just annoying to have arrows and dots scattered throughout your code.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: It makes it clear for me.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:51 PM </span><span style="display: block; padding-left: 6em"><span>I don&#8217;t understand why &#8220;knowing if whitespace is a tab or a space&#8221; is more important than knowing that you haven&#8217;t accidentally backspaced and set a line to three space indent instead of four.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>That happens all the time.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:52 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: that never happens.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>I have autoindentation on.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: It&#8217;s happened to me. It&#8217;s happened in code that I&#8217;ve downloaded.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"></span></p>
<p><script><!-- D(["mb","\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Then someone wrote it poorly.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:53 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>That happened to me when I used gedit, which is a stupid application.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>or notepad or something.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: All this effort for a marginal problem of &quot;knowing whether a character is a whitespace or tab&quot; when it introduces another marginal problem.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: But there are no problems.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:54 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>My code is always clean, no matter who looks at it.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Just like there were no problems with the five year plans!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Umm.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:55 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Unless they have their line width set to something short. But then they would be an iiot.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>idiot\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>",1] );  //--></script><span><span style="font-weight: bold">                    Ian</span>: Then someone wrote it poorly.</span></p>
<p><span style="display: block; float: left; color: #888888">12:53 PM </span><span style="display: block; padding-left: 6em"><span>That happened to me when I used gedit, which is a stupid application.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>or notepad or something.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: All this effort for a marginal problem of &#8220;knowing whether a character is a whitespace or tab&#8221; when it introduces another marginal problem.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: But there are no problems.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:54 PM </span><span style="display: block; padding-left: 6em"><span>My code is always clean, no matter who looks at it.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Just like there were no problems with the five year plans!</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Umm.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:55 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Unless they have their line width set to something short. But then they would be an iiot.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>idiot</span></span></p>
<p><script><!-- D(["mb","\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Google uses two spaces! Four spaces is too much!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:56 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Google uses two spaces because fewer spaces translate into less downloaded.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Let the programmer decide!\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Any web programmer worth his or her salt packs their code before uploading.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:57 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: No, because code shouldn&#39;t be nested beyond more than two or three levels anyway.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>So it should be easy enough to read at two spaces.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: ?\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:58 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>I mean, yeah, code rarely gets that deep\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>  \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>Except not really, when you have vars inside functions inside functions inside classes.",1] );  //--></script><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Google uses two spaces! Four spaces is too much!</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:56 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Google uses two spaces because fewer spaces translate into less downloaded.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Let the programmer decide!</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Any web programmer worth his or her salt packs their code before uploading.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:57 PM </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: No, because code shouldn&#8217;t be nested beyond more than two or three levels anyway.</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>So it should be easy enough to read at two spaces.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: ?</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:58 PM </span><span style="display: block; padding-left: 6em"><span>I mean, yeah, code rarely gets that deep</span></span></p>
<p><span style="display: block; float: left; color: #888888">  </span><span style="display: block; padding-left: 6em"><span>Except not really, when you have vars inside functions inside functions inside classes.</span></span></p>
<p><script><!-- D(["mb","\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>me\u003c/span\>: Most Ruby code uses two spaces and it&#39;s easy to read.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\>12:59 PM \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em\"\>\u003cspan\>About four or five levels.\u003c/span\>\u003c/span\>\u003c/div\>\u003cdiv\>\u003cspan style\u003d\"display:block;float:left;color:#888\"\> \u003c/span\>\u003cspan style\u003d\"display:block;padding-left:6em;text-indent:-1em\"\>\u003cspan\>\u003cspan style\u003d\"font-weight:bold\"\>Ian\u003c/span\>: Well, if Ruby takes over the world, perhaps other people will do it that way.\u003c/span\>\u003c/span\>\u003c/div\>",0] ); D(["ce"]);  //--></script><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">me</span>: Most Ruby code uses two spaces and it&#8217;s easy to read.</span></span></p>
<p><span style="display: block; float: left; color: #888888">12:59 PM </span><span style="display: block; padding-left: 6em"><span>About four or five levels.</span></span></p>
<p><span style="display: block; float: left; color: #888888"> </span><span style="display: block; padding-left: 6em; text-indent: -1em"><span><span style="font-weight: bold">Ian</span>: Well, if Ruby takes over the world, perhaps other people will do it that way.</span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stupididea.com/2007/04/24/religion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using xsl to import a phpmyadmin xml file</title>
		<link>http://www.stupididea.com/2007/04/15/using-xsl-to-import-a-phpmyadmin-xml-file/</link>
		<comments>http://www.stupididea.com/2007/04/15/using-xsl-to-import-a-phpmyadmin-xml-file/#comments</comments>
		<pubDate>Mon, 16 Apr 2007 00:32:35 +0000</pubDate>
		<dc:creator>method</dc:creator>
				<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://www.stupididea.com/?p=79</guid>
		<description><![CDATA[Yep, following the last post I have to explain what I just did for the LazyWeb1 . This is going to be boring and technical, folks. If you&#8217;re like me, you&#8217;ve exported a MySQL database as an xml file through &#8230; <a href="http://www.stupididea.com/2007/04/15/using-xsl-to-import-a-phpmyadmin-xml-file/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yep, following the last post I have to explain what I just did for the LazyWeb<sup><a href="http://www.stupididea.com/2007/04/15/using-xsl-to-import-a-phpmyadmin-xml-file/#footnote_0_79" id="identifier_0_79" class="footnote-link footnote-identifier-link" title=" Ironically, there doesn&amp;#8217;t appear to be an entry on Wikipedia for Lazyweb. I understand it as asking on your blog for help with answering a question (&amp;#8220;Dear Lazyweb, &amp;#8230;&amp;#8221;), i.e., you&amp;#8217;re too lazy to research the topic yourself. I&amp;#8217;m extending the concept of LazyWeb here to include the posts and forum threads that help you when you&amp;#8217;re out googling for a solution to a problem. ">1</a></sup> . This is going to be boring and technical, folks.</p>
<p>If you&#8217;re like me, you&#8217;ve exported a MySQL database as an xml file through PhpMyAdmin.  In general, you <strong>shouldn&#8217;t</strong>  do this. You want the SQL file. I don&#8217;t entirely understand it, but phpmyadmin does not import the format that it exports. If you throw away the database, you&#8217;ll be stuck with an xml file that can&#8217;t be easily imported. Okay, and if you already threw away the database? In my case, it&#8217;s an old Texpattern db that I want to get into a WordPress db, so if I can just get it into RSS form I&#8217;m home free. Here&#8217;s what you do:</p>
<ul>
<li>Take a look at <a href="http://www.w3schools.com/xsl/xsl_transformation.asp">this</a> explanation of XSL (XML Stylesheets).</li>
<li>Create an XSL stylesheet like this (name it stylesheet.xsl for this example):
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
&lt;xsl:template match="/"&gt;
&lt;rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"&gt;
&lt;channel&gt;
&lt;title&gt;Stupididea&lt;/title&gt;
&lt;link&gt;http://www.stupididea.com/&lt;/link&gt;
&lt;description&gt;&lt;/description&gt;
&lt;language&gt;en-us&lt;/language&gt;
&lt;xsl:for-each select="stupidid_text/textpattern"&gt;
&lt;item&gt;
&lt;title&gt;&lt;xsl:value-of select="Title"/&gt;&lt;/title&gt;
&lt;link&gt;&lt;/link&gt;
&lt;description&gt;&lt;xsl:value-of select="Body_html"/&gt;&lt;/description&gt;
&lt;dc:creator&gt;&lt;xsl:value-of select="AuthorID"/&gt;&lt;/dc:creator&gt;
&lt;dc:date&gt;&lt;xsl:value-of select="Posted"/&gt;&lt;/dc:date&gt;
&lt;/item&gt;
&lt;/xsl:for-each&gt;
&lt;/channel&gt;
&lt;/rss&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;</pre>
</li>
<li>Include a line like this at the top of the xml file you exported from phpmyadmin:
<pre>&lt;?xml-stylesheet type="text/xsl" href="stylesheet.xsl"?&gt;</pre>
</li>
<li>Open an xsl-aware browser (most of them) and try to save the page as an rss file. Note: this was quirky for me. Sometimes the browser would just save the original file, sometimes it would save the stylesheeted output. Try with different browsers.</li>
<li>(WordPress) Import the RSS file after checking that it is valid.</li>
</ul>
<p>This is the general solution for any case where you can recover your database by transforming the phpmyadmin xml into an importable format. You&#8217;ll have to play around with the options based on your use-case.</p>
<p>---</p><ol class="footnotes"><li id="footnote_0_79" class="footnote"> Ironically, there doesn&#8217;t appear to be an entry on Wikipedia for Lazyweb. I understand it as asking on your blog for help with answering a question (&#8220;Dear Lazyweb, &#8230;&#8221;), i.e., you&#8217;re too lazy to research the topic yourself. I&#8217;m extending the concept of LazyWeb here to include the posts and forum threads that help you when you&#8217;re out googling for a solution to a problem. </li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.stupididea.com/2007/04/15/using-xsl-to-import-a-phpmyadmin-xml-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

