<?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>Glen Scott - Keeping it simple &#187; programming</title>
	<atom:link href="http://www.glenscott.co.uk/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.glenscott.co.uk/blog</link>
	<description>Thoughts on software development and other geeky pursuits.</description>
	<lastBuildDate>Fri, 10 Feb 2012 17:23: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>Install mcrypt PHP extension on OS X Snow Leopard</title>
		<link>http://www.glenscott.co.uk/blog/2011/02/03/install-mcrypt-php-extension-on-os-x-snow-leopard/</link>
		<comments>http://www.glenscott.co.uk/blog/2011/02/03/install-mcrypt-php-extension-on-os-x-snow-leopard/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 23:08:22 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/blog/?p=508</guid>
		<description><![CDATA[Please note: The following instructions apply to Mac OS X 10.6 (Snow Leopard). I have an updated guide for how to install mcrypt on 10.7 (Lion). mcrypt is a useful extension to PHP if you would like to support a wide range of encryption algorithms within your code. This guide explains how you can enable [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/ev0luti0nary/5269693629/" title="Lock away the evil... by Ev0luti0nary, on Flickr"><img src="http://farm6.static.flickr.com/5128/5269693629_897ed25803.jpg" width="500" height="332" alt="Lock away the evil..."></a></p>
<p><em>Please note:  The following instructions apply to Mac OS X 10.6 (Snow Leopard).  I have an updated guide for how to <a href="http://www.glenscott.co.uk/blog/2011/08/29/install-mcrypt-php-extension-on-mac-os-x-lion/">install mcrypt on 10.7 (Lion)</a>.</em></p>
<p><a href="http://mcrypt.sourceforge.net/">mcrypt</a> is a useful extension to PHP if you would like to support a wide range of encryption algorithms within your code.</p>
<p>This guide explains how you can enable install mcrypt, along with the PHP extension, on Mac OS X 10.6.</p>
<h3>Xcode</h3>
<p>The Xcode package installs the necessary versions of tools like autoconf which is needed during the PHP extension compilation process. Make sure you have at least Xcode v3.2 installed; the install package is available on the Snow Leopard install DVD under the â€œOptional Installsâ€ folder.</p>
<h3>libmcrypt</h3>
<p><a href="http://www.sourceforge.net/projects/mcrypt">libmcrypt</a> is the library that provides the encryption functions.  We need to install this before building the PHP extension.</p>
<ul>
<li>Open up Terminal.app</li>
<li><code>export CFLAGS="-arch x86_64"</code></li>
<li>Download <a href="http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/">libmcrypt from sourceforge</a></li>
<li>Unpack the archive somewhere</li>
<li><code>cd libmcrypt</code></li>
<li><code>./configure --disable-shared</code></li>
<li><code>make</code></li>
<li><code>sudo make install</code></li>
</ul>
<h3>PHP Extension</h3>
<p>Once we have libmcrypt installed, we can build the PHP extension.</p>
<ul>
<li><a href="http://museum.php.net/php5/php-5.3.4.tar.gz">Download PHP 5.3.4 source (tar gz format)</a></li>
<li>Unpack the archive and <code>cd php-5.3.4/ext/mcrypt/</code></li>
<li>phpize</li>
</ul>
<p>You should see output similar to the following:</p>
<pre>
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
</pre>
<ul>
<li><code>./configure</code></li>
<li><code>make</code></li>
<li><code>sudo make install</code></li>
</ul>
<p>On successful install, you will see the following message:</p>
<pre>
Installing shared extensions:     /usr/lib/php/extensions/no-debug-non-zts-20090626/
</pre>
<p>To enable the module, include the following line in your <code>/etc/php.ini</code> file:</p>
<pre>
extension = mcrypt.so
</pre>
<p>Finally, restart your Apache server:</p>
<pre>
sudo apachectl restart
</pre>
<p>And that&#8217;s it:  you should now be able to utilise the functions, as detailed in the <a href="http://uk3.php.net/mcrypt">PHP mcrypt documentation</a>.</p>
<p><a href="/images/mcrypt-106.png"><img src="/images/mcrypt-106-m.png" alt="mcrypt php extension"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2011/02/03/install-mcrypt-php-extension-on-os-x-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Objects in Perl (part 2,352)</title>
		<link>http://www.glenscott.co.uk/blog/2009/02/20/objects-in-perl-part-2352/</link>
		<comments>http://www.glenscott.co.uk/blog/2009/02/20/objects-in-perl-part-2352/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 12:33:03 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[moose]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/?p=340</guid>
		<description><![CDATA[One of my issues with Perl has always been its implementation of OOP. Or, to be precise, the multitude of ways that a class can be declared (blessed hash, inside-out, Class::Std etc). I would argue that this is a case where TMTOWTDI is not advantageous. Enter PiersÂ Cawley and his _Moose for Ruby Programmers_ talk at [...]]]></description>
			<content:encoded><![CDATA[<p>One of my issues with Perl has always been its implementation of OOP.  Or, to be precise, the multitude of ways that a class can be declared (blessed hash, <a href="http://search.cpan.org/dist/Object-InsideOut/lib/Object/InsideOut.pod">inside-out</a>, <a href="http://search.cpan.org/~dmuey/Class-Std-0.0.9/lib/Class/Std.pm">Class::Std</a> etc).  I would argue that this is a case where <a href="http://en.wikipedia.org/wiki/There_is_more_than_one_way_to_do_it">TMTOWTDI</a> is not advantageous.  Enter PiersÂ Cawley and his _Moose for Ruby Programmers_ talk at the London.pm Technical Meeting, 20th February 2009.  MooseX::Declare is yet another way, but check this out&#8230;</p>
<pre name="code" class="perl">
    use MooseX::Declare;

    class BankAccount {
        has 'balance' =&gt; ( isa =&gt; 'Num', is =&gt; 'rw', default =&gt; 0 );

        method deposit (Num $amount) {
            $self-&gt;balance( $self-&gt;balance + $amount );
        }

        method withdraw (Num $amount) {
            my $current_balance = $self-&gt;balance();
            ( $current_balance &gt;= $amount )
                || confess "Account overdrawn";
            $self-&gt;balance( $current_balance - $amount );
        }
    }

    class CheckingAccount extends BankAccount {
        has 'overdraft_account' =&gt; ( isa =&gt; 'BankAccount', is =&gt; 'rw' );

        before withdraw (Num $amount) {
            my $overdraft_amount = $amount - $self-&gt;balance();
            if ( $self-&gt;overdraft_account &#038;&#038; $overdraft_amount > 0 ) {
                $self-&gt;overdraft_account-&gt;withdraw($overdraft_amount);
                $self-&gt;deposit($overdraft_amount);
            }
        }
    }
</pre>
<p>Firstly, yes, that is indeed Perl.  Secondly, wow:  it actually _looks_ like a class definition.  And this was the big win for me, as anyone coming from a Java or PHP background will find it trivial to understand what&#8217;s going on here.  The main point is that by using MooseX::Declare, you are moving towards a more declarative programming style describing _what_ the program should do rather than _how_ it should achieve it.  So, no more unrolling `@_` <img src='http://www.glenscott.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Links</h3>
<ul>
<li><a href="http://search.cpan.org/~flora/MooseX-Declare-0.03/lib/MooseX/Declare.pm">MooseX::Declare on CPAN</a></li>
<li><a href="http://www.bofh.org.uk/">Piers Cawley&#8217;s blog &#8211; Just A Summary</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2009/02/20/objects-in-perl-part-2352/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The problem with complex error messages</title>
		<link>http://www.glenscott.co.uk/blog/2008/12/07/the-problem-with-complex-error-messages/</link>
		<comments>http://www.glenscott.co.uk/blog/2008/12/07/the-problem-with-complex-error-messages/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 22:26:39 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[bestpractice]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[exceptionhandling]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/?p=264</guid>
		<description><![CDATA[Whilst I found myself agreeing with most of Jeff Atwood&#8217;s post The Problem With Logging, I strongly disagree with his third point: If it&#8217;s worth saving to a logfile, it&#8217;s worth showing in the user interface. This is the paradox: if the information you&#8217;re logging is at all valuable, it deserves to be surfaced in [...]]]></description>
			<content:encoded><![CDATA[<p>Whilst I found myself agreeing with most of Jeff Atwood&#8217;s post <a href="http://www.codinghorror.com/blog/archives/001192.html">The Problem With Logging</a>, I strongly disagree with his third point:</p>
<blockquote><p>If it&#8217;s worth saving to a logfile, it&#8217;s worth showing in the user interface. This is the paradox: if the information you&#8217;re logging is at all valuable, it deserves to be surfaced in the application itself, not buried in an anonymous logfile somewhere. Even if it&#8217;s just for administrators. Logfiles are all too often where useful data goes to die, alone, unloved and ignored.</p></blockquote>
<p>This fails to take into consideration the two very distinct types of error messages that an application should have:  <strong>administrator focused</strong> and <strong>user focused</strong>.  Both of these error messages can be triggered by the same error condition.  A problem occurs when you display administrator focused messages to the user:  anyone that has come across largely meaningless error codes rather than a friendly human-readable language has experienced this less-than-valuable approach to logging.</p>
<p><img src="http://homepage.mac.com/bradster/iarchitect/images/vbsys1.gif" alt="useless error mesage" style="margin: 10px" /></p>
<p><a href="http://www.useit.com/alertbox/20010624.html">Good error messages</a> are essential to any application, and so are adminstrator focused messages, but let&#8217;s remember these are two very distinct features and need to be separated as necessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2008/12/07/the-problem-with-complex-error-messages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Review: London Perl Workshop</title>
		<link>http://www.glenscott.co.uk/blog/2008/11/30/review-london-perl-workshop/</link>
		<comments>http://www.glenscott.co.uk/blog/2008/11/30/review-london-perl-workshop/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 21:31:17 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[workshop]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/?p=253</guid>
		<description><![CDATA[Spent an interesting morning in the company of many Perl mongers at the London Perl Workshop. Although I don&#8217;t use Perl as my primary language any more, it was was interesting to learn about the current movements of its London-based community. The talks I attended were: The Complete History of the Perle Mongers of Olde [...]]]></description>
			<content:encoded><![CDATA[<p>Spent an interesting morning in the company of many Perl mongers at the London Perl Workshop.  Although I don&#8217;t use Perl as my primary language any more, it was was interesting to learn about the current movements of its <a href="http://london.pm.org/">London-based community</a>.  The talks I attended were:</p>
<ul>
<li>The Complete History of the Perle Mongers of Olde London Towne  &#8211; Dave Cross</li>
<li>DBIx::Class for (advanced) beginnersâ€Ž &#8211; Leo Lapworth</li>
<li>closures for fun and maybe profitâ€Ž &#8211; David Cantrell</li>
<li>Catalyst, DBIx::Class and PostgreSQL -â€Ž Matt Trout</li>
<li>â€ŽIntroduction to Moose &#8211; Mike Whitaker</li>
</ul>
<p>In particular, DBIx::Class caught my eye as a nice way of abstracting database details behind more friendly object methods.  Although, as the <a href="http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class.pm#CONTRIBUTORS">list of contributors</a> shows, this is a highly complex problem to solve and achieving a &#8220;one size fits all&#8221; solution may be unrealistic.</p>
<p>Matt Trout&#8217;s talk was a little disappointing.  Although I admired his passion and enthusiasm, there was far too much crammed in the 40 minute talk.  Just concentrating on one aspect of the development process would been more useful.  However, saying that, he did enough to convince me that I need to revisit PostgreSQL at some point in the future.</p>
<p>My colleague Mike Whitaker talked about the &#8220;postmodern object system&#8221;, <a href="http://www.iinteractive.com/moose/">Moose</a>.  There was lots of questions by the end of the talk, which was a good sign that the introduction had achieved its aim.</p>
<p>Overall, a good experience and a reminder that the Perl community is very much alive and well.</p>
<ul>
<li><a href="http://conferences.yapceurope.org/lpw2008/">London Perl Workshop</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2008/11/30/review-london-perl-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Real World Lisp</title>
		<link>http://www.glenscott.co.uk/blog/2008/11/26/real-world-lisp/</link>
		<comments>http://www.glenscott.co.uk/blog/2008/11/26/real-world-lisp/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 14:42:26 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[lisp]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/?p=251</guid>
		<description><![CDATA[Prompted by a question posed by one of my colleagues today, &#8220;has anyone ever used Lisp?&#8221;, I surprisingly found myself being the only person that had. I played around with it many years ago after being inspired by Eric S. Raymond&#8217;s seminal article, &#8220;How to Become A Hacker&#8221; in which he explained that &#8220;getting&#8221; Lisp [...]]]></description>
			<content:encoded><![CDATA[<p>Prompted by a question posed by one of my colleagues today, &#8220;has anyone ever used Lisp?&#8221;, I surprisingly found myself being the only person that had.</p>
<p>I played around with it many years ago after being inspired by Eric S. Raymond&#8217;s seminal article, <a href="http://www.catb.org/~esr/faqs/hacker-howto.html">&#8220;How to Become A Hacker&#8221;</a> in which he explained that &#8220;getting&#8221; Lisp is equalivent to finding programming nirvana.  </p>
<p>Whilst I didn&#8217;t quite reach those levels, I found that using Lisp was a great learning experience.  Despite it being half a century old, it is still a relevant language today;  the online <em>Practical Common Lisp</em> book contains examples of a spam filter, an ID3 tag parser and other real-world examples.</p>
<p>The following two links are for the curious who might wish to try it out:</p>
<ul>
<li><a href="http://www.newartisans.com/software/readylisp.html">Ready Lisp: Common Lisp for Mac OS X</a></li>
<li><a href="http://www.gigamonkeys.com/book/">Practical Common Lisp</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2008/11/26/real-world-lisp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>London Perl Workshop &#8211; 29th November</title>
		<link>http://www.glenscott.co.uk/blog/2008/11/21/london-perl-workshop-29th-november/</link>
		<comments>http://www.glenscott.co.uk/blog/2008/11/21/london-perl-workshop-29th-november/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 11:36:08 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[london]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/?p=240</guid>
		<description><![CDATA[The London Perl Workshop is a free one-day conference in central London, UK. It will be held on Saturday the 29th of November, 2008 at Westminster University&#8217;s New Cavendish Campus I&#8217;ll be attending, and so will my friend and fellow Yahoo Mike Whitaker, who will be presenting some talks on Moose and Enlightened Perl. London [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>The London Perl Workshop is a free one-day conference in central London, UK. It will be held on Saturday the 29th of November, 2008 at Westminster University&#8217;s New Cavendish Campus</p></blockquote>
<p>I&#8217;ll be attending, and so will my friend and fellow Yahoo <a href="http://conferences.yapceurope.org/lpw2008/user/2747">Mike Whitaker</a>, who will be presenting some talks on <a href="http://www.iinteractive.com/moose/">Moose</a> and <a href="http://www.enlightenedperl.org/index.html">Enlightened Perl</a>.</p>
<ul>
<li><a href="http://conferences.yapceurope.org/lpw2008/index.html">London Perl Workshop</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2008/11/21/london-perl-workshop-29th-november/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simplicity does not precede complexity, but follows it</title>
		<link>http://www.glenscott.co.uk/blog/2008/11/17/simplicity-does-not-precede-complexity-but-follows-it/</link>
		<comments>http://www.glenscott.co.uk/blog/2008/11/17/simplicity-does-not-precede-complexity-but-follows-it/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 13:13:43 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[epigrams]]></category>
		<category><![CDATA[wise]]></category>
		<category><![CDATA[wisom]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/?p=234</guid>
		<description><![CDATA[Wise words taken from a list of programming epigrams from 1982: Epigrams on Programming]]></description>
			<content:encoded><![CDATA[<p>Wise words taken from a list of programming epigrams from 1982:</p>
<p><a href="http://www-pu.informatik.uni-tuebingen.de/users/klaeren/epigrams.html">Epigrams on Programming</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2008/11/17/simplicity-does-not-precede-complexity-but-follows-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wise Words from Martin Fowler</title>
		<link>http://www.glenscott.co.uk/blog/2008/10/28/wise-words-from-martin-fowler/</link>
		<comments>http://www.glenscott.co.uk/blog/2008/10/28/wise-words-from-martin-fowler/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 22:16:38 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[martinfowler]]></category>
		<category><![CDATA[phpunit]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/?p=207</guid>
		<description><![CDATA[I&#8217;ve become quite obsessive about unit testing recently, and in particular the PHPUnit testing framework. A big proponent of test-driven development is Martin Fowler, and I keep one of his quotes in a sticky note on my desktop as a little reminder: Whenever you are tempted to type something into a print statement or a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve become quite obsessive about unit testing recently, and in particular the <a href="http://phpunit.de/">PHPUnit testing framework</a>.  A big proponent of test-driven development is <a href="http://www.martinfowler.com/">Martin Fowler</a>, and I keep one of his quotes in a sticky note on my desktop as a little reminder:</p>
<blockquote><p>Whenever you are tempted to type something into a print statement or a debugger expression, write it as a test instead.</p></blockquote>
<p>The PHPUnit manual is really well written, and contains a great guide for <a href="http://www.phpunit.de/manual/3.3/en/writing-tests-for-phpunit.html">writing your first tests.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2008/10/28/wise-words-from-martin-fowler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New BBEdit Search and Replace Window</title>
		<link>http://www.glenscott.co.uk/blog/2008/10/14/new-bbedit-search-and-replace-windows/</link>
		<comments>http://www.glenscott.co.uk/blog/2008/10/14/new-bbedit-search-and-replace-windows/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 12:03:59 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[bbedit]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[editing]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/?p=165</guid>
		<description><![CDATA[One of the new features of BBEdit 9 is the new Find/Replace Window, shown below: It&#8217;s been simplified a lot since the last version, but the really big change is that it is now a modeless window. This means that the Find/Replace window can be left open whilst still allowing interaction with document windows. Initially, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the new features of <a href="http://www.barebones.com/products/bbedit/">BBEdit 9</a> is the new Find/Replace Window, shown below:</p>
<p><a href="http://www.glenscott.co.uk/images/bbedit-search-replace.png"><img src="http://www.glenscott.co.uk/images/bbedit-search-replace_m.png" alt="BBEdit search and replace window" style="margin: 10px;" /></a></p>
<p>It&#8217;s been simplified a lot since the last version, but the really big change is that it is now a modeless window.  This means that the Find/Replace window can be left open whilst still allowing interaction with document windows.  Initially, this seemed like a good feature to me before I realised a side-effect of this change:  <em>there are no keyboard shortcuts for the Find/Replace options anymore</em>.  You can see the difference by looking at the old Find/Replace window:</p>
<p><a href="http://www.glenscott.co.uk/images/textwrangler-search-replace.png"><img src="http://www.glenscott.co.uk/images/twrangler-search-replace_m.png" alt="BBEdit search and replace window" style="margin: 10px;" /></a></p>
<p>In this example, the <strong>Command</strong> key is being held down to illustrate which shortcuts are available;  for example, Command-G toggles the Grep support.  </p>
<p>Because of the Modeless window, these shortcuts have been lost in BBEdit 9.  This makes the Find/Replace window slightly more cumbersome to use as turning on search options now requires the mouse.  Furthermore, the very useful <strong>Start At Top</strong> option, has been removed completely.</p>
<p><strong>Update:</strong>  Thanks to Rich Siegel, CEO of Bare Bones Software, who has pointed me towards the <a href="http://www.barebones.com/support/bbedit/arch_bbedit9.html">release notes</a> which document some brand-new Find shortcuts, thus rendering this blog post mostly pointless.  Hurrah!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2008/10/14/new-bbedit-search-and-replace-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Singletons and global state</title>
		<link>http://www.glenscott.co.uk/blog/2008/08/27/singletons-and-global-state/</link>
		<comments>http://www.glenscott.co.uk/blog/2008/08/27/singletons-and-global-state/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 07:32:03 +0000</pubDate>
		<dc:creator>Glen</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[singletons]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.glenscott.co.uk/?p=141</guid>
		<description><![CDATA[A very useful article from Google&#8217;s MiÅ¡ko Hevery about the problems with the Singleton design pattern. Essentially, Singleton&#8217;s rely on a global instance variable which could point to any number of other variables, thus creating a global state. This causes problems when you want to test your code. Root Cause of Singletons Top 10 things [...]]]></description>
			<content:encoded><![CDATA[<p>A very useful article from Google&#8217;s MiÅ¡ko Hevery about the problems with the Singleton design pattern.  Essentially, Singleton&#8217;s rely on a global instance variable which could point to any number of other variables, thus creating a global state.  This causes problems when you want to test your code.</p>
<ul>
<li><a href="http://misko.hevery.com/2008/08/25/root-cause-of-singletons/">Root Cause of Singletons</a></li>
<li><a href="http://misko.hevery.com/2008/07/30/top-10-things-which-make-your-code-hard-to-test/">Top 10 things which make your code hard to test</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.glenscott.co.uk/blog/2008/08/27/singletons-and-global-state/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

