<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
 
 <title>Tom Crayford</title>
 
 <link href="http://tcrayford.github.com/" />
 <updated>2011-04-14T16:39:43-07:00</updated>
 <id>http://tcrayford.github.com/</id>
 <author>
   <name>Tom Crayford</name>
   <email>tcrayford@googlemail.com</email>
 </author>
 
 
 <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/tcrayford" /><feedburner:info uri="tcrayford" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><entry>
   <title>Value objects in Ruby</title>
   <link href="http://tcrayford.github.com/2011/03/19/Values.html" />
   <updated>2011-03-19T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2011/03/19/Values</id>
   <content type="html">&lt;p&gt;In the &lt;a href='https://www.destroyallsoftware.com/screencasts/catalog/extracting-domain-objects'&gt;latest Destroy All Software screencast&lt;/a&gt; &lt;a href='#footnotes'&gt;&lt;span class='footnote'&gt;[1]&lt;/span&gt;&lt;/a&gt;, Gary Bernhardt uses a Struct to represent a &lt;a href='http://c2.com/cgi/wiki?ValueObject'&gt;value object&lt;/a&gt;. There are a couple of problems with doing this, because of the way Structs are implemented.&lt;/p&gt;

&lt;p&gt;Structs can be used to create a simple object that just holds values in named fields. However, the constructor can take less than the default number of arguments and set other fields as nil:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Point = Struct.new(:x,:y)
Point.new(1)
=&amp;gt; #&amp;lt;struct Point x=1, y=nil&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This can lead to accidental nils floating around your system, as well as you creating a value object with weird semantics. In this case, having a point without a y value probably doesn&amp;#8217;t make any sense.&lt;/p&gt;

&lt;p&gt;Furthermore, objects created by Struct are mutable. As a long time proponent of immutability wherever possible, I dislike this.&lt;/p&gt;

&lt;h2 id='enter_values'&gt;Enter Values&lt;/h2&gt;

&lt;p&gt;The problems with Struct looked pretty easy to solve with metaprogramming in ruby. So, I created a library for working with value objects as I want to: &lt;a href='https://github.com/tcrayford/Values'&gt;Values&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Values is used roughly the same way you use Struct (it doesn&amp;#8217;t have all the features though):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Point = Value.new(:x,:y)
p = Point.new(1,0)
`=&amp;gt; #&amp;lt;Point:0x00000100943788 @x=0, @y=1&amp;gt;`&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But they aren&amp;#8217;t mutable:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;p.x = 1
=&amp;gt; NoMethodError: undefined method x= for #&amp;lt;Point:0x00000100943788 @x=0, @y=1&amp;gt;
from (irb):6
from /usr/local/bin/irb:12:in &amp;lt;main&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;They also can&amp;#8217;t accidentally add nil into the constructor:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Point.new(1)
=&amp;gt; ArgumentError: wrong number of arguments, 1 for 2
from /Users/tcrayford/Projects/ruby/values/lib/values.rb:7:in `block (2 levels) in new
from (irb):5:in new
from (irb):5
from /usr/local/bin/irb:12:in `&amp;lt;main&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This library is really tiny (17 lines at the moment), and is has a good number of examples. Its probably not worth using unless you have quite a few dumb value objects in your system (as its effects can be easily replicated with plain ruby classes).&lt;/p&gt;
&lt;div id='footnotes'&gt;&lt;h2&gt;Notes&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;[1]&lt;/strong&gt;
Destroy All Software is a screencast series that teaches programmers about software design, UNIX and dynamic languages. Highly reccomended.&lt;/p&gt;

&lt;p&gt;For reasons why nil is bad, see the &lt;a href='https://www.destroyallsoftware.com/screencasts/catalog/how-and-why-to-avoid-nil'&gt;example screencast&lt;/a&gt; there.&lt;/p&gt;
&lt;/div&gt;</content>
 </entry>
 
 <entry>
   <title>Clean code and University</title>
   <link href="http://tcrayford.github.com/2010/09/29/Eden-Summer.html" />
   <updated>2010-09-29T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2010/09/29/Eden-Summer</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve now finished my summer internship at &lt;a href='http://edendevelopment.co.uk'&gt;Eden Development&lt;/a&gt;. The summer was a blast, I learned so much about shipping real products to real people (compared to university where one mostly works on short-lived solutions to small problems).&lt;/p&gt;

&lt;p&gt;I learned a bunch about what &amp;#8216;good code&amp;#8217; looks and feels like, mostly from discussions with everybody at eden, and just the inherent learning that comes from pairing. &lt;a href='http://twitter.com/ecomba'&gt;Enrique&lt;/a&gt; showed me some very nice examples of code he&amp;#8217;s written, which really helped.&lt;/p&gt;

&lt;p&gt;Since coming back to university, I&amp;#8217;ve been bemused by my coursemates attitude towards &amp;#8216;clean code&amp;#8217; and testing; for the most part, they don&amp;#8217;t care about either very much. I think this is one of the side effects of university projects being short lived, when you only work on the code for a month, its quality seems to matter less.&lt;/p&gt;

&lt;p&gt;The counterpoint to that is that lecturers (or more often, their assistants) have to read your code so that they can grade it. If the code is really horrible and hard to understand (even if it does solve the problem), then it is likely you won&amp;#8217;t get a good grade.&lt;/p&gt;

&lt;p&gt;With tests, it turns out that lots of problems set at the university level have sample input and output. This situation is just ripe for testing, as you can be sure that your program does the right thing (and check that instantly).&lt;/p&gt;

&lt;p&gt;The other point about &amp;#8216;clean code&amp;#8217; at university is that it really comes down to caring about your output. Everybody I worked with over the summer was fanatical about the quality of the product they turned out. That kind of passion shows through in your code, and makes good impressions on lecturers (which often leads to better grades, and helps you get into any further education prospects with the university). For me, this is the real reason I strive to write clean code at university. It puts me in a mindset of only writing clean code, which is a good habit to have.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Sixth Day at Eden</title>
   <link href="http://tcrayford.github.com/2010/07/15/Sixth-Day.html" />
   <updated>2010-07-15T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2010/07/15/Sixth-Day</id>
   <content type="html">&lt;p&gt;(This post is part of a series documenting my apprenticeship at Eden. For more, visit the &lt;a href='http://www.tcrayford.net/archive.html'&gt;archives&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Yesterday was very fun. I worked with &lt;a href='http://twitter.com/sermoa'&gt;aimee&lt;/a&gt; on a client project, getting &lt;a href='http://github.com/pivotal/jasmine'&gt;Jasmine&lt;/a&gt; working so we could test some javascript that we wanted to refactor. To test that we had to break up the code quite a bit, and then mock out things that touch the DOM. This is mostly because we couldn&amp;#8217;t work out getting fixtures generated for jasmine, so maybe we&amp;#8217;ll work on that today.&lt;/p&gt;

&lt;p&gt;On another note, my typing (seeing as I&amp;#8217;m participating in #learn2typewk) seems to be getting worse. However, I&amp;#8217;m somewhat aware of my problem areas now (pretty much anything not on the home row), so I know what to work on. I&amp;#8217;ve also started a &lt;a href='http://www.randsinrepose.com/archives/2008/08/18/the_trickle_list.html'&gt;Trickle List&lt;/a&gt; for keeping track of my typing practice.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Third Day at Eden</title>
   <link href="http://tcrayford.github.com/2010/07/14/Fifth-Day.html" />
   <updated>2010-07-14T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2010/07/14/Fifth-Day</id>
   <content type="html">&lt;p&gt;(This post is part of a series documenting my apprenticeship at Eden. For more, visit the &lt;a href='http://www.tcrayford.net/archive.html'&gt;archives&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Yesterday I gave a tech talk on Clojure to part of the Eden staff. The talk itself went reasonably well, although I hadn&amp;#8217;t prepared anywhere near as much as I&amp;#8217;ve prepared for previous talks, and it showed. This really reminds me of how important practice is, especially for speaking to groups. After the talk I ran through &lt;a href='www.katacasts.com'&gt;the string calculator kata&lt;/a&gt; in Clojure with the group.&lt;/p&gt;

&lt;p&gt;Having not practiced this at all (as well), and not done that much Clojure in the past month left me feeling a little rusty, and it showed (at one point I couldn&amp;#8217;t remember the java api for making a regex out of a string). I will be giving this talk again on Friday at the &lt;a href='http://groups.google.com/group/SCGUK'&gt;Software Craftsmanship UK meetup&lt;/a&gt;, so I need to practice more.&lt;/p&gt;

&lt;p&gt;To get into this practice, I am starting to do a kata every single day on the train home. This week it&amp;#8217;ll most definitely be the string calculator, next week I&amp;#8217;ll switch to something else (if you have suggestions, &lt;a href='twitter.com/t_crayford'&gt;twitter at me&lt;/a&gt;).&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Fourth Day at Eden</title>
   <link href="http://tcrayford.github.com/2010/07/13/Fourth-Day.html" />
   <updated>2010-07-13T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2010/07/13/Fourth-Day</id>
   <content type="html">&lt;p&gt;(This post is part of a series documenting my apprenticeship at Eden. For more, visit the &lt;a href='http://www.tcrayford.net/archive.html'&gt;archives&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Yesterday (the fourth day) was interesting because I was working on Eden as a business, not directly on code. Most of the things I learnt were with regards to marketing, as opposed to coding.&lt;/p&gt;

&lt;p&gt;I did have some time to talk to Enrique about the wiki exercise. Reflecting on this further, I realise that I completely overworked the testing side of the assignment, to the expense of the actual code, a trap I have fallen into before. The lesson I took away from this is to remember &lt;em&gt;why&lt;/em&gt; writing tests is important; which is that it helps deliver business value.&lt;/p&gt;

&lt;p&gt;I am now going to redo the whole assignment (from scratch), concentrating more on the actual wiki, and less on testing.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Third Day at Eden</title>
   <link href="http://tcrayford.github.com/2010/07/12/Third-Day.html" />
   <updated>2010-07-12T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2010/07/12/Third-Day</id>
   <content type="html">&lt;p&gt;(This post is part of a series documenting my apprenticeship at Eden. For more, visit the &lt;a href='http://www.tcrayford.net/archive.html'&gt;archives&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;This a retrospective post, which I&amp;#8217;m writing on Monday morning (for Friday). On Friday I finished most of the wiki exercise, then paired with aimee for some client work.&lt;/p&gt;

&lt;h2 id='wiki_retrospective'&gt;Wiki Retrospective&lt;/h2&gt;

&lt;p&gt;The wiki exercise was interesting, not least in learning more about testing and abstraction. I think the main flaw with my program (as it stands now) is that every action is modelled with its own Webrick servlet class. This has cost me significantly in flexibilty; if I were to do this assignment again I would write one servlet that just routes actions to something akin to a rails controller. This would have made the testing much easier, and reduced (somewhat) the level of mocking I did.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m quite happy with the mocking library that emerged, and found that testing interactions (as apposed to state) fits nicely with my (newbie ish) ideas about OO testing.&lt;/p&gt;

&lt;p&gt;The other main lesson I learned was with regards to ruby metaprogramming. Whilst not as &amp;#8216;flexible&amp;#8217; as lisp macros, I&amp;#8217;m finding ruby metaprogramming an interesting way of thinking, because you are mostly manipulating methods on objects (and classes).&lt;/p&gt;

&lt;p&gt;The other pleasant thing here was finding out how little code it takes to write a minimum viable testing framework. I also wrote a little rspec clone on top of my testing stuff, which was very simple to do. I didn&amp;#8217;t end up using it, because it would have meant converting all my tests to a new format (again, after I converted them to xUnit style), and everything was pretty much finished already. Furthermore, the examples were already pretty readable, and I didn&amp;#8217;t feel that specs would add more.&lt;/p&gt;

&lt;p&gt;Finally, I keep on feeling spoilt by Clojure&amp;#8217;s sequence library. There are a number of functions there that I&amp;#8217;d love to have in ruby (&lt;code&gt;partition-by&lt;/code&gt; would have been useful for the scoring kata, and &lt;code&gt;group-by&lt;/code&gt; is dang useful).&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Second day at Eden</title>
   <link href="http://tcrayford.github.com/2010/07/09/Second-Day.html" />
   <updated>2010-07-09T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2010/07/09/Second-Day</id>
   <content type="html">&lt;p&gt;(This post is part of a series documenting my apprenticeship at Eden. For more, visit the &lt;a href='http://www.tcrayford.net/archive.html'&gt;archives&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve now finished the Ruby Koans I started on the first day. The remaining koans taught me some useful things about message passing and method_missing, which I have since used for a little test framework.&lt;/p&gt;

&lt;p&gt;After finishing these Enrique got me tdding a wiki server using just the ruby standard library. The twist to this is that you&amp;#8217;re not allowed to use Test/Unit, so you basically have figure out how to write tests.&lt;/p&gt;

&lt;p&gt;After finishing the day, I looked over the test code, and found it extremely ugly. I&amp;#8217;ve often found that ugliness in code means that I&amp;#8217;m missing the right abstraction, or at the very least that my design is flawed. My fault here was entirely in the test code, which seemed very unstructured.&lt;/p&gt;

&lt;p&gt;To resolve this, I wrote a small (77 lines) implementation of the xUnit testing framework, so that I can clean up the tests on my third day. I wrote this (from memory), based on Kent Beck&amp;#8217;s example from &lt;a href='http://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530'&gt;TDD by example&lt;/a&gt; There&amp;#8217;s also a tiny mocking thing, based on &lt;a href='http://bitbucket.org/garybernhardt/dingus/'&gt;Dingus&lt;/a&gt;, which I am using for testing servlets.&lt;/p&gt;

&lt;p&gt;After writing these two to help me organise the tests, I&amp;#8217;m think the rest of the wiki should be much easier to test (and therefore write). This reminds me again of the importance of aesthetics in code. I&amp;#8217;ve found ugly code is often very difficult to work with, and makes the developers working on it unhappy as well.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>First day at Eden</title>
   <link href="http://tcrayford.github.com/2010/07/08/First-Day.html" />
   <updated>2010-07-08T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2010/07/08/First-Day</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve just finished my first day as an apprentice at &lt;a href='http://edendevelopment.co.uk/'&gt;Eden&lt;/a&gt;. As an exercise for the first day, Enrique (my mentor) had me going through the &lt;a href='http://github.com/edgecase/ruby_koans'&gt;Ruby Koans&lt;/a&gt;, which were pleasantly surprising.&lt;/p&gt;

&lt;p&gt;As a further add on to this, Enrique added the rule of not having any method longer than 4 lines. I first saw an idea like this whilst reading Clean Code (which is a very good read). In the past I probably would have written a large method, but this encouraged me to write much smaller ones.&lt;/p&gt;

&lt;p&gt;The nice part about the koans is they teach parts of the language one might never touch much (I&amp;#8217;ve never really used array slicing, for example). The scoring problem (the koan I&amp;#8217;m currently on), was also an interesting design challenge. The solution I ended up with is here:&lt;/p&gt;

&lt;p&gt;Even this small exercise reminded me of the important point of finding the right technique being crucial to clean code. With the right angle on the problem, code can become significantly smaller and easier to change.&lt;/p&gt;

&lt;p&gt;The right abstraction in this case was finding triples by using&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(1..6).each do |i|
  if dice.count(i) &amp;gt;= 3
  ...&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After I discovered this, the problem was easy to solve (and the code was cleaner too).&lt;/p&gt;

&lt;h2 id='annendum'&gt;Annendum&lt;/h2&gt;

&lt;p&gt;Learn to type week (as suggested by &lt;a href='http://programmingtour.blogspot.com/2010/07/learn-to-type-week.html'&gt;Corey&lt;/a&gt;) is next week, and I&amp;#8217;ll definitely be taking part in it.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>A tutorial on the universality and expressiveness of reduce</title>
   <link href="http://tcrayford.github.com/2010/05/14/A-Tutorial-On-Reduce.html" />
   <updated>2010-05-14T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2010/05/14/A-Tutorial-On-Reduce</id>
   <content type="html">&lt;p&gt;I was getting up to date on &lt;a href='LINK_HERE'&gt;The Joy of Clojure&lt;/a&gt; recently, and found a link to &lt;a href='http://www.cs.nott.ac.uk/~gmh/fold.pdf'&gt;this paper&lt;/a&gt;. It shows some interesting demonstrations of &lt;code&gt;fold&lt;/code&gt; (better known to Clojure programmers as &lt;code&gt;reduce&lt;/code&gt;), but I had to struggle through reading them in Haskell.&lt;/p&gt;

&lt;p&gt;The paper starts out by demonstrating that some standard list processing functions can be written using reduce:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(defn my-count [coll]
  (reduce (fn [n x] (inc n)) 0 coll))

(my-count [1 2 3 3]) ;; produces 4

(defn my-reverse [coll]
  (reduce (fn [xs x] (into [x] xs)) [] coll))

(my-reverse [1 2 3]) ;; =&amp;gt; [3 2 1]

(defn my-map [f coll]
  (reduce (fn [xs x] (conj xs (f x))) [] coll))

(my-map inc [1 2 3]) ;; =&amp;gt; [2 3 4]

(defn my-filter [pred coll]
  (reduce (fn [xs x] (if (pred x)
                       (conj xs x)
                       xs))
          []
          coll))

(my-filter even? [1 2 3]) ;; =&amp;gt; [2]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;All of the above functions only work on vectors (the original Haskell versions use lists). They&amp;#8217;re also not lazy, and lose a lot of benefits that the full clojure implementations have. Furthermore, I personally find &lt;code&gt;reduce&lt;/code&gt; VERY hard to read. Having said that, there&amp;#8217;s something to be said for how reduce expresses the above definitions.&lt;/p&gt;

&lt;p&gt;The laziness problem is obviously avoided in Haskell (given its lazy nature). I&amp;#8217;m mostly bothered (at the moment) by the readability problem. I don&amp;#8217;t find many of the above definitions clear at all, and most of the time I need to use reduce, I don&amp;#8217;t, only noticing it when I&amp;#8217;m refactoring later (and even then I question it, due to the readability problem).&lt;/p&gt;

&lt;p&gt;The paper also taught me some more reasons for having first class functions in a language (not that I needed more). See the following definition of comp.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(defn my-binary-comp [f g]
  (fn [x] (f (g x))))

(defn my-comp [&amp;amp; fs]
  (reduce my-binary-comp identity fs))

((my-comp inc inc inc) 1) ;; =&amp;gt; 4&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Again, this isn&amp;#8217;t as all encompassing as clojure&amp;#8217;s implementation, but it further demonstrates the expressiveness of reduce.&lt;/p&gt;

&lt;p&gt;Users of Haskell will know that Haskell also defines the &lt;code&gt;foldl&lt;/code&gt; function, which simply processes arguments in the opposite order from reduce. Hutton points out that this new function is sometimes more useful than &lt;code&gt;fold&lt;/code&gt;, by defining reverse in terms of it.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;(defn foldl [f value coll]
  (reduce f value (reverse coll)))

(defn my-reverse [coll]
  (foldl (fn [xs x] (conj xs x)) [] coll))

(my-reverse [1 2 3]) ;;=&amp;gt; [3 2 1]&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id='notes'&gt;Notes&lt;/h2&gt;

&lt;p&gt;All the above code can be found &lt;a href='http://gist.github.com/401618'&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Hutton&amp;#8217;s original paper is &lt;a href='http://www.cs.nott.ac.uk/~gmh/fold.pdf'&gt;here&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Syllabus Review</title>
   <link href="http://tcrayford.github.com/2010/03/25/Syllabus.html" />
   <updated>2010-03-25T00:00:00-07:00</updated>
   <id>http://tcrayford.github.com/2010/03/25/Syllabus</id>
   <content type="html">&lt;p&gt;Keeping my student life well organised has been a major part of my life this year, especially as my workload for University (college to all you US folk) has increased. I was delighted to hear of an application designed specifically to help students with this task. &lt;a href='http://www.randomaccident.com/products/syllabus/syllabus.html'&gt;Syllabus&lt;/a&gt; aims to help students stay organised, by collecting functionality that was spread over several apps into one.&lt;/p&gt;

&lt;p&gt;The major plus point for Syllabus (for non-techie students) is that it hides away the filesystem completely. You can just import your files (probably from the downloads folder, as you download them), and Syllabus will keep everything nicely organised. Most users are distinctly scared of the filesystem, and most of the iLife apps already abstract it away from the user. However, for a techie like myself, this doesn&amp;#8217;t offer much of an advantage compared using the filesystem, which I already had organised how I wanted it.&lt;/p&gt;

&lt;p&gt;This hits on my big problem with Syllabus, for students who are already well organised (probably using iCal and the filesystem), Syllabus offers almost nothing. Furthermore, the time it takes to get data into the app means that it&amp;#8217;s pretty pointless for many students.&lt;/p&gt;

&lt;p&gt;Syllabus is interesting conceptually, because it tries to do for student organisation what &lt;a href='http://daringfireball.net/2007/04/coda'&gt;Coda&lt;/a&gt; does for web development. That is, turn what used to be a many app task (keeping my student work organised) into a one window task. Many things Syllabus does are handled well by iCal (keeping track of dates), and the Finder/Spotlight (keeping track of files).&lt;/p&gt;

&lt;p&gt;The main problem here is that organisation is a very disparate task. Keeping track of professors&amp;#8217; emails for example, is completely separate to keeping track assignment hand in date. Unlike Coda, there is little benefit to moving these two tasks into one app, as they simply have little relevance to each other. Furthermore, because Syllabus does all these separate things, the UI for each task feels unpolished compared to apps that already accomplish that task. A particular example that springs to mind is entering dates in Syllabus compared to iCal (or its bigger brother, &lt;a href='http://www.busymac.com/'&gt;BusyCal&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The UI for entering dates being unpolished is a particular problem, because a lot of my usage of Syllabus so far has been entering dates (for lecture times, assignment due in dates, professor office hours and term dates). Another date-related complaint is that the at-a-glance view, which is a very simple outline of what is coming up in the next week, is nowhere near as good as iCal&amp;#8217;s week view. This is especially pertinent because of Syllabus&amp;#8217; syncing with iCal (which works very well), as you can get the iCal view for your student work (that you entered using syllabus) by selecting the Syllabus calendar.&lt;/p&gt;

&lt;p&gt;&lt;img src='http://www.randomaccident.com/products/syllabus/syllabus/ataglance_files/stacks_image_51_1.png' alt='At a glance window' /&gt;&lt;/p&gt;

&lt;p&gt;The final lacking thing from Syllabus is any sort of search functionality. Particularly for students with many links/files, it seems far more sensible to keep them in a known folder/browser bookmarks (where you can search them properly, etc) than to put the in Syllabus.&lt;/p&gt;

&lt;p&gt;Overall, I love the idea of the app. Keeping student things organised is definitely an important task. However, the execution is somewhat lacking, having many disparate tasks with little integration between them doesn&amp;#8217;t work well for a single app. Many tasks that Syllabus accomplishes are already covered by iLife, and done better there.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>String Calculator Kata</title>
   <link href="http://tcrayford.github.com/2010/02/10/Katacast.html" />
   <updated>2010-02-10T00:00:00-08:00</updated>
   <id>http://tcrayford.github.com/2010/02/10/Katacast</id>
   <content type="html">&lt;p&gt;A code kata is a simple coding task that you perform repeatedly, analysing each performance to improve your skills.&lt;/p&gt;

&lt;p&gt;&lt;a href='http://www.coreyhaines.com'&gt;Corey Haines&lt;/a&gt; has been running &lt;a href='http://katacasts.com'&gt;katacasts.com&lt;/a&gt; for a while now. The string calculator kata has proven to be popular under submitters, so I thought it&amp;#8217;d be interesting to do one in clojure.&lt;/p&gt;

&lt;p&gt;This particular kata involves summing a string of numbers separated by commas and/or newlines. Custom delimiters are also allowed (represented as the first line starting with &lt;code&gt;//&lt;/code&gt;). Any negative numbers found should throw an exception.&lt;/p&gt;
&lt;object height='300' width='400'&gt;&lt;param name='allowfullscreen' value='true' /&gt;&lt;param name='allowscriptaccess' value='always' /&gt;&lt;param name='movie' value='http://vimeo.com/moogaloop.swf?clip_id=9350864&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1' /&gt;&lt;embed src='http://vimeo.com/moogaloop.swf?clip_id=9350864&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1' allowfullscreen='true' type='application/x-shockwave-flash' allowscriptaccess='always' height='300' width='400' /&gt;&lt;/object&gt;
&lt;p&gt;&lt;a href='http://vimeo.com/9350864'&gt;String Calculator Kata&lt;/a&gt; from &lt;a href='http://vimeo.com/user2764669'&gt;Tom Crayford&lt;/a&gt; on vimeo.&lt;/p&gt;

&lt;p&gt;If you have any feedback, leave a comment at the katacasts site, or message &lt;a href='http://twitter.com/t_crayford'&gt;me on twitter&lt;/a&gt;&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Clojure Autotest</title>
   <link href="http://tcrayford.github.com/2009/12/08/Lein-Autotest.html" />
   <updated>2009-12-08T00:00:00-08:00</updated>
   <id>http://tcrayford.github.com/2009/12/08/Lein-Autotest</id>
   <content type="html">&lt;p&gt;I&amp;#8217;ve been doing a lot of testing for a clojure side project recently, and got envious of Ruby people having nice tools. In particular I liked the coloured output and automatic test running from &lt;a href='http://github.com/rubyphunk/rspactor' title='rspactor'&gt;rspactor&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I found &lt;a href='http://github.com/mynyml/watchr' title='watchr'&gt;watchr&lt;/a&gt; and came up with &lt;a href='http://gist.github.com/251881' title='watchr script'&gt;this script&lt;/a&gt;, which simply watches for changes to .clj files in &lt;code&gt;/src&lt;/code&gt; and &lt;code&gt;/test&lt;/code&gt; and runs &lt;code&gt;lein test&lt;/code&gt; in the shell window.&lt;/p&gt;

&lt;p&gt;To get started, install watchr&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gem install watchr&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and run the script in the home directory for your Leiningen-backed clojure project.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;watchr /path/to/script&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The script also does some (very basic) red/green colouring of outputs using zsh color codes.&lt;/p&gt;

&lt;p&gt;Sample output: &lt;img src='/files/lein-autotest.png' alt='Sample output' /&gt;&lt;/p&gt;</content>
 </entry>
 
 
</feed>

