<?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>while coding</title>
	<atom:link href="http://www.youell.com/matt/writing/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.youell.com/matt/writing</link>
	<description>simplify</description>
	<lastBuildDate>Sun, 25 Mar 2012 19:46:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Simple Rewrite (How I Code)</title>
		<link>http://www.youell.com/matt/writing/?p=84</link>
		<comments>http://www.youell.com/matt/writing/?p=84#comments</comments>
		<pubDate>Mon, 20 Feb 2012 02:58:05 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[How I Code]]></category>
		<category><![CDATA[humane]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=84</guid>
		<description><![CDATA[Note: I just found this unpublished post from a couple of years ago. I think I wanted to polish it a bit before publishing, but it looks fine to me now.

I&#8217;m taking another shot at the &#8220;How I Code&#8221; series of posts. This isn&#8217;t a preachy &#8220;How everyone should code&#8221; post. Instead, this is a [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: I just found this unpublished post from a couple of years ago. I think I wanted to polish it a bit before publishing, but it looks fine to me now.<br />
</em><br />
I&#8217;m taking another shot at the &#8220;How I Code&#8221; series of posts. This isn&#8217;t a preachy &#8220;How everyone should code&#8221; post. Instead, this is a snapshot of how I look at code now, at this point in time. Next week I could be doing things differently. </p>
<p>Here&#8217;s an example from Satchmo, the web shopping cart software that is built on the Django framework. A bug involving MySQL was recently patched in the Satchmo code base. The bug fix itself isn&#8217;t very interesting, but the remaining code is. Here&#8217;s the post-fix code:</p>
<pre class="syntax-highlight:python">
def payments_completed(self):
    q = self.payments.exclude(transaction_id__isnull = False, transaction_id = &quot;PENDING&quot;)
    result = [p for p in q if p.amount]
    return result
</pre>
<p>Naturally, I have questions.</p>
<p>Why does the &#8216;result&#8217; variable exist? </p>
<pre class="syntax-highlight:python">
def payments_completed(self):
    q = self.payments.exclude(transaction_id__isnull = False, transaction_id = &quot;PENDING&quot;)
    return [p for p in q if p.amount]
</pre>
<p>What are &#8216;p&#8217; and &#8216;q&#8217;?</p>
<pre class="syntax-highlight:python">
def payments_completed(self):
    query_set = self.payments.exclude(transaction_id__isnull = False, transaction_id = &quot;PENDING&quot;)
    return [payment for payment in query_set if payment.amount]
</pre>
<p>Would a non-programmer understand this?</p>
<pre class="syntax-highlight:python">
def payments_completed(self):
    payments = self.payments.exclude(transaction_id__isnull = False, transaction_id = &quot;PENDING&quot;)
    return [payment for payment in payments if payment.amount]
</pre>
<p>Don&#8217;t we already have a &#8216;payments&#8217; variable?</p>
<pre class="syntax-highlight:python">
def payments_completed(self):
	return self.payments.exclude(transaction_id__isnull = False, transaction_id = &quot;PENDING&quot;, amount__isnull = false)
</pre>
<p>I think that&#8217;s better. What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=84</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Quick Note About Wheeler</title>
		<link>http://www.youell.com/matt/writing/?p=835</link>
		<comments>http://www.youell.com/matt/writing/?p=835#comments</comments>
		<pubDate>Mon, 13 Feb 2012 09:38:27 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[wheeler]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=835</guid>
		<description><![CDATA[Several people have asked me over the past few months about the status of Wheeler, the programming language I&#8217;ve been working on. Wheeler is still alive, though it has been largely dormant since last summer. This has been the pattern since its inception: Long periods of dormancy and then short, furious bursts of development.
Wheeler is [...]]]></description>
			<content:encoded><![CDATA[<p>Several people have asked me over the past few months about the status of Wheeler, the programming language I&#8217;ve been working on. Wheeler is still alive, though it has been largely dormant since last summer. This has been the pattern since its inception: Long periods of dormancy and then short, furious bursts of development.</p>
<p>Wheeler is not a practical project. It is not intended as a better way forward, or as a better paradigm, or as an improvement in how we program. Wheeler&#8217;s sole purpose is to spark questions in your mind. If I am very, very lucky, Wheeler may inspire you to think a little differently about how you program.</p>
<p>Wheeler is a work of conceptual art. Like any art project, there is a vision, and there is also a muse. When the muse is present, things are good. Ideas flow. The path forward is clear. When the muse is absent, the path forward is blocked. I&#8217;ve tried to force it. I&#8217;ve tried to make the language reveal itself. That only made things worse.</p>
<p>With all of that said, there is plenty of work that can actively be done. I&#8217;ve been asked for some sort of tutorial and also for a roadmap. I&#8217;m working on both of these now. My hope is that I can accurately communicate my ideas to interested people and get some help bringing what I see in my head into reality.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=835</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Tale of Two Interviews, Part 2</title>
		<link>http://www.youell.com/matt/writing/?p=801</link>
		<comments>http://www.youell.com/matt/writing/?p=801#comments</comments>
		<pubDate>Thu, 05 Jan 2012 19:49:36 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[interviewing]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=801</guid>
		<description><![CDATA[(You probably want to read Part 1 if you haven&#8217;t already.)
Have you ever talked yourself out of applying for a job? Maybe you didn&#8217;t meet the specific requirements in the job ad. Maybe you were intimidated by the reputation of the company.
I did this. 
There was a job that I kept seeing. The two strikes [...]]]></description>
			<content:encoded><![CDATA[<p>(You probably want to read <a href="http://www.youell.com/matt/writing/?p=785">Part 1</a> if you haven&#8217;t already.)</p>
<p>Have you ever talked yourself out of applying for a job? Maybe you didn&#8217;t meet the specific requirements in the job ad. Maybe you were intimidated by the reputation of the company.</p>
<p>I did this. </p>
<p>There was a job that I kept seeing. The two strikes against it? </p>
<ol>
<li>It was a Ruby shop and I wasn&#8217;t a Ruby programmer</li>
<li>The CTO was a legend</li>
</ol>
<p>Those two things conspired to delay my application by a few months.</p>
<p>Around the time I was scheduling the interview with the company from <a href="http://www.youell.com/matt/writing/?p=785">Part 1</a>, I went ahead and applied to work at this little Ruby shop. I was pretty sure that I&#8217;d get a phone interview, but I honestly didn&#8217;t think I&#8217;d get much beyond that. But it would be fun to apply, and good experience.</p>
<p>I did end up getting that phone interview. This was about a week after the disastrous interview at the company from Part 1. This time it was a panel interview, over the phone, for 30 minutes. After the craziness I had with the previous phone screen I could imagine almost anything. I decided to put it out of my mind and just relax. If I didn&#8217;t know the answer to things, that was just the way it was going to be.</p>
<p>You would think that having seven people interview you over the phone would be stressful. Surprisingly it wasn&#8217;t. From the start it was clear that these were nice people. The interview consisted of them going around the room throwing me tech questions over the speakerphone. I wasn&#8217;t asked to code anything. The technical questions were fairly general. No gotcha questions. No brainteasers. It was clear they were just sketching me out as a developer. </p>
<p>Things were going pretty well when suddenly the phone went dead. I was 20 minutes into a great interview and Skype had failed me. Worse, I realized that I had inadvertently closed the wrong Skype window while listening, so it was <em>my fault</em>. I had their office number and called it, but got their switchboard. I had no idea how to get back in touch with these people. Lucky for me, they called me back. I answered and explained what had happened. They were very understanding and we continued the interview. </p>
<p>About 5 minutes later I heard Skype go &#8220;bloop&#8221;. That usually means the call is over. &#8220;Aww, fuck&#8221;, I groaned. I had cut myself off mid-answer. There was no way they were going to call me back <em>again</em>.</p>
<p>&#8220;What&#8217;s wrong?&#8221;, I heard in my headset. I was still connected! They were still there, listening&#8230; and concerned! The Skype bloop was the timeout of the outbound call I had made earlier. Ice was instantly in my veins. &#8220;Oh thank god!&#8221;, I said. &#8220;I thought I&#8217;d hung up on you guys again.&#8221; Laughter. Instead of completely screwing up the interview with my random profanity, they thought it was funny. </p>
<p>Skype snafus aside, I felt pretty good about the interview. Sure enough, I got an email the next day asking me to come in for&#8230; a 5-hour interview. They&#8217;d buy lunch.</p>
<p>Fuck.</p>
<p>At least these guys seem fun, I thought to myself. Worst case, I&#8217;d get another sandwich. And get some more practice at this suddenly-common style of interviewing.</p>
<p>I started analyzing the last interview. Where was I weak? How could I do better? In this case they were a Ruby shop. I was very upfront with them: I was not well versed in Ruby and I worked mostly with Python. They were fine with that. Still I thought I should familiarize myself more with Ruby. Also, even though I&#8217;d done ok on the algorithms interview before, I knew that was still my weak spot. So with the better part of a week to go before my 5-hour interview, I spent as much time as I could manage reading about algorithms, remembering design patterns, and tinkering a bit with Ruby.</p>
<p>When I showed up for my interview (closed-in elevator FTW) I walked into an open-plan loft-style office with huge windows all around. Once they figured out who I was, the 5 or 6 devs in the office swarmed over to meet me as a group. It was clear I was meeting a team.</p>
<p>&#8220;Are you ready to get started?&#8221;, one of them asked me. I nodded and took a slight step toward the well lit, glass walled conference room where I could see a looming whiteboard.</p>
<p>&#8220;My desk is over here&#8221;, he said, and steered me off toward a sunny area of the office where his desk was parked.</p>
<p>Ah, I&#8217;m going to answer interview questions on his computer, I thought. Cool, I can type my answers!</p>
<p>Pretty soon it was clear that there were no interview questions. He and I were going to pair program, and I was driving. He explained that we were going to hack on a real problem that he had been working on. I don&#8217;t remember what the problem was now, and I doubt I made any real contribution. That wasn&#8217;t the point. Within minutes I had forgotten that I was in an interview, and I was at ease. No one in the office was watching or hovering &#8211; they were all off doing their jobs. It was just a chance for the two of us to work together and see what that was like. He did manage to throw in a bit of tech talk during our hour together, but I was relaxed and nothing seemed like a gotcha.</p>
<p>After that first pairing session it was lunch time. I was wondering what kind of sandwich they were going to give me. Suddenly the entire dev team got on their feet and headed for the door. Apparently we were having lunch out. And so we did, at a nearby restaurant. Instead of asking me tech questions they asked get-to-know-you questions. It was a little awkward at first, but after a few minutes I was once again relaxed and felt in my element, making conversation and letting some of my humor show. (In case you wonder, I had a salad, no onions. It was still a job interview!)</p>
<p>Back at the office I was paired with a guy who was clearly the shark on the team. He was smart and intense. He talked fast and expected you to keep up. We paired, like before, and I was in the driver&#8217;s seat. He guided. My lack of familiarity with Ruby didn&#8217;t phase him, especially once I seemed to have made it past his dipshit filter. Still this was the toughest part of the day, as he had this way of explaining things to you and then staring at your eyes to see if there was the slightest twitch of confusion or weakness. It was intimidating, but tolerable. And understandable, really. I could tell he was protecting the quality of his team and took the evaluation seriously.</p>
<p>At some point the CTO pulled me aside for a chat. Instead of demanding from me why I wanted to work there, he just tried to get a feel for what I was aiming for. I was pretty honest, as I had been at the previous interview. But by this point I was impressed with the team and the work environment. He said to me, &#8220;We&#8217;re a startup. None of us know where we&#8217;ll be in 5 years, and that&#8217;s ok&#8221;. I smiled. Honesty!</p>
<p>I spent time pairing with the other devs that day, each impressive in their own way. In the last pairing session of the day I was able to teach my pairing partner something that he didn&#8217;t know, and we put it to work in solving the problem he was tackling. That made me feel great.</p>
<p>Finally, at the end of the day, the whole group of devs came over to see me off. It wasn&#8217;t cheesy; they were just thanking me for coming in. It was pretty clear that the feelings were positive both ways.</p>
<p>Within a few days I had an offer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=801</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Tale of Two Interviews, Part 1</title>
		<link>http://www.youell.com/matt/writing/?p=785</link>
		<comments>http://www.youell.com/matt/writing/?p=785#comments</comments>
		<pubDate>Thu, 05 Jan 2012 19:46:38 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[interviewing]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=785</guid>
		<description><![CDATA[It&#8217;s job hunting time for me again. I took quite a chunk of time off after leaving my last job. Now that I&#8217;m ready to dive back in, I&#8217;ve been thinking more and more about the job hunting process I went through the last time. I&#8217;d like to tell you about the last two interviews [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s job hunting time for me again. I took quite a chunk of time off after leaving my last job. Now that I&#8217;m ready to dive back in, I&#8217;ve been thinking more and more about the job hunting process I went through the last time. I&#8217;d like to tell you about the last two interviews I had during my job hunt. This is the story of the first interview. </p>
<p><em>(Cue the wavy screen effect as we roll back in time to the year 2009&#8230;)</em></p>
<p>I worked for many, many years as a roaming contract programmer, followed by a painful, scrappy stint with self employment. After so many years of fruitless jostling and meaningless projects, I really just wanted a home. A stable environment with a good team and a steady paycheck.</p>
<p>Through a friend I landed an interview with a fairly big company in the healthcare field. The phone screen was weird. It was a short 20-minute call. A few easy tech questions, although the guy interviewing me did trip me up on a time complexity question. That wasn&#8217;t so bad. The painful part was the coding task: I had to write code over the phone. No shared editor or whiteboard software, just talking over the phone. He described the problem (Fibonacci) and when I was done I was to describe what I had coded up in C#. This included voicing things like &#8220;semicolon&#8221;. I had something like 5 or 10 minutes to get it done while he waited on the line. Have you had this experience? It&#8217;s a crazy situation. You&#8217;re trying to think about how to code a solution while you&#8217;re on the phone and nothing but dead silence is coming back from the other side. I got it done in time and described a bit of code that seemed reasonable to the interviewer. </p>
<p>It&#8217;s often hard to tell how these things go, but I did get a follow up call scheduling me to come in for a &#8220;hands-on&#8221; interview. I was stoked, but my blood went cold when I found out that my interview would be 5 hours long. They&#8217;d provide lunch, I was assured.</p>
<p>After I got off the phone I pondered this. A 5-hour interview? Really? Had I been applying to Google or Microsoft, that wouldn&#8217;t have surprised me. But this was a pretty ordinary company hiring for what seemed like an ordinary position. Still, I figured the worst thing that would happen was that I&#8217;d get a free lunch.</p>
<p>I decided that if they were going to give me that much attention, I&#8217;d better take prepping seriously. It was stressful. What to focus on? A million things raced through my brain. I eventually settled on reviewing recent changes in the .Net platform and studying algorithms (my kryptonite). I don&#8217;t put a lot of stock in arbitrary algorithm knowledge, but I know to expect questions in that area. I can&#8217;t say I spent too much time studying, but I did throw some time at reviewing things like red &#038; black trees and trying to imagine what the interviewers might ask me.</p>
<p>The big day came. I worked hard to get there early and after getting lost and running into a small obstacle (glass elevator vs. acrophobia) I managed to be just in time for my interview. Perfect!</p>
<p>I was shepherded to a tiny, fluorescent conference room and interviewed by the team manager. We chatted for a bit and he explained their process. Basically I would be stuck in that room all day. They&#8217;d bring me lunch at some point, and over the course of the day they&#8217;d send in people or pairs to pepper me with questions for an hour each. At the end of the day he&#8217;d be back around to wrap up.</p>
<p>First up was Architecture. They brought in a seasoned architect and we stood at the whiteboard for an hour talking about objects and architecture. I was a little nervous about coding at the whiteboard, but he was very nice and gave me latitude to solve problems in whatever language or platform I&#8217;d like. I chose Python since I was working pretty heavily with Django at the time. Things went fairly well, but not perfectly. I felt that he and I were on the same level technically, but he was much more of a specialist of the Enterprise Architect variety. At the end I felt like I passed but it was clear that he was the better Architect.</p>
<p>Next up was Algorithms. This was where I predicted it would all fall apart. A pair of very young guys came into the room, introduced themselves, and then dove right in with some general algorithm questions. To my surprise I knew the answers and could &#8220;read the pitch&#8221; of the questions they were throwing at me. I experienced a huge boost in confidence and I did much better than I expected. When they asked me to write a sort in C# on the whiteboard I stumbled a little. I had just written Python code for an hour for the previous guy so my brain was warmed up but in the wrong language. My C# was a little rusty, especially outside of Visual Studio. It can be amazingly hard to write code with your hands instead of your fingers. Happily they didn&#8217;t sweat syntax errors here and there. Once I shook off the rust and the nerves it pretty much wrote itself. My first solution was recursive so they had me rewrite it. Finally it was done; they had no more code and no more questions. I suspected that the hardest part of the interview had just wrapped. I gave myself a mental pat on the back. All down hill from here, I figured.</p>
<p>Not quite. By the time I was done with these guys I was getting tired. Between the the mental load and the stress I was starting to bog down. Toward the end of the hour someone was nice enough to run out and grab a sandwich for me. Pretty soon I had my sandwich and was chatting with the next pair of interviewers who quizzed me on general .Net knowledge as I ate. If I had guessed in advance which segment I would do best on, this was it. Instead I fell apart. These guys were the sharks on the team, it seemed. Their questions got very aggressive. I just continually whiffed, even with questions that I &#8220;knew&#8221;. This included one question on specifics about boxed variables that I almost certainly had asked when conducting an interview of my own just a few years before. After that round I felt absolutely worthless.</p>
<p>Next I had a &#8220;quick chat&#8221; with the head of the division I was applying for. And it&#8217;s here that I&#8217;m almost certain that I botched the whole interview. I don&#8217;t remember the details, but the essence of it was this: We&#8217;re this successful startup (successful yes, startup no) and you should have a super-compelling reason you want to work here. My response was essentially, &#8220;I just want a job&#8221;. This did not sit well, and in a very polite manner he made this clear. (In retrospect I would suggest they use the phone screen to weed out those pesky people who don&#8217;t dream the Cubicle Dream. I would have saved all of us a bunch of time.)</p>
<p>Finally I got to meet again with the team manager, my last meeting of the day. By that point I was defeated. He asked how I did. Exhausted and weary, I told him that I thought I did &#8220;okay&#8221; and that I would have liked to have done better on some bits of the technical interview. He promised to be in touch and then showed me out in to the lobby. </p>
<p>There in the lobby sat my friend, the glass elevator.</p>
<p>Much to their credit they did contact me a day or two later and let me know that they weren&#8217;t interested. This was in 2009, in an employers market, and I wouldn&#8217;t be surprised if I simply got beat out by a better candidate. So it goes.</p>
<p>Read more in <a href="http://www.youell.com/matt/writing/?p=801">Part 2</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=785</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upcoming Talks</title>
		<link>http://www.youell.com/matt/writing/?p=779</link>
		<comments>http://www.youell.com/matt/writing/?p=779#comments</comments>
		<pubDate>Thu, 05 May 2011 04:40:08 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=779</guid>
		<description><![CDATA[Looks like I&#8217;ll be giving at least two talks this summer. One will by my third presentation (but first solo) at Open Source Bridge in June. I&#8217;ll be talking about GraphViz. It should be fun and there should be some pretty pictures. The other talk will be at OSCON in July, where I&#8217;ll talk about [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like I&#8217;ll be giving at least two talks this summer. One will by my third presentation (but first solo) at <a href="http://opensourcebridge.org/proposals/637">Open Source Bridge</a> in June. I&#8217;ll be talking about <a href="http://www.graphviz.org/">GraphViz</a>. It should be fun and there should be some pretty pictures. The other talk will be at <a href="http://www.oscon.com/oscon2011/public/schedule/detail/18895">OSCON</a> in July, where I&#8217;ll talk about Wheeler, my nascent programming language.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=779</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Data Structure Runs Through It</title>
		<link>http://www.youell.com/matt/writing/?p=769</link>
		<comments>http://www.youell.com/matt/writing/?p=769#comments</comments>
		<pubDate>Wed, 01 Dec 2010 22:16:58 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Road To Wheeler]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programming languages]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=769</guid>
		<description><![CDATA[I&#8217;m surprised to be developing a programming language. I didn&#8217;t know I had a language in me until a few years ago. I always considered new languages kind of a waste. Most of the cool tricks seem to be known. No reason they can&#8217;t be added to existing languages, right?
The past few years of wide-ranging [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m surprised to be developing a programming language. I didn&#8217;t know I had a language in me until a few years ago. I always considered new languages kind of a waste. Most of the cool tricks seem to be known. No reason they can&#8217;t be added to existing languages, right?</p>
<p>The past few years of wide-ranging language interest have cast doubt on that perspective. Still, one theme that I can&#8217;t shake is that you should be able to model new features in an existing language. It might be awkward, but it should still be possible. (Especially if you&#8217;re going to implement the language!)</p>
<p>In that spirit, I&#8217;ve tried to express one of the core ideas in Wheeler with a library for Python called <a href="https://github.com/built/AssociativeTools">AssociativeTools</a>. The star of the show is the Workspace class, which represents a data structure I call an Associative Network.</p>
<p>The word &#8220;network&#8221; is overloaded. Most often it is used to refer to computer networks. Here, I&#8217;m referring to a <a href="http://en.wikipedia.org/wiki/Network_model_(database)">network or web of data</a>. Think of a big pool of data in which nodes can be arranged into graphs of your choosing.</p>
<p>The Workspace lets you relate items (anything that is hashable in Python) to one another. Mostly I&#8217;m using strings and numbers. You relate items to build graphs so that later you can come back and fetch those graphs with partial information. It&#8217;s a lot like querying a database. It&#8217;s more like querying a search engine. Look:</p>
<p><code language="python"><br />
s = Workspace()<br />
s.associate("foo", "bar", "baz")<br />
# Later in the code...<br />
print(s.comprehend("foo"))<br />
</code></p>
<p>Outputs:</p>
<pre>set(['bar', 'baz'])</pre>
<p>Btw, the naming for all of this (AssociativeNetwork, associate, comprehend) is all flexible. Suggestions are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=769</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Fork in the Road</title>
		<link>http://www.youell.com/matt/writing/?p=763</link>
		<comments>http://www.youell.com/matt/writing/?p=763#comments</comments>
		<pubDate>Mon, 16 Aug 2010 03:50:44 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[problem solving]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software industry]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=763</guid>
		<description><![CDATA[I got into an interesting conversation the other day with my pairing partner about the approach he and I wanted to take while trying to fix a bug. What followed was something of an existential conversation about software, complexity, and the role of the programmer in managing complexity.
We work with a small but quite tangled [...]]]></description>
			<content:encoded><![CDATA[<p>I got into an interesting conversation the other day with my pairing partner about the approach he and I wanted to take while trying to fix a bug. What followed was something of an existential conversation about software, complexity, and the role of the programmer in managing complexity.</p>
<p>We work with a small but quite tangled system. The system itself is only a few years old but contains many technologies and bears the scars of several smart but inexperienced people learning how to design as they went. I won&#8217;t articulate the details of the bug we were experiencing but I will say that it is something that recently appeared and was troublesome but non-critical.</p>
<p>The difference in our two points of view became apparently very quickly. My desired approach was to try to pin down the bug, deconstruct it to the point of understanding, and then apply a fix. My coworker&#8217;s approach was to make a well-educated guess about the cause of the bug and apply a refactoring to our codebase that would address the anticipated problem.</p>
<p>His reasoning was that our codebase was too complex to spend time trying to understand it in detail, and in the worst-case scenario we would still have completed a useful refactoring that improved the quality of our codebase. I found this a bit hopeless. Is software really so complex that we as programmers now have to act like doctors &#8211; diagnosticians &#8211; making reasoned guesses about the world around us? Is there no more engineering?</p>
<p>10 or 15 years ago I would have considered his approach ridiculous. Now I&#8217;m honestly not sure. Modern software systems contain so much abstraction and layering that it is really hard to judge the level of effort that will be involved in addressing any one problem.</p>
<p>So what option did we choose? We guessed and did the refactoring. I don&#8217;t think I would have agreed to that with just any pair partner, but this particular coworker is a very productive programmer. He had a clear path forward and a clear rationale.  And one thing you don&#8217;t do with a productive programmer is get in their way.</p>
<p>Did it work? No. I almost want to say &#8220;OF COURSE NOT!&#8221; but that would be unfair. It could very easily have worked. What did eventually work? A pair sitting down and tracing through the application stack with <a href="http://www.gnu.org/software/gdb/">gdb</a>. And even that has only located the approximate location of the error. We still haven&#8217;t solved the problem yet. But we&#8217;re much closer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=763</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction To Wheeler, Part 3: Transitions and Mutual Dispatch</title>
		<link>http://www.youell.com/matt/writing/?p=665</link>
		<comments>http://www.youell.com/matt/writing/?p=665#comments</comments>
		<pubDate>Thu, 22 Jul 2010 00:59:10 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Road To Wheeler]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[wheeler]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=665</guid>
		<description><![CDATA[Hey, quick, watch this video before you read any further. It&#8217;s under 2 minutes long and it is *fascinating*.

That video is about how cell membranes work. Did you notice how proteins, enzymes, etc. can only pass through the cell membrane if they are the right shape (and flavor)? That&#8217;s how values trigger transitions in Wheeler.
Transitions
If [...]]]></description>
			<content:encoded><![CDATA[<p>Hey, quick, watch this video before you read any further. It&#8217;s under 2 minutes long and it is *fascinating*.</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/owEgqrq51zY&amp;hl=en_US&amp;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/owEgqrq51zY&amp;hl=en_US&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>That video is about how cell membranes work. Did you notice how proteins, enzymes, etc. can only pass through the cell membrane if they are the right shape (and flavor)? That&#8217;s how values trigger transitions in Wheeler.</p>
<h3>Transitions</h3>
<p>If categories are the most minimal representation of state, then transitions are the most minimal representation of action. Transitions are how computation happens in Wheeler. After all, organizing data is only half the battle with programming. Once you have the data in the form you want, you have to actually <em>do something</em>.</p>
<p>You can think of transitions as being very much like an event handler. You define a transition to trigger when an interaction between one or more categories happens.</p>
<p>Since Wheeler is still a work in progress, transitions are not yet native. Instead, transitions are created in Python, the language Wheeler is built on.</p>
<p>Remember our Hello example?</p>
<p><img src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/hello_world_363x174.png" alt=""  style="float: none"/></p>
<p>Here&#8217;s the transition defined for it in Python:</p>
<pre class="syntax-highlight:php">
def printer(category):
	for item in category:
		print item.name[1:-1],
	print
	return []

ROOT.create(&#039;print&#039;).add_handler( STRING, printer )
</pre>
<p>(I&#8217;ve omitted some unimportant details for clarity.)</p>
<p>What you might be able to suss out here is that there is a ROOT category that all categories live within, and I&#8217;ve created a &#8220;print&#8221; category within that. In addition, I&#8217;ve added a transition (with add_handler) which knows to watch for interactions with items in the string category. If the transition finds an interaction that matches, it executes the printer() function, which simply calls Python&#8217;s &#8216;print&#8217; function.</p>
<h3>Mutual Dispatch</h3>
<p>When more than one transition is triggered by an expression, the transitions all execute AND &#8211; at least in concept &#8211; they all execute *at the same time*.</p>
<p>This is very much like the real world. If two objects collide you don&#8217;t say that one or the other of them collided first. The collision is mutual and simultaneous. In that same way, when categories interact, the interaction is mutual and simultaneous.</p>
<p>Here&#8217;s the final snippet of Wheeler for this introduction:</p>
<p><img src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/mutual_dispatch.png" alt=""  style="float: none"/></p>
<p>In case it&#8217;s not clear what is going on here, we have some numbers, which are in the category &#8216;number&#8217;, some text in the category &#8217;string&#8217;, and some other categories (&#8217;print&#8217;, &#8216;+&#8217;) which give it all meaning with transitions. One transition knows to add all of the numbers in the expression when the plus sign is present. Another transition knows to print all of the strings in the expression to stdout when the &#8216;print&#8217; category is present.</p>
<p>When presented with this jumble of categories, Wheeler figures out what to do based on the criteria of the transitions. This effectively creates a typed-dispatch mechanism. I call this simultaneous, polymorphic behavior &#8220;Mutual Dispatch&#8221;.</p>
<p>That sums up Wheeler as currently implemented. </p>
<p>There&#8217;s still a lot of work to be done. I&#8217;ve covered what Wheeler is currently capable of. There are other planned features that I didn&#8217;t cover and hope to implement soon. I will provide more info here as new features are added.</p>
<p>I hope you find it as oddly fascinating as I do! Feedback is not just requested, it is begged for. I also strongly encourage you to <a href="http://github.com/built/wheeler">grab the code</a>, play, and contribute.</p>
<p>(Thanks to Westside Programmers and #pdxfunc for letting me present on Wheeler a few times over the past year. Having the chance to present and receive feedback has firmed up the concepts in my mind and made them easier to distill into this introduction.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=665</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Introduction To Wheeler, Part 2: Values &amp; Types</title>
		<link>http://www.youell.com/matt/writing/?p=663</link>
		<comments>http://www.youell.com/matt/writing/?p=663#comments</comments>
		<pubDate>Wed, 21 Jul 2010 23:57:31 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Road To Wheeler]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[wheeler]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=663</guid>
		<description><![CDATA[(Note: It may be helpful to read the posts I did on types several months ago.)
Someone recently asked me if Wheeler had types. My answer was &#8220;No. Uhhh&#8230; and yes.&#8221; What a terrible answer! I&#8217;ll try to do better in this post.
Wheeler has no explicit type system. You will never declare a value to be [...]]]></description>
			<content:encoded><![CDATA[<p>(Note: It may be helpful to read the <a href="http://www.youell.com/matt/writing/?p=601">posts I did on types</a> several months ago.)</p>
<p>Someone recently asked me if Wheeler had types. My answer was &#8220;No. Uhhh&#8230; and yes.&#8221; What a terrible answer! I&#8217;ll try to do better in this post.</p>
<p>Wheeler has no explicit type system. You will never declare a value to be of a certain type. You might, however, associate a value with a particular category through an interaction. In that way you&#8217;re establishing a relationship that will allow typing *behavior*.</p>
<h3>What is a value?</h3>
<p>Values are the imaginary, interstitial things floating between categories. When you establish a relationship between categories in Wheeler, you&#8217;re creating values.</p>
<h3>What is a type?</h3>
<p>I won&#8217;t attempt to answer this in general. I am not a type theorist. From the perspective of Wheeler we might say that a type is determined by a graph&#8217;s &#8220;shape&#8221; and &#8220;flavor&#8221;. Shape is the actual form of the graph we create in memory (tree, ring, object, etc.). Flavor is what specific categories are being connected by that graph.</p>
<h3>What the hell is the difference?</h3>
<p>Context. It&#8217;s all context. A value will trigger typing behavior when something matching that shape and flavor is being watched for. At that point it could be considered a type. The rest of the time, a value.</p>
<h3>Layering values into types</h3>
<p>Have you ever seen an artist paint a landscape? First they&#8217;ll paint the background&#8230; the sky, the horizon, the land. Then they start to layer on more and more detail. At what point does their work become a painting? Existential arguments aside, you might say that the work is a painting when it meets the criteria of the artist. Criteria will vary from artist to artist. Everyone has their own objectives, aesthetics, etc. In other words, everyone brings their own point of view or <em>context</em> to a situation. This idea is so fundamental in Wheeler that it is a core value of the language:</p>
<p><strong>Context Drives Behavior</strong></p>
<p>To help understand this, let&#8217;s look at a Venn diagram. (Venn diagrams are quite handy for discussing concepts in Wheeler.)</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/value_cars.png" alt="" /></p>
<p>Here you see we&#8217;ve got just a category, Cars. You could think of that as a type. Let&#8217;s pile on some more specifics:</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/value_cars_honda.png" alt="" /></p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/value_cars_honda_element.png" alt="" /></p>
<p>Now we&#8217;ve got all cars that are Honda Elements. That&#8217;s more specific, but it&#8217;s still more like a type than anything.</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/value_cars_honda_element_vin.png" alt="" /></p>
<p>Ah, but now that we have a VIN, the unique Vehicle Identification Number. That&#8217;s so unique as to specify a particular vehicle. That seems more like a concrete value now. Yay.</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/value_cars_honda_element_vin_actual.png" alt="" /></p>
<p><a href="http://www.youell.com/matt/writing/?p=665">Next time</a> we&#8217;ll look at <em>Transitions</em> which allow computation in Wheeler. Then we&#8217;ll exercise our type and value scheme.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=663</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introduction To Wheeler, Part 1: Categories &amp; Interactions</title>
		<link>http://www.youell.com/matt/writing/?p=659</link>
		<comments>http://www.youell.com/matt/writing/?p=659#comments</comments>
		<pubDate>Thu, 08 Jul 2010 16:07:39 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Road To Wheeler]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[wheeler]]></category>

		<guid isPermaLink="false">http://www.youell.com/matt/writing/?p=659</guid>
		<description><![CDATA[I started my &#8220;Road to Wheeler&#8221; series last year to introduce some of the ideas behind Wheeler, a new programming language I&#8217;ve been developing. Instead of continuing that discussion I&#8217;m going to explain through demonstration. This is the first in a series of posts that will introduce the basic ideas behind Wheeler.
(You can play along [...]]]></description>
			<content:encoded><![CDATA[<p>I started my &#8220;Road to Wheeler&#8221; series last year to introduce some of the ideas behind Wheeler, a new programming language I&#8217;ve been developing. Instead of continuing that discussion I&#8217;m going to explain through demonstration. This is the first in a series of posts that will introduce the basic ideas behind Wheeler.</p>
<p>(You can play along at home by grabbing <a href="http://github.com/built/wheeler">the latest code</a> and running the examples. You&#8217;ll need Python 2.5 and patience.)</p>
<p>First, let&#8217;s fire up &#8220;bigwheel&#8221;, the Wheeler interpreter:</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/bigwheel_349x150.png" alt="" /></p>
<p>Here is &#8220;Hello, world&#8221; in Wheeler:</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/hello_world_363x174.png" alt="" /></p>
<p>Wheeler is flexible though, so you could also say:</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/hello_world2_355x150.png" alt="" /></p>
<p>More on that later.</p>
<h3>Categories</h3>
<p>Wheeler is different from many languages you may be familiar with. All languages have abstractions. Some common examples are functions, lists, collections, stacks, pointers, and objects. In Wheeler, <strong>state</strong> is the fundamental abstraction.</p>
<p>State is represented by an abstraction called a Category. Categories are lightweight, atomic things. In Wheeler, <em>everything</em> is a category. Here are some sample categories:</p>
<ul>
<li>Fred</li>
<li>blue</li>
<li>5.3</li>
<li>&#8220;Hello, world!&#8221;</li>
<li>number</li>
<li>3/15/10</li>
<li>send</li>
<li>05:10:59</li>
<li>AM</li>
<li>PM</li>
<li>true</li>
<li>print</li>
</ul>
<p>Categories express boolean state. You&#8217;re either in a category or you&#8217;re not. Here&#8217;s an example:</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/apple_red.png" alt="" /></p>
<p>Do you see that? No? Good. What you do not see is &#8216;apple&#8217; being put into the &#8216;red&#8217; category. That is happening behind the scenes through an <em>interaction</em> between apple and red.</p>
<p>Categories aren&#8217;t containers, but from a practical standpoint they act like containers. This allows you to make statements about the world. We can pile some more attributes on &#8220;apple&#8221;:</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/apple_red2.png" alt="" /></p>
<h3>Interactions</h3>
<p>Interactions are expressions that combine categories to create new states. Our &#8220;Hello, world!&#8221; was an example of an interaction. Making our apple red was another interaction. Interaction is a mutual, simultaneous event where a connection (graph edge) is created between each item in the expression.</p>
<p>Wheeler has a &#8220;dump&#8221; command that will let you see (in GraphViz) the relationships you&#8217;ve created. Let&#8217;s dump &#8220;apple&#8221; and see the relationships:</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/apple_dump.png" alt="" /></p>
<p>And the relationships as diagrammed in GraphViz:</p>
<p><img style="float: none" src="http://www.youell.com/matt/writing/wp-content/uploads/2010/07/apple_graph.png" alt="" /></p>
<p>Here you can see that &#8220;apple&#8221; is related to &#8220;red&#8221;, &#8220;tasty&#8221;, and &#8220;sweet&#8221;. (You might notice that it is also related to &#8220;dump&#8221;, the category it interacted with to generate our diagram, and &#8220;metadata&#8221;, a built-in category.)</p>
<p>You can see that not only is &#8216;apple&#8217; connected to &#8216;red&#8217;, but &#8216;red&#8217; is also connected to &#8216;apple&#8217;. In Wheeler all relationships are bidirectional. This may seem odd if you&#8217;re used to typical hierarchical relationships in programming. Wheeler doesn&#8217;t think about the world that way. Wheeler has a few strongly-held beliefs, and one of these is:</p>
<p><strong>Hierarchy Is Bullshit</strong></p>
<p><a href="http://www.youell.com/matt/writing/?p=663">Next time</a> we&#8217;ll talk about composing categories into types.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.youell.com/matt/writing/?feed=rss2&amp;p=659</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

