<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>Programming languages, patterns, life hacking</description><title>pl patterns</title><generator>Tumblr (3.0; @plpatterns)</generator><link>https://plpatterns.com/</link><item><title>Code Must Be Fluid</title><description>&lt;p&gt;&lt;a href="http://flickr.com/photos/26955787@N02"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure class="tmblr-full" data-orig-height="334" data-orig-width="500"&gt;&lt;img src="https://64.media.tumblr.com/bc33b838b5798c71cea461aa08bcf762/fc33657cc4337f74-d4/s540x810/4b064226e68b67ac74b91f0e583b128c0e562b03.jpg" alt="water" style="width: 400px; height: 267px;" data-orig-height="334" data-orig-width="500"/&gt;&lt;/figure&gt;



&lt;p&gt;The first law of software &amp;ndash; and life &amp;ndash; is change.&lt;/p&gt;

&lt;p&gt;It doesn&amp;rsquo;t matter how easy a programming language or tool makes things.  If your code isn&amp;rsquo;t fluid &amp;ndash; if your data and algorithms can&amp;rsquo;t flow between components &amp;ndash; you will always run into problems.&lt;/p&gt;</description><link>https://plpatterns.com/post/2301932002</link><guid>https://plpatterns.com/post/2301932002</guid><pubDate>Mon, 13 Dec 2010 12:09:00 -0500</pubDate></item><item><title>Do You Remember the Time...?</title><description>&lt;p&gt;&lt;a href="http://weheartit.com/entry/5023394"&gt;&lt;img src="https://64.media.tumblr.com/tumblr_lc411m5zW91qz7xyj.jpg" alt="unicorns"/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Do you remember the time we went for ice cream?&lt;/p&gt;

&lt;p&gt;We tend to believe that when we remember something, it&amp;rsquo;s because that something actually happened in the past.  When I remember walking to get ice cream this afternoon, I believe I actually did get ice cream this afternoon.  But the reason I believe that, is because of memory.  In other words, we use memory to justify the validity of memory &amp;ndash; a circular argument if I&amp;rsquo;ve ever seen one.&lt;/p&gt;

&lt;p&gt;For example, I want to remember the web address &amp;ldquo;plpatterns.com&amp;rdquo;.  When I get home from work, I want to be able to type that address into my browser.  To try to prove that I remember the address correctly, I write it down on a piece of paper and put it in my pocket.  So now, when I get home, I type in the address that I remember: plpatterns.com.  But wait, is my memory accurate?  Is the address that I remember actually the one I saw earlier in the day?  To find out, I can compare the address I remember against the one I wrote down on the piece of paper in my pocket.  Look, they match!  Therefore, my memory is accurate.  When I remember something, I can be reasonably confident that it did indeed happen.  &amp;hellip;Right?&lt;/p&gt;

&lt;p&gt;But wait&amp;hellip; How did I know that what I wrote down in my pocket is what I actually saw earlier that day?  Well, because I remember writing it down when I saw it.  And I&amp;rsquo;m certain that I didn&amp;rsquo;t change what I wrote on the paper or switch papers &amp;ndash; because I don&amp;rsquo;t remember doing that.  &amp;hellip;So I am essentially justifying my memory with other memories.  There is really no way to know that what I remember ever actually happened.  What I remember matches with what my friend remembers?  Great!  But that still doesn&amp;rsquo;t prove that what we remember actually happened, because any justification we use is based on other memories accurately representing what happened.&lt;/p&gt;

&lt;p&gt;What are the implications of all this?  Essentially, these things occasionally pop into my mind, like thoughts, but for some reason that I can&amp;rsquo;t prove, I compulsively believe that they represent things that I did before, saw before, heard before, said before.  In fact, the entire concept of time is based on this belief that I can remember, with some amount of accuracy, what the Universe looked like &lt;em&gt;before&lt;/em&gt;.  And it&amp;rsquo;s all based on these things that pop into my mind &amp;ndash; which we call &amp;ldquo;memories&amp;rdquo; &amp;ndash; that I have absolutely no justification for.&lt;/p&gt;

&lt;p&gt;Every time you remember something, you&amp;rsquo;re recalling it now.  Right now.  Every time you imagine what will happen in the future, you&amp;rsquo;re imagining it now.  Right now.  Nothing ever happens at any time other than now.&lt;/p&gt;

&lt;p&gt;In the movie &lt;em&gt;Blade Runner&lt;/em&gt;, we&amp;rsquo;re provoked to question who we are based on the idea that our memories might not be ours.  But it&amp;rsquo;s &lt;em&gt;much&lt;/em&gt; more drastic than that.  You don&amp;rsquo;t need a futuristic city with androids running around.  You just have to look, right now, and see for yourself through your own first-hand direct experience &amp;ndash; that any time other than now is a made-up mental construct.  A figment of your imagination.&lt;/p&gt;</description><link>https://plpatterns.com/post/1619025894</link><guid>https://plpatterns.com/post/1619025894</guid><pubDate>Fri, 19 Nov 2010 10:02:13 -0500</pubDate></item><item><title>Notes from Rich Hickey's Keynote at ClojureConj</title><description>&lt;p&gt;&lt;em&gt;I greatly appreciate being around inspiring people.  This weekend I was fortunate enough to be around many inspiring people at &lt;a href="http://first.clojure-conj.org/"&gt;ClojureConj&lt;/a&gt;, the kind of people who question their reality, not just their programming tools.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When was the last time you spent an entire hour thinking about a problem?&lt;br/&gt;
- a day&lt;br/&gt;
- a month&lt;/p&gt;

&lt;p&gt;Practice to be good at something.&lt;/p&gt;

&lt;p&gt;Problem Solving&lt;br/&gt;
1. What is the problem?&lt;br/&gt;
   - out loud&lt;br/&gt;
   - written&lt;br/&gt;
2. Understand the problem&lt;br/&gt;
   - what do you know?&lt;br/&gt;
   - what don&amp;rsquo;t you know?&lt;br/&gt;
   - are there related problems?&lt;br/&gt;
3. Be discerning&lt;br/&gt;
   - problems in your own solution?&lt;br/&gt;
   - what tradeoffs?&lt;br/&gt;
   - read in and around your space&lt;br/&gt;
   - explore multiple options to say what tradeoffs were&lt;/p&gt;

&lt;p&gt;Focus - &amp;ldquo;On the hammock, no one knows you&amp;rsquo;re not sleeping.&amp;rdquo;&lt;/p&gt;

&lt;p&gt;Use waking mind time to feed work to background mind.&lt;/p&gt;

&lt;p&gt;Loading&lt;br/&gt;
- Mind can juggle 7+/-2 things.&lt;br/&gt;
- When more, write it down.&lt;br/&gt;
- Go over in different order.  Load in different combinations.&lt;br/&gt;
- Have no-input receptive time.&lt;/p&gt;

&lt;p&gt;Wait&lt;br/&gt;
- at least overnight, sober&lt;br/&gt;
- sometimes months&lt;br/&gt;
- work on more than one thing&lt;br/&gt;
- not interleaved within a day, but over the course of time&lt;br/&gt;
- switch when stuck&lt;/p&gt;

&lt;p&gt;Try it&lt;br/&gt;
- Get feedback&lt;br/&gt;
- Evidence may show that assumptions were wrong&lt;/p&gt;

&lt;p&gt;You will be wrong&lt;br/&gt;
- You will think of better ideas&lt;br/&gt;
- Input facts change&lt;br/&gt;
- You&amp;rsquo;ll make mistakes&lt;br/&gt;
- It&amp;rsquo;s okay&lt;/p&gt;

&lt;p&gt;When you read something, and you know that&amp;rsquo;s bogus, that&amp;rsquo;s positive!&lt;/p&gt;

&lt;p&gt;&amp;ldquo;The beautiful thing about ideas is that they don&amp;rsquo;t have feelings.&amp;rdquo;&lt;br/&gt;
- If you have implemented a bad idea, you start to not like it.&lt;br/&gt;
- Detachment is natural.&lt;br/&gt;
- Why would you want to keep around a bad idea?&lt;br/&gt;
- Get rid of it.  It&amp;rsquo;s not a child.  It doesn&amp;rsquo;t have feelings.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Update 2010-10-27&lt;/em&gt;: Stumbled on &lt;a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;amp;location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Frichpub%2Flistmania%2Ffullview%2FR3LG3ZBZS4GCTH%3Fie%3DUTF8%26ref_%3Dcm_lmt_DYNA_f_2_russss2&amp;amp;tag=plpatterns-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=390957"&gt;Rich Hickey&amp;rsquo;s Clojure Bookshelf&lt;/a&gt; full of books about advanced programming topics, plus a &lt;a href="http://www.amazon.com/gp/product/B002DEO458?ie=UTF8&amp;amp;tag=plpatterns-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B002DEO458"&gt;hammock&lt;/a&gt;.&lt;/p&gt;</description><link>https://plpatterns.com/post/1398810577</link><guid>https://plpatterns.com/post/1398810577</guid><pubDate>Mon, 25 Oct 2010 11:38:00 -0400</pubDate><category>ClojureConj</category></item><item><title>"Studying history helps you predict the future by teaching you which things are old enough to be..."</title><description>“Studying history helps you predict the future by teaching you which things are old enough to be permanent.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://twitter.com/paulg/status/23203210182"&gt;Paul Graham&lt;/a&gt;&lt;/em&gt;</description><link>https://plpatterns.com/post/1168233530</link><guid>https://plpatterns.com/post/1168233530</guid><pubDate>Wed, 22 Sep 2010 14:54:43 -0400</pubDate></item><item><title>Every time you use CSS, you're doing Aspect-Oriented Programming </title><description>&lt;p&gt;Each AOP term and its HTML/CSS counterpart&amp;hellip;&lt;/p&gt;

&lt;p style="display: none;"&gt;&lt;i&gt;If you&amp;rsquo;re viewing this in your Dashboard, you may need to &lt;a href="http://plpatterns.com/post/482063133/every-time-you-use-css-youre-doing-aspect-oriented"&gt;click through&lt;/a&gt; to see this table.&lt;/i&gt;&lt;/p&gt;

&lt;table cellspacing="0"&gt;
&lt;tr&gt;
&lt;th style="padding: 2px 5px;"&gt;AOP&lt;/th&gt;&lt;th style="padding: 2px 5px;"&gt;HTML/CSS&lt;/th&gt;&lt;th style="padding: 2px 5px; width: 50%;"&gt;explanation&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;join point&lt;/td&gt;&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;every HTML element&lt;/td&gt;&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;places you could possibly apply behavior&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;pointcut&lt;/td&gt;&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;CSS selector (e.g. &lt;code&gt;#nav span.highlight&lt;/code&gt;)&lt;/td&gt;&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;expression that specifies which places to apply behavior&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;advice&lt;/td&gt;&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;CSS declarations (e.g. &lt;code&gt;color: blue; margin: 1em;&lt;/code&gt;)&lt;/td&gt;&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;what behavior to apply&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;aspect&lt;/td&gt;&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;logical grouping of CSS statements (selectors + declarations), sometimes separated into its own .css file&lt;/td&gt;&lt;td style="padding: 2px 5px; border-top: 1px solid; vertical-align: top;"&gt;module that groups the combination of what behaviors to apply and where to apply them that logically has to do with the same thing/feature (i.e. have the same concern)&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;Once you start spending a lot of time writing HTML and CSS, you start to see patterns.  Groups of CSS rules that you re-use all the time.  CSS classes can be used as functions.&lt;/p&gt;

&lt;p&gt;Instead of saying:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;div st­yle="clear: both"&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;hellip; you can define a clear class &amp;hellip;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;.clear {
  clear: both;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&amp;hellip; and then say &amp;hellip;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;div class="clear"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;At first, this might not seem like it saves a lot, but depending on your site, the patterns may be bigger.  For example, when I was working with &lt;a href="http://chapambrose.com/"&gt;Chap Ambrose&lt;/a&gt;, I discovered he used a class called float_left all over.  I immediately assumed it applied the single rule &amp;ldquo;float: left&amp;rdquo;, so I began using it too.  However, I got frustrated when I realized the &amp;ldquo;float_left&amp;rdquo; class applied &lt;em&gt;two&lt;/em&gt; rules:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;.float_left {
  float: left;
  margin-right: 1em;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Eventually, though, by spending more time writing HTML/CSS, it became obvious to me that a &lt;em&gt;lot&lt;/em&gt; of the time, when I want to float something, I also don&amp;rsquo;t want the things next to it bumping up against it.  I want there to be a margin.  And so the pattern (or function) is born.&lt;/p&gt;

&lt;h4&gt;So What about Aspect-Oriented Programming?&lt;/h4&gt;

&lt;p&gt;A group of CSS rules is essentially a function.  (They even use the same curly-brace and semicolon syntax.)  But with CSS, you actually don&amp;rsquo;t have to explicitly call a function to use it.  Where you define the CSS rules (or function), you can use a selector instead of a class name which injects the behavior where you want it.  The advantage is that you never have to explicitly reference the CSS rules where they&amp;rsquo;re used &amp;ndash; i.e. you never have to explicitly call the function.&lt;/p&gt;

&lt;p&gt;When you write the following CSS statement, you&amp;rsquo;re injecting the behavior of the rules into your entire site, without touching the code that&amp;rsquo;s already there.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;form h1 {
  font-size: 15px;
  color: blue;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Suddenly, all h1 tags inside forms have this behavior, even though none of them reference this &amp;ldquo;function&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;Aspect-oriented programming is the most misunderstood programming paradigm.  But fundamentally, the reason it exists is the same reason CSS exists &amp;ndash; to better separate concerns in your code.&lt;/p&gt;</description><link>https://plpatterns.com/post/482063133</link><guid>https://plpatterns.com/post/482063133</guid><pubDate>Mon, 29 Mar 2010 13:35:00 -0400</pubDate></item><item><title>To die without your love knowing how you really feel...</title><description>&lt;p&gt;&amp;hellip;must be the worst fate imaginable.

&lt;a href="http://www.photosight.ru/photos/3313105/"&gt;&lt;figure class="tmblr-full" data-orig-height="333" data-orig-width="499"&gt;&lt;img src="https://64.media.tumblr.com/cb1f2689b71f117f2c14cb86aeda4f3f/5cd6a9618bf97894-df/s540x810/fcc8adef8b664c869bd41194e9709bfbf6c540b7.jpg" style="height: 266px; width: 400px;" data-orig-height="333" data-orig-width="499"/&gt;&lt;/figure&gt;&lt;/a&gt;

Question: How do you communicate how you really feel?  How do you let your love know that she is loved?  Really loved.  You know you love her&amp;hellip; but does she really get it?

I struggled with these questions for a long time.  Being naturally bad at communicating due to [programmers&amp;rsquo; Asperger&amp;rsquo;s](&lt;a href="http://www.joelonsoftware.com/items/2004/08/20.html"&gt;http://www.joelonsoftware.com/items/2004/08/20.html&lt;/a&gt;) didn&amp;rsquo;t help.  Last year, though, I stumbled on [_The Five Love Languages_](&lt;a href="http://www.amazon.com/gp/product/1881273105?ie=UTF8&amp;amp;tag=plpatterns-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1881273105"&gt;http://www.amazon.com/gp/product/1881273105?ie=UTF8&amp;amp;tag=plpatterns-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1881273105&lt;/a&gt;).

The premise of the book is that there are concrete ways to communicate love and appreciation for another person (all forms of it, not necessarily romantic).  The author gives many examples and shows a pattern among them.  The ways to communicate love can be grouped into 5 categories, each embodying a &amp;ldquo;love language&amp;rdquo;.

&lt;/p&gt;

&lt;div style="float: right; position: relative; top: 27px;"&gt;&lt;a href="http://www.amazon.com/gp/product/1881273105?ie=UTF8&amp;amp;tag=plpatterns-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1881273105"&gt;&lt;figure data-orig-height="110" data-orig-width="73"&gt;&lt;img src="https://64.media.tumblr.com/0bfd6076d3509001c595004c8ac9a411/5cd6a9618bf97894-15/s540x810/7299f9a08219054ecfbd0ed9b87b91331562a041.jpg" data-orig-height="110" data-orig-width="73"/&gt;&lt;/figure&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;According to Chapman, the 5 languages are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Words of Affirmation&lt;/li&gt;
&lt;li&gt;Quality Time&lt;/li&gt;
&lt;li&gt;Gifts&lt;/li&gt;
&lt;li&gt;Acts of Service&lt;/li&gt;
&lt;li&gt;Physical Touch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of a time in your life when you &lt;em&gt;really&lt;/em&gt; felt loved.  That one time&amp;hellip; Was it when someone told you were &lt;em&gt;great&lt;/em&gt; at something you thought you were lousy at?  Was it when you hung out together at the bus station because the bus was late, and ended up talking for hours?  Was it the time years ago that you received a gift, that maybe wasn&amp;rsquo;t expensive, but meant so much to you that you cherish it to this day?  Was it the time someone trudged out in the pouring rain for you, so you didn&amp;rsquo;t have to?  Or was it the time someone embraced you, at just the right moment?&lt;/p&gt;

&lt;p&gt;We naturally try to give what we think is valuable.  But the more I learn about other people, the more I learn that &lt;em&gt;different people are different&lt;/em&gt;.  They value different things.  They think differently.  They perceive the world differently.&lt;/p&gt;

&lt;p&gt;If you really care about someone, &lt;a href="http://headrush.typepad.com/creating_passionate_users/2005/01/users_shouldnt_.html"&gt;give them what &lt;em&gt;they&lt;/em&gt; want&lt;/a&gt;, not what you wish others would give you.&lt;/p&gt;

&lt;p&gt;This is quite possibly the &lt;em&gt;only&lt;/em&gt; book I have ever read that I think would be valuable for &lt;em&gt;any&lt;/em&gt; person on the planet.  Maybe how to communicate love is obvious to some people, but it was never obvious to me.&lt;/p&gt;</description><link>https://plpatterns.com/post/362019995</link><guid>https://plpatterns.com/post/362019995</guid><pubDate>Sat, 30 Jan 2010 17:31:06 -0500</pubDate></item><item><title>It's hard to change a little.  It's much easier to change a lot.</title><description>&lt;p&gt;When you try to change a little, your old mindset still has its old values and attachments, and you inevitably slide back into your old groove.  But when you change enough to create a new mindset, you can free yourself from your old way of looking at things and create a _new_ groove.

&lt;/p&gt;

&lt;div style="text-align: center;"&gt;
&lt;a href="http://www.flickr.com/photos/kaiserskustoms/3693584614/"&gt;&lt;figure class="tmblr-full" data-orig-height="500" data-orig-width="375"&gt;&lt;img src="https://64.media.tumblr.com/36a355b3d9aaa18f68608a9b25e2cc25/a5d779883d087881-9d/s540x810/9422a412abf2a4f3f5e9c84b2f137138793dbb80.jpg" alt="rut" data-orig-height="500" data-orig-width="375"/&gt;&lt;/figure&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Homer Simpson&amp;rsquo;s ass groove comes to mind.  Moving over a few inches would be painful at best.  Moving across the couch to a new cushion would be like starting fresh.  The mind and habits work the same way.&lt;/p&gt;

&lt;p&gt;This has happened to me a number of times.&lt;/p&gt;

&lt;h4&gt;Waking Up Earlier&lt;/h4&gt;

&lt;p&gt;For years I tried to wake up about 30 minutes earlier than my regular routine.  It would work for a while, but then I&amp;rsquo;d inevitably start waking up later and later until I reached my regular schedule.  However, when I got a new job that required me to wake up 2 hours earlier, sure it was tough at first, like adjusting to jet lag, but it became my &lt;em&gt;new&lt;/em&gt; routine.  And I&amp;rsquo;ve had no problems consistently waking up 2 hours earlier than my old routine.&lt;/p&gt;

&lt;h4&gt;CVS/Subversion -&amp;gt; Distributed Version Control&lt;/h4&gt;

&lt;p&gt;I used to use CVS for version control at work.  For a small project, a co-worker and I tried using Mercurial.  On the surface, Mercurial is very similar to CVS, and it was very easy as a CVS user to just pick up Mercurial and get started using it.  It ended up being nice, but we perceived it as CVS + local commits and a few other &amp;ldquo;neat&amp;rdquo; features.  Nothing game-changing.  Months go by and I decide to give distributed version control another shot.  This time I tried git.  Git is so different from CVS that I was forced to literally stop what I was doing and learn git.  This seemed bad, but it forced me to change how I thought about version control.  I used to think of version control as something that was akin to writing in stone because it was expensive and could never be changed.  However, now I see everything as patches, and patches are cheap, can be applied, rolled back, and re-ordered.  A completely different mindset.  Now I&amp;rsquo;m hooked on distributed version control and couldn&amp;rsquo;t live without it.&lt;/p&gt;

&lt;h4&gt;Imperative Programming -&amp;gt; Functional Programming&lt;/h4&gt;

&lt;p&gt;People I have known who tried learning functional programming using a language that supports functional features but allows falling back on imperative loops and statements&amp;hellip; they end up never really getting it because they inevitably fall back on their old imperative ways.  When I was taught functional programming at Carnegie Mellon, it was mandated that we use Standard ML without any assignment statements (i.e. no references).  I was completely lost for the first couple weeks, but after a certain point, it clicked &amp;ndash; and from then on, I have been thinking functionally ever since.&lt;/p&gt;

&lt;p&gt;So if you want to change how you think about something, in the long-run it&amp;rsquo;s hard to change a little; it&amp;rsquo;s much easier to change a lot.&lt;/p&gt;</description><link>https://plpatterns.com/post/307982918</link><guid>https://plpatterns.com/post/307982918</guid><pubDate>Wed, 30 Dec 2009 08:57:04 -0500</pubDate></item><item><title>Robot Visions</title><description>&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0451450647?ie=UTF8&amp;amp;tag=plpatterns-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0451450647"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;figure data-orig-height="160" data-orig-width="97"&gt;&lt;img src="https://64.media.tumblr.com/45455d0b47a9a26fe9cd61fd20c9ff6f/1fe5cf99c7e0bfa2-9c/s540x810/bf900d7fd08ca25ca6b3baeedaba82cccf476087.jpg" alt="" style="float: left; margin: 0 10px 5px 0;" data-orig-height="160" data-orig-width="97"/&gt;&lt;/figure&gt;

&lt;p&gt; When I was a kid, barely old enough to read, I saw this book &lt;a href="http://www.amazon.com/gp/product/0451450647?ie=UTF8&amp;amp;tag=plpatterns-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0451450647"&gt;&lt;i&gt;Robot Visions&lt;/i&gt;, by Isaac Asimov&lt;/a&gt; in the bookstores.  I poured over Ralph McQuarrie&amp;rsquo;s illustrations (long before I ever knew who he was) and wanted to read it more than anything else.&lt;/p&gt;

&lt;p&gt;Now, almost 20 years later, I discovered it in my uncle&amp;rsquo;s library &amp;ndash; the original hardcover edition &amp;ndash; and I&amp;rsquo;m finally reading it.  And &lt;a href="http://blog.penelopetrunk.com/2008/05/12/why-you-already-know-what-you-should-be-doing-next/"&gt;loving&lt;/a&gt; it!&lt;/p&gt;

&lt;p&gt;It is truly an exciting time.  Many predictions seemingly of the distant future are likely just around the corner.  Others, we must still dream about.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;It is my guess that the 21st century may see a society in which one-third of the population will be engaged in entertaining the other two-thirds.&lt;/p&gt;&lt;p&gt;And there are bound to be new forms of entertainment that one can now foresee only dimly.  Three-dimensional TV is easy to forecast.  And space may become a new arena for activity.  In near-zero gravity, for example, the manipulation of balls may produce far more complicated forms of tennis or soccer.  Ballet and even social dancing may become incredibly startling and require a new kind of coordination that&amp;rsquo;s delightful to watch, as it will be as easy to move up and down as it is to move forward and backward or left and right.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;We&amp;rsquo;re already beginning to see this &amp;ldquo;work as play&amp;rdquo; phenomenon.  People in my generation expect work to be &lt;a href="http://headrush.typepad.com/creating_passionate_users/2005/01/creating_playfu.html"&gt;fun&lt;/a&gt;.  When it&amp;rsquo;s not, they quit and do something else (or &amp;ldquo;bum around&amp;rdquo; as long as their funds allow it).  In fact, in my recent letter of &lt;a href="http://jonnytran.tumblr.com/post/269973462/its-official"&gt;resignation&lt;/a&gt;, I even stated that I was leaving &amp;ldquo;to pursue fun in the web startup world&amp;rdquo;.  I considered writing something more &amp;ldquo;professional&amp;rdquo;, but decided against it because I wanted to be honest.&lt;/p&gt;

&lt;p&gt;Experts in learning-theory like &lt;a href="http://twitter.com/KathySierra"&gt;Kathy Sierra&lt;/a&gt; are realizing that you can apply game-design to just about anything, making even the most tedious tasks fun.  After seeing this, there&amp;rsquo;s no reason to ever go back to the old way!&lt;/p&gt;

&lt;p&gt;For those who see patterns and the robotic nature of decision-making (like science-fiction writers), the future may not be as clear as the past, but it is just as obvious.&lt;/p&gt;</description><link>https://plpatterns.com/post/282705795</link><guid>https://plpatterns.com/post/282705795</guid><pubDate>Sun, 13 Dec 2009 23:27:38 -0500</pubDate></item><item><title>The Purpose</title><description>&lt;p&gt;I want to make software that people use.  I&amp;rsquo;m tired of making stuff that gets used by one person once a month.

&lt;a href="http://www.outdoor-photos.com/photo/25421.html"&gt;&lt;figure class="tmblr-full" data-orig-height="339" data-orig-width="500"&gt;&lt;img src="https://64.media.tumblr.com/1128e85fc8ec0fb6eca7b284b1f3c404/92445c0dc815364f-6f/s540x810/25016232559df289b7ca8d43cbacd81a3de24e1d.jpg" alt="Pathway to the Sun" style="width: 225px; height: 152px; float: right; margin: 0 0 5px 10px;" data-orig-height="339" data-orig-width="500"/&gt;&lt;/figure&gt;&lt;/a&gt;

The purpose of software ultimately boils down to one of these things:

* To help people work
* To entertain people
* To teach people
* To keep people safe
* _To help people pursue happiness_

Software can help people.  If it doesn&amp;rsquo;t, it hasn&amp;rsquo;t fulfilled its purpose.

I always tell people at work that my job as a developer is to remove myself from the process &amp;ndash; by replacing myself with software.  If I do that, I&amp;rsquo;ve created an asset for the company.  If I don&amp;rsquo;t, I&amp;rsquo;ve created a liability.

&lt;/p&gt;

&lt;hr class="footnote-separator"&gt;

&lt;p&gt;Related: &lt;a href="http://plpatterns.com/post/245231875/the-question"&gt;The Question&lt;/a&gt;&lt;br/&gt;
Photo by &lt;a href="http://jedzer.photosight.ru/"&gt;jedzer&lt;/a&gt;&lt;/p&gt;</description><link>https://plpatterns.com/post/265566464</link><guid>https://plpatterns.com/post/265566464</guid><pubDate>Tue, 01 Dec 2009 20:18:00 -0500</pubDate><category>Author's Favorites</category></item><item><title>The Question</title><description>&lt;p&gt;A skilled sculptor can form any shape. A skilled programmer can make any program. The only question is, what?

&lt;/p&gt;

&lt;div&gt;&lt;a href="http://www.flickr.com/photos/photoimage/3095082936/in/set-72157594489802655/"&gt;&lt;figure class="tmblr-full" data-orig-height="333" data-orig-width="500"&gt;&lt;img src="https://64.media.tumblr.com/9fc7dcbdd3c0119b1e0865262bbfff90/9a045df729be6369-7e/s540x810/6b6baceb5609b772afd02b631bca5dea47770096.jpg" alt="" style="width: 225px; height: 150px; float: right; margin: 0 0 5px 10px;" data-orig-height="333" data-orig-width="500"/&gt;&lt;/figure&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;I think this rings true with anyone who has spent 10 years in the field.  After a certain point, you start to realize, there&amp;rsquo;s nothing you couldn&amp;rsquo;t program.  Sure, there are challenges.  How do you get it to be fast enough?  How do you allow it to scale big enough?  But at the end of the day, after having faced challenging problems in the past and eventually overcoming them, you begin to realize that it&amp;rsquo;s no longer a matter of whether you can make it, but more&amp;hellip; what&amp;rsquo;s worth making in the first place?&lt;/p&gt;

&lt;p&gt;Paul Graham &lt;a href="http://www.paulgraham.com/13sentences.html"&gt;said&lt;/a&gt;, &amp;ldquo;Once you know what to make, it&amp;rsquo;s mere effort to make it, and most decent hackers are capable of that.&amp;rdquo;&lt;/p&gt;

&lt;div style="font-size: 150%; line-height: 120%; width: 50%; float: right; margin: 0 0 5px 10px;"&gt;&amp;ldquo;Every block of stone has a statue inside it and it is the task of the sculptor to discover it.&amp;rdquo; &lt;nobr&gt;&amp;ndash; Michelangelo&lt;/nobr&gt;&lt;/div&gt;

&lt;p&gt;No matter what your craft, after a certain amount of practice you become a master craftsman.  But the tradition of creating a masterpiece to cross the line from apprentice to master has faded away.&lt;/p&gt;

&lt;p&gt;Deep down, we who love the craft still want this.  And we wonder, what is worth making?&lt;/p&gt;

&lt;p&gt;The result of our work can either be that awful thing in the park no one wants to look at, but has to, or &lt;a href="http://images.google.com/images?q=Michelangelo's+David"&gt;David&lt;/a&gt;.&lt;/p&gt;

&lt;hr class="footnote-separator"&gt;

&lt;p&gt;Related: &lt;a href="http://plpatterns.com/post/265566464/the-purpose"&gt;The Purpose&lt;/a&gt;&lt;br/&gt;
Photo by &lt;a href="http://www.flickr.com/photos/photoimage/"&gt;jasontheaker&lt;/a&gt;.&lt;/p&gt;</description><link>https://plpatterns.com/post/245231875</link><guid>https://plpatterns.com/post/245231875</guid><pubDate>Sun, 15 Nov 2009 17:28:00 -0500</pubDate><category>Author's Favorites</category></item><item><title>Conrad Barski of lisperati.com gives a taste of his new (not yet...</title><description>&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://vimeo.com/9605639"&gt;Conrad Barski&lt;/a&gt; of &lt;a href="http://www.lisperati.com/"&gt;lisperati.com&lt;/a&gt; gives a taste of his new (not yet released) book, &lt;em&gt;Land of Lisp&lt;/em&gt;, at &lt;a href="http://groups.google.com/group/philly-lambda"&gt;Philly Lambda&lt;/a&gt;.  &lt;em&gt;On Lisp&lt;/em&gt; + Game Programming!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Update 11/19/2010&lt;/em&gt;: &lt;em&gt;Land of Lisp&lt;/em&gt; is out!  Get it &lt;a href="http://landoflisp.com/"&gt;here&lt;/a&gt;.&lt;/p&gt;</description><link>https://plpatterns.com/post/244324691</link><guid>https://plpatterns.com/post/244324691</guid><pubDate>Sat, 14 Nov 2009 22:39:00 -0500</pubDate></item><item><title>How to Convert a Local Branch in Git to a Remote SVN Branch</title><description>&lt;p&gt;This is a little more obscure git-svn recipe I derived today.  Thought I would share it.&lt;/p&gt;

&lt;p&gt;Basically, I was prototyping a new feature on a local branch in git.  Later, I decided I wanted to push that local branch into an svn branch so that my svn comrades could see it.  So I started with a local branch following svn trunk with purely fast-forward commits.  And the following did the trick.&lt;/p&gt;

&lt;p&gt;Create the svn branch.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;svn cp &amp;lt;url-to-svn-repo&amp;gt;/trunk &amp;lt;url-to-svn-repo&amp;gt;/branches/final-remote-name
git fetch        # Sync w/ remote svn repo.
git branch -r    # This should list final-remote-name.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Make a new local branch with your feature that follows the new svn branch.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git checkout local-feature-branch   # This is the local branch where your prototype feature is committed.
git checkout -b final-local-name    # This makes the local branch derived from your local feature branch that will eventually become the branch that tracks the remote svn branch.
git svn info     # This will say you are following trunk.
git rebase remotes/final-remote-name
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Verify.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git log         # All of your feature commits should be on top, followed by the commit that created the svn branch, followed by trunk commits.
git svn info    # This should now say you are following the svn branch, final-remote-name.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If everything looks good, push all your feature commits to the remote svn branch.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git svn dcommit
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can optionally delete the local feature branch that is following trunk, so you don&amp;rsquo;t use it by accident.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git branch -D local-feature-branch
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Basically all it amounts to is a rebase, with some svn trickery.&lt;/p&gt;

&lt;p&gt;So again, all together now&amp;hellip;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;svn cp &amp;lt;url-to-svn-repo&amp;gt;/trunk &amp;lt;url-to-svn-repo&amp;gt;/branches/final-remote-name
git fetch
git checkout local-feature-branch
git checkout -b final-local-name
git rebase remotes/final-remote-name
git log         # Check your commits.
git svn info    # Check you are following the svn branch.
git svn dcommit
git branch -D local-feature-branch    # Delete old local branch.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I hope someone finds this useful.&lt;/p&gt;

&lt;p&gt;Related: &lt;a href="http://stackoverflow.com/questions/192736/how-do-i-make-git-svn-use-a-particular-svn-branch-as-the-remote-repository"&gt;How do I make git-svn use a particular svn branch? - Stack Overflow&lt;/a&gt;&lt;/p&gt;</description><link>https://plpatterns.com/post/234334879</link><guid>https://plpatterns.com/post/234334879</guid><pubDate>Thu, 05 Nov 2009 18:24:00 -0500</pubDate></item><item><title>Blub by Convention (In Defense of Arc)</title><description>&lt;p&gt;The entire [Arc language](&lt;a href="http://paulgraham.com/arc.html"&gt;http://paulgraham.com/arc.html&lt;/a&gt;) is just a few Scheme macros.  &amp;hellip;Or so the criticism says.

I can&amp;rsquo;t use Common Lisp.  `mapcar`, `lambda`, `destructuring-bind`, etc.  These are things I use all the time, yet they have some of the longest, most unnecessary names.

Scheme is the Java of Lisps.  `define`, `begin`, `list-ref`, etc.  It was seemingly designed to be as descriptive as possible, and in doing so, also became as verbose as possible.

Yes, it&amp;rsquo;s true that I can redefine all those things.  But at that point I&amp;rsquo;ve created Arc.  So if you see the pain of using mapcar and list-ref, then in a nutshell, you see the need for Arc.  Period.

In the same way that Perl has functional programming features, but the community and conventions don&amp;rsquo;t use it that way, which means the libraries aren&amp;rsquo;t designed for functional code, hindering your use of it, so too are Common Lisp and Scheme hindering.  The conventions hinder the use of its full potential.

Lisp is potential.  Untapped potential.  Arc is an attempt at tapping it.

[&lt;figure class="tmblr-full" data-orig-height="500" data-orig-width="411"&gt;&lt;img src="https://64.media.tumblr.com/f3af1be9c5d1772dd443484ba002d775/62bb978bdef77c73-56/s540x810/67d5c6b29db371aa20aab9ff2bae555465a41393.jpg" alt="road" style="float: right; width: 206px; height: 250px; margin: 5px 0 5px 10px;" data-orig-height="500" data-orig-width="411"/&gt;&lt;/figure&gt;](&lt;a href="http://www.flickr.com/photos/19722425@N02/3890967883/"&gt;http://www.flickr.com/photos/19722425@N02/3890967883/&lt;/a&gt;)

The [blub paradox](&lt;a href="http://paulgraham.com/avg.html"&gt;http://paulgraham.com/avg.html&lt;/a&gt;) implies that once you truly get the features of Lisp &amp;ndash; first-class continuations, condition-signals and restarts, macros, serialization of code to syntactically valid code &amp;ndash; all the imitation features like function objects, exceptions, Ruby&amp;rsquo;s catch/throw, the C-preprocessor, and serialization to XML are&amp;hellip; disappointing at best.  Atrociously unusable at worst.  This is why Lisp is more powerful than non-Lisps.

But Arc is better than other Lisps because Lisp by definition is flexible.  And flexibility is a double-edged sword.  You can define anything to be anything &amp;ndash; both in a good way and a bad way.  Arc was specifically designed to pull out common patterns and be as concise as possible.  If it&amp;rsquo;s true that Arc is just a bunch of macros, then these macros that I would have had to define myself in Common Lisp or Scheme are part of the core language or conventions of Arc.  So instead of only me knowing about those macros, all Arc programmers know about them.

Code that does not follow a convention is more difficult to integrate with code that does, so much so, that the fact that libraries exist using a convention is a huge incentive to use the same convention.  Additionally, if I write code that does not follow the convention, people who maintain my code inevitably re-write it in their own image.  It happens slowly over time perhaps, but inevitably.  Every one of those names (mapcar, lambda, list-ref), and dozens more in the core language and standard libraries, is a kludge.  But if I redefined them, the first thing someone else touching my code would do is look at it, say &amp;ldquo;wtf!&amp;rdquo;, and delete my redefinitions and change everything back to the canonical use.  In Arc, on the other hand, instead of my code degrading to the conventions of Common Lisp over time as I move on and others take over my code, it holds the high caliber of the conventions of Arc.

However, if you actually succeed at changing all those kludge names in Common Lisp, you will have improved the language by an order of magnitude.  And when you improve something by an order of magnitude, you haven&amp;rsquo;t made something better, you&amp;rsquo;ve made something new.  (Hence, Arc is genuinely new.)

Basically, non-Lisps are blub compared to Lisp because they limit what you can abstract.  However, once you have a dialect of Lisp, there are so few visible barriers to abstraction.  Instead, non-Arc Lisps are blub compared to Arc because the conventions adopted by the community &amp;ndash; and lack of a ability to [change](&lt;a href="http://plpatterns.com/post/37655893/the-prototype-production-knob"&gt;http://plpatterns.com/post/37655893/the-prototype-production-knob&lt;/a&gt;) those conventions &amp;ndash; create barriers to flexibility, removing one of the very features that makes Lisp so great.

Put another way, non-Arc Lisps are blub by convention.  The macros that make Arc Arc are a big deal because they are an attempt to change the convention.

What I am getting at is:

1. Many languages could be better than they are if they used different conventions.
2. It&amp;rsquo;s damn-near impossible to go against the conventions.
3. Conventions are difficult to change, more of a way of thinking of the community.
4. It&amp;rsquo;s worthwhile to push good conventions into the core language/libraries, and if you do that, you&amp;rsquo;re essentially making something new.

This has little to do with Arc, except that Arc is an example where someone (Paul Graham) tried to do #4 because of 1 through 3.

&lt;/p&gt;

&lt;hr class="footnote-separator"&gt;

&lt;div class="credit"&gt;Photo by &lt;a href="http://www.flickr.com/photos/19722425@N02/"&gt;rachell&lt;/a&gt;.&lt;/div&gt;

&lt;div class="credit"&gt;Thanks to &lt;a href="http://asymmetrical-view.com/"&gt;Kyle Burton&lt;/a&gt; for helping develop the idea for this post.&lt;/div&gt;</description><link>https://plpatterns.com/post/231830654</link><guid>https://plpatterns.com/post/231830654</guid><pubDate>Tue, 03 Nov 2009 08:25:00 -0500</pubDate><category>PL Design</category></item><item><title>Alternative to XML Validation</title><description>&lt;p&gt;The desire to validate the structure of a document has come up a number of times recently.  Say you have a public service where one of its operations takes in a complicated tree-structured document.  You want a way to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;use a programming-language-agnostic data format for your document;&lt;/li&gt;
&lt;li&gt;formally specify the expected structure of the doc;&lt;/li&gt;
&lt;li&gt;validate that input to calls to your service actually follow the structure;&lt;/li&gt;
&lt;li&gt;and hopefully, allow clients to do this validation themselves, w/o hitting your service.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A well-known language-agnostic way of doing all this is with XML as your document format, an XML schema as your specification of the expected structure, and XML validation as the publicly known algorithm for validating.&lt;/p&gt;

&lt;p&gt;Having done some type-theory, I would much rather say that my data format is a data structure in a programming language, the spec of the structure is a type declaration, and validation is type-checking.&lt;/p&gt;

&lt;p&gt;So I&amp;rsquo;ve wondered, is there a solution to my problem 1 through 4 &amp;ndash; without using XML?&lt;/p&gt;

&lt;p&gt;A few well-known programming-language-agnostic data-formats are: s-expressions, JSON, YAML.  I have found &lt;a href="http://www.kuwata-lab.com/kwalify/"&gt;Kwalify&lt;/a&gt; for YAML, but not much else.&lt;/p&gt;

&lt;p&gt;This is a shame because people who believe they &lt;em&gt;might&lt;/em&gt; ever need 2 through 4, choose XML for 1 (pl-agnostic data format) simply because they don&amp;rsquo;t know of any alternatives.  This sucks because if all you are doing is 1, then you&amp;rsquo;ve made the worst choice for the job.&lt;/p&gt;

&lt;p&gt;XML sucks to read as a human b/c there is so much extra noise.  It gets to the point where the majority of your effort spent reading XML is filtering.  It also sucks to use in programming b/c the API is terrible.  XML doesn&amp;rsquo;t map perfectly to the data-structures in most languages, even Java, its biggest fan.&lt;/p&gt;

&lt;p&gt;So again, if all you&amp;rsquo;re using it for is 1 &amp;ndash; a programming-language-agnostic data format &amp;ndash; XML is one of the worst choices.  Yet, the fact that XML dominates in 2 through 4, it remains the default.&lt;/p&gt;</description><link>https://plpatterns.com/post/216523862</link><guid>https://plpatterns.com/post/216523862</guid><pubDate>Sun, 18 Oct 2009 15:44:00 -0400</pubDate></item><item><title>The unspoken truth about managing geeks</title><description>&lt;a href="http://www.computerworld.com/s/article/print/9137708/Opinion_The_unspoken_truth_about_managing_geeks"&gt;The unspoken truth about managing geeks&lt;/a&gt;: &lt;p&gt;Articulates the mindset of many developers.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;It’s not about being right for the sake of being right but being right for the sake of saving a lot of time, effort, money and credibility. IT is a team sport, so being right or wrong impacts other members of the group in non-trivial ways.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Truly insightful.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;IT pros would prefer to make a good decision than to get credit for it. What will make them seek credit is the danger that a member of the group or management who is dangerous to the process might receive the credit for the work instead.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thank you for stating this.  It’s the truth.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Unlike in many industries, the fight in most IT groups is in how to get things done, not how to avoid work. IT pros will self-organize, disrupt and subvert in the name of accomplishing work.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;… in fact, getting things done faster is the reason I started programming in the first place.&lt;/p&gt;

&lt;p&gt;We can all learn from articles like this.&lt;/p&gt;</description><link>https://plpatterns.com/post/184550261</link><guid>https://plpatterns.com/post/184550261</guid><pubDate>Thu, 10 Sep 2009 10:59:00 -0400</pubDate></item><item><title>Sending an IM via Gtalk in Clojure</title><description>&lt;p&gt;Email has its place, but when it comes to short notifications &amp;ndash; of the status of a job, for example &amp;ndash; IMs work great.&lt;/p&gt;

&lt;p&gt;If you think of your software as your co-worker &amp;ndash; someone you work with who helps you do your job &amp;ndash; all kinds of functionality just make sense.  Would you rather your co-worker emailed you or IMed you?  Then the software should do that.&lt;/p&gt;

&lt;p&gt;This code snippet sends an IM using Smack 3.1.0, a Jabber client library (Apache 2.0 license).&lt;br/&gt;
Download the &lt;a href="http://www.igniterealtime.org/downloads/index.jsp#smack"&gt;Smack jar&lt;/a&gt;.&lt;br/&gt;
Browse &lt;a href="http://www.igniterealtime.org/fisheye/browse/svn-org/smack/trunk/source/org/jivesoftware/smack"&gt;Smack source&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Note: you must invite the username to chat and confirm in Gmail before messages will get sent.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;user&amp;gt; (def conf (org.jivesoftware.smack.ConnectionConfiguration. "talk.google.com" 5222 "gmail.com"))
#'user/conf
user&amp;gt; (def con (org.jivesoftware.smack.XMPPConnection. conf))
#'user/con
user&amp;gt; (.connect con)
nil
user&amp;gt; (org.jivesoftware.smack.SASLAuthentication/supportSASLMechanism "PLAIN" 0)
nil
user&amp;gt; (.login con "my.username@gmail.com" "mypassword" "resource")
nil
user&amp;gt; (.isAuthenticated con)  ;; check that we are authenticated
true
user&amp;gt; (def chat (.createChat (.getChatManager con) "send.to.username@gmail.com" nil))  ;; this nil is the listener -- put something here to receive IMs!
#'user/chat
user&amp;gt; ;; Invite to chat in Gmail -- sending messages won't work w/o doing this!
nil
user&amp;gt; (.sendMessage chat "it works!")
nil
user&amp;gt; (.disconnect con)
nil&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Update: I created a &lt;a href="http://github.com/jtran/status/tree"&gt;project&lt;/a&gt; that uses this along with log4j, letting you pull a logger out of nowhere and send out status IMs.&lt;/p&gt;</description><link>https://plpatterns.com/post/169380277</link><guid>https://plpatterns.com/post/169380277</guid><pubDate>Sat, 22 Aug 2009 23:39:00 -0400</pubDate></item><item><title>If you would be ...</title><description>&lt;p&gt;Here&amp;rsquo;s something I&amp;rsquo;ve noticed recently: if you would be Xed, be Xable.&lt;/p&gt;

&lt;p&gt;A few concrete examples&amp;hellip;&lt;/p&gt;

&lt;p&gt;If you would be taught, be teachable.&lt;br/&gt;
If you would be understood, be understandable.&lt;br/&gt;
If your software would be used, make it be usable.&lt;/p&gt;

&lt;p&gt;And last but not least, the quote of Ovid that inspired it all: If you would be loved, be loveable.&lt;/p&gt;</description><link>https://plpatterns.com/post/159581722</link><guid>https://plpatterns.com/post/159581722</guid><pubDate>Mon, 10 Aug 2009 00:56:48 -0400</pubDate></item><item><title>Git Config</title><description>&lt;p&gt;Here&amp;rsquo;s the .gitconfig file I&amp;rsquo;ve been using.  The aliases let you type &amp;ldquo;git ci&amp;rdquo; and execute &amp;ldquo;git commit -v&amp;rdquo; for example.  And color is essential.  Going back to svn is like going back to black &amp;amp; white TV.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[user]
        email = you@blah.com
        name = Your Name
[color]
        ui = auto
        diff = auto
        status = auto
        interactive = auto
[alias]
        st = status
        au = add -u
        pt = add --patch
        ci = commit -v
        cia = commit -av
        br = branch
        co = checkout
        df = diff
        dfc = diff --cached
        dfw = diff --color-words
        lg = log -p
        spull = !git-svn fetch &amp;amp;&amp;amp; git-svn rebase --local
        spush = !git-svn dcommit
&lt;/code&gt;&lt;/pre&gt;</description><link>https://plpatterns.com/post/138535551</link><guid>https://plpatterns.com/post/138535551</guid><pubDate>Thu, 09 Jul 2009 14:43:00 -0400</pubDate></item><item><title>Setting Up Clojure</title><description>&lt;p&gt;Notes I made back in April for setting up Clojure on my MacBook.  &lt;a href="http://asymmetrical-view.com/2009/08/20/emacs-slime-remote-repl.html"&gt;Kyle&lt;/a&gt; is planning a &lt;a href="http://groups.google.com/group/philly-lambda/web/meetings"&gt;workshop&lt;/a&gt; on this soon.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# get Clojure and clojure-contrib library
cd ~/projects
svn checkout &lt;a href="http://clojure.googlecode.com/svn/trunk/"&gt;http://clojure.googlecode.com/svn/trunk/&lt;/a&gt; clojure
svn checkout &lt;a href="http://clojure-contrib.googlecode.com/svn/trunk/"&gt;http://clojure-contrib.googlecode.com/svn/trunk/&lt;/a&gt; clojure-contrib

# build Clojure
cd clojure
ant

# make a clojure executable on your path
echo 'java -cp ~/projects/clojure/clojure.jar clojure.lang.Repl' &amp;gt; ~/local/bin/clojure
chmod a+x ~/local/bin/clojure

# setup env
cd ~/projects
git clone git://github.com/mdelaurentis/env.git
cd env
git submodule update --init
cd
ln -s projects/ src
echo '(load-file (expand-file-name "~/projects/env/emacs/dot-emacs.el"))' &amp;gt;&amp;gt; .emacs

# slime and swank
cd projects/
git clone git://github.com/jochu/swank-clojure.git
git clone git://git.boinkor.net/slime.git&lt;/code&gt;&lt;/pre&gt;</description><link>https://plpatterns.com/post/128148601</link><guid>https://plpatterns.com/post/128148601</guid><pubDate>Mon, 22 Jun 2009 11:37:00 -0400</pubDate></item><item><title>Knowledge Representation</title><description>&lt;p&gt;When I write a program, what I&amp;rsquo;m essentially doing is writing down my best understanding of how to solve a problem or accomplish a task.  &lt;em&gt;My&lt;/em&gt; best understanding.&lt;/p&gt;

&lt;p&gt;For the sake of this discussion, let&amp;rsquo;s say the problem I&amp;rsquo;m trying to solve is how to best peel an orange for eating.&lt;/p&gt;

&lt;p&gt;An interesting thing happens, though, when I spend hours and hours talking about the problem, thinking about it, drawing diagrams of it on the whiteboard, relating it to other problems I&amp;rsquo;m familiar with, and coding it: I begin to understand the solution better.  But not only that, I begin to understand the problem and its entire domain better.&lt;/p&gt;

&lt;p&gt;With this deeper understanding of the domain, comes more precise terminology.  For example, in my study of orange peeling, I discover that when there is a breach in the skin, the juice squirts out when I put pressure on it.  But when the skin is perfectly intact, the juice doesn&amp;rsquo;t squirt out; it kind of oozes out from all over.  So I might call these spots on the orange &amp;ldquo;squirt points&amp;rdquo; and &amp;ldquo;ooze points&amp;rdquo; from now on.  But as soon as someone new to the domain of orange peeling hears the phrase &amp;ldquo;squirt point&amp;rdquo;, that person probably won&amp;rsquo;t know what I mean.&lt;/p&gt;

&lt;p&gt;To me, the same statement using the term &amp;ldquo;squirt point&amp;rdquo; is &lt;em&gt;much&lt;/em&gt; clearer than the one that says &amp;ldquo;the points on the orange where juice tends to squirt out when pressure is applied to the skin, usually implying there is a breach in the skin&amp;rdquo;, even though they technically mean the same thing.  Someone unfamiliar with the term, on the other hand, will probably think the exact opposite.&lt;/p&gt;

&lt;p&gt;Yes, the term &amp;ldquo;squirt point&amp;rdquo; is a reference to this longer, more descriptive definition, and it can just about always be replaced by its definition without changing the meaning of a sentence.  But the fact that I&amp;rsquo;m using the term has more information.  It means that when I say &amp;ldquo;squirt point&amp;rdquo; over here, and &amp;ldquo;squirt point&amp;rdquo; over there, I&amp;rsquo;m referring to the same exact thing.  What if over here I use the full definition inline, but over there, I use the full definition except I say &amp;ldquo;when pressure is applied to the &lt;em&gt;orange&lt;/em&gt;&amp;rdquo; instead of &amp;ldquo;when pressure is applied to the &lt;em&gt;skin&lt;/em&gt;&amp;rdquo;.  Is that the same thing?  Is it a mistake?  Did the person who wrote it (whether that be another physical person, or me years ago) actually mean to write &amp;ldquo;skin&amp;rdquo;?  On top of that, even if the full definition is used exactly alike in both places, it takes significantly more work for the human mind&amp;rsquo;s limited pattern matching ability to recognize that similarity, compared with the short term.&lt;/p&gt;

&lt;p&gt;We have to be careful though.  It&amp;rsquo;s not as simple as making a rule that says: everyone should always use the term.&lt;/p&gt;

&lt;p&gt;What if there are thousands of terms specific to this domain?  Does everyone seriously have to learn them all before writing a single thing about orange peeling?  What if there is a similar concept that overlaps 90%?  Should a new term be coined?  Or should the original term be modified?  Say I want to talk about the points on the orange that juice squirts out when pressure is applied &lt;em&gt;after&lt;/em&gt; the skin is already peeled.  It&amp;rsquo;s essentially the same as &amp;ldquo;squirt points&amp;rdquo;, where the orange&amp;rsquo;s skin is not present.  If I know the term &amp;ldquo;squirt point&amp;rdquo;, then I will be tempted to use that term, slightly modified.  But if I overload that term, essentially creating a new definition for it, I&amp;rsquo;ve just changed the meaning of every other thing that refers to it, whether that be pieces of writing, learning material, documentation, code references, project plans, issues, or even other people&amp;rsquo;s mental references to the term.&lt;/p&gt;

&lt;p&gt;In the worst case, I could have just broken something, making what made sense before no longer make sense.  Regardless, making the definition of a term more general implicitly makes everything that refers to it more complex, because in the more general version of &amp;ldquo;squirt point&amp;rdquo;, the fact that pressure is being apply to the skin is no longer contained within the term.  So when relevant (which itself may not always be clear), things referring to &amp;ldquo;squirt point&amp;rdquo; now must also say whether the skin is present or not.&lt;/p&gt;

&lt;p&gt;For those that haven&amp;rsquo;t already been doing this, I encourage you to imagine what happens with this discussion when you replace the word &amp;ldquo;term&amp;rdquo; with &amp;ldquo;function&amp;rdquo;, because this problem constantly arises when more than one person are involved in a software project.  Because developers are literally writing down &lt;em&gt;their&lt;/em&gt; understanding of the solution to the problem in code, the resulting software can only be as good as the developers&amp;rsquo; understanding of the problem domain.&lt;/p&gt;

&lt;p&gt;This means that if you are a developer, you should do everything in your power to understand everything about your problem domain.  Not just the specific task at hand, but the big picture where it all fits in.  Not just how to fulfill the requirements given to you, but what requirements were probably missed completely because the people writing the requirements have less understanding of certain domains related to software.&lt;/p&gt;

&lt;p&gt;But this also means that if you are running a company, and you are not a developer, you should do everything in your power to get the developers to understand everything about your problem domain &amp;ndash; because the software that they produce, can only be as good as their understanding.  If you simply give them requirements, they will do their best to interpret those requirements in the context of everything they understand (just like anyone else).  That isn&amp;rsquo;t enough.  There are 53.2 million ways to skin a cat.  You won&amp;rsquo;t get the way that you want unless in addition to saying what you want, you also say &lt;em&gt;why&lt;/em&gt; you want it.  This is essential for a developer.  Because every developer is a designer, whether they like it or not.  They are constantly making decisions that affect &lt;a href="http://plpatterns.com/post/55433565/techies-vs-the-business"&gt;the business&lt;/a&gt; as a whole.  If developers don&amp;rsquo;t understand why end-users want a feature, for example, it&amp;rsquo;s likely they will misjudge the importance of the feature and make an unacceptable &lt;a href="http://plpatterns.com/post/95573960/good-design-is-balance"&gt;trade-off&lt;/a&gt; in the design process.&lt;/p&gt;</description><link>https://plpatterns.com/post/108707434</link><guid>https://plpatterns.com/post/108707434</guid><pubDate>Sat, 16 May 2009 14:50:00 -0400</pubDate></item></channel></rss>
