<?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>gnuu.org &#187; programming</title>
	<atom:link href="http://gnuu.org/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://gnuu.org</link>
	<description>my word against yours, fight.</description>
	<lastBuildDate>Fri, 16 Jul 2010 22:12:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Let&#8217;s Do Some Engineering Pt. 2: Software Metrics</title>
		<link>http://gnuu.org/2010/04/06/software-metrics/</link>
		<comments>http://gnuu.org/2010/04/06/software-metrics/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 06:52:51 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[afferent coupling]]></category>
		<category><![CDATA[c1]]></category>
		<category><![CDATA[code coverage]]></category>
		<category><![CDATA[cohesion]]></category>
		<category><![CDATA[coupling]]></category>
		<category><![CDATA[cyclomatic complexity]]></category>
		<category><![CDATA[defects]]></category>
		<category><![CDATA[efferent coupling]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[kloc]]></category>
		<category><![CDATA[lcom]]></category>
		<category><![CDATA[loc]]></category>
		<category><![CDATA[metrics]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[rcov]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[test coverage]]></category>

		<guid isPermaLink="false">http://gnuu.org/?p=430</guid>
		<description><![CDATA[View part 1 of this series: Design Patterns. Taken from andysartwork.com. Software metrics don&#8217;t get their dues. A lot of us use metrics often, but we often don&#8217;t pay attention and realize why or how we&#8217;re using them. This means we&#8217;re missing a great opportunity to learn about the metrics we use, why, when and [...]]]></description>
			<content:encoded><![CDATA[<p><!--pagetitle:Introduction--></p>
<p class="note">View part 1 of this series: <a href="http://gnuu.org/2010/03/26/lets-do-some-engineering-pt-1-design-patterns/">Design Patterns</a>.</p>
<div style="float:right;text-align:center">
<p><a href="http://www.andysartwork.com/Gallery2.htm"><img src="http://gnuu.org/wp-content/uploads/2010/04/Metrics-194x300.jpg" alt="The Metrics" title="Metrics" width="194" height="300" align="right" /></a></p>
<p style="margin-left:10px;color:#aaa"><small>Taken from <a href="http://www.andysartwork.com/Gallery2.htm">andysartwork.com</a>.</small></p>
</div>
<p>Software metrics don&#8217;t get their dues. A lot of us use metrics often, but we often don&#8217;t pay attention and realize why or how we&#8217;re using them. This means we&#8217;re missing a great opportunity to learn about the metrics we use, why, when and where they apply, and potentially even discover some new metrics that might be more helpful for keeping track of our code. Hopefully this article can shed some light on these metrics we use and explain when and where they&#8217;re best applied as well as when and where they aren&#8217;t. I&#8217;d also like to cover some other metrics that aren&#8217;t as popular but might be interesting to know about, especially for dynamic languages such as Python or Ruby.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2010/04/06/software-metrics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Joy of Solving Problems, All of Them</title>
		<link>http://gnuu.org/2009/10/01/the-joy-of-solving-problems-all-of-them/</link>
		<comments>http://gnuu.org/2009/10/01/the-joy-of-solving-problems-all-of-them/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 22:28:29 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[contract work]]></category>
		<category><![CDATA[essay]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://gnuu.org/2009/10/01/the-joy-of-solving-problems-all-of-them/</guid>
		<description><![CDATA[I get a lot of joy out of finding solutions to my own problems. This is not that surprising, as most people do. Of course some people don’t like to admit it out of fear of being labeled selfish or self-centered. Other people don’t have the means, but would love the idea of having such [...]]]></description>
			<content:encoded><![CDATA[<p>I get a lot of joy out of finding solutions to my own problems. This is not that surprising, as most people do. Of course some people don’t like to admit it out of fear of being labeled selfish or self-centered. Other people don’t have the means, but would love the idea of having such control. This makes me lucky, since I have both the means and don’t care much about being called selfish. I’ve been happily invested in many personal projects for a long time now. I’ve also been fortunate enough (as a recently graduated student with savings) to be able to focus exclusively on… myself. </p>
<p>Granted, all of my personal projects benefit others, whether it’s my <a href="http://yard.soen.ca">documentation tool</a>, my <a href="http://github.com/lsegal/barracuda">OpenCL Ruby bindings</a> or my apparently well received <a href="http://gnuu.org/2009/09/18/writing-your-own-toy-compiler/">compiler design tutorial</a> I’ve recently written. The dirty little secret is: <em>I do it for myself</em>. I wrote the compiler tutorial because <em>I</em> wanted to learn compiler design. I wrote OpenCL bindings because <em>I</em> wanted to learn OpenCL. I suppose I could even say that my willingness to help others to has a slightly selfish motivation; the joy <em>I</em> get out of being the one to help somebody else is certainly a factor in what motivates me to do the things I do.</p>
<p>Lately, however, I’ve been losing steam on a lot of these projects. I’ve been realizing that my lack of recent motivation is due in part to this <em>looking inwardness</em> that I’ve been guilty of for a while now. Rather than take somebody else’s problem and help them for the sake of their problem, I take my problems and apply them to others. This is hardly a sustainable way to live life. The problem lies in focusing too much on either end of the spectrum. I came to my own problems after being bombarded with contract work and clients looking for solutions to their own problems. That life was equally unsustainable, and likely drove me to the need to focus on myself. The conclusion? It’s just as bad to focus exclusively on my problems as it is to focus exclusively on somebody else’s. </p>
<p>The good thing is I’ve also been remembering another dirty little secret: <em>I like to solve other people’s problems too</em>. In fact, I’ve realized I get just as much joy out of solving someone else’s problem as my own. I write this in part as a confession, but also in hopes of being a footnote to somebody else. Solving your own problems is great, and anyone who has that opportunity should apply it often. But a skill like that should be shared with others as often as it is applied to oneself. The important part is balance. If you’re focusing exclusively on your client or boss’s problems, you need to change that and start writing some code for you. Something perhaps completely selfish. Just don’t quit your day job while doing it; variety is what keeps us fresh and motivated to solve problems, all problems.</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2009/10/01/the-joy-of-solving-problems-all-of-them/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demystifying Continuations in Ruby (because they shouldn&#8217;t be feared)</title>
		<link>http://gnuu.org/2009/03/21/demystifying-continuations-in-ruby/</link>
		<comments>http://gnuu.org/2009/03/21/demystifying-continuations-in-ruby/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 18:35:03 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[continuations]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby 1.9]]></category>

		<guid isPermaLink="false">http://gnuu.org/2009/03/21/demystifying-continuations-in-ruby/</guid>
		<description><![CDATA[So most people won’t touch continuations with a 10 foot pole, that’s probably why in Ruby 1.9 they’ve been pseudo-deprecated (YARV performance was also an issue here, to be fair) by being pushed out to an explicit “require ‘continuation’” call. Perhaps it’s been misunderstood, but there’s a secret that nobody knows about continuations: they’re dead simple. BRAINDEAD simple.]]></description>
			<content:encoded><![CDATA[<p>So most people won’t touch continuations with a 10 foot pole, that’s probably why they&#8217;ve been <a href="http://wiki.jruby.org/wiki/Differences_between_mri_and_jruby">left out of JRuby</a> and <a href="http://www.atdot.net/~ko1/pub/ContinuationFest-ruby.pdf">pseudo-deprecated</a> in Ruby 1.9 (YARV performance was also an issue here, to be fair) by being pushed out to an explicit “<em>require ‘continuation’</em>” call. Perhaps it’s been misunderstood, but there’s a secret that nobody knows about continuations: <strong>they’re dead simple</strong>. <em>BRAINDEAD</em> simple.</p>
<p>Most blogs and articles I’ve seen that try to explain continuations get it wrong. They bore you with low level details that confuse you in the first place, or scare you by starting with the premise that “it’s complicated, but I&#8217;ll try to make you understand”. I’m not going to do either, I’m actually going to explain continuations in two words, and I want you not to laugh, cry, or vomit on yourself when you read them:</p>
<h2>GLORIFIED GOTOs</h2>
<p>Oh no, I just said a dirty word, didn&#8217;t I. You may have your own irrational fears of the goto statement, but you probably know what they are and how they work:</p>
<pre class="sh_c">#include &lt;stdio.h&gt;
int main() {
  int i = 0;
  printf("%d\n", i);
  goto some_label;
  i = 1;
  some_label:
  printf("%d\n", i);
  return 0;
}</pre>
<p>The above snippet of working C shows how we can jump to different points in a function. It prints 0 twice instead of 0 followed by 1, as you would expect. Language evolution has mostly deprecated this form of programming through method calls and, more intricately, exception handling. These new practices are really just syntactic sugar on the old goto concept. Hopefully all those who scoff at any mention of goto will one day sit down and realize that they&#8217;re a central part of how computers work, but I&#8217;m getting off topic. The point is, whether you use gotos or not, they&#8217;re extremely simple to understand. In fact, they’re exactly as simple as continuations; let’s re-write the above using those &#8220;scary&#8221; guys:</p>
<pre class="sh_ruby">def main
  i = 0
  callcc do |label| # callcc gives us ‘label’, a continuation object
    puts i
    label.call # this is our "goto" statement
    i = 1      # we skip this completely
  end          # this is where our "label" would otherwise sit
  puts i
end</pre>
<p>To those in the know, this doesn&#8217;t really show off the full-extent of callcc&#8217;s powers (that comes later), but you can look at &quot;label.call&quot; as the equivalent of &quot;goto label&quot;, and the end of the callcc block is where the label would be. That&#8217;s basically how continuations work.</p>
<p><em>If you’re having trouble parsing the above: the little trick to understanding the code is simply realizing that the block that callcc yields is <strong>executed immediately, once, and only once</strong>. It’s simply there so you can do any one-time initialization with the continuation you’re creating. The end of the block is where any subsequent calls to the yielded continuation object will go, not the block itself.</em></p>
<h3>NOW YOU KNOW.</h3>
<p>So what, is it really that simple? Continuations are another way to write gotos? The answer is: pretty much. There are actually only two functional difference that makes them even more powerful than the above C-style gotos, but one that makes them a little less-so.</p>
<h4>More Powerful, How?</h4>
<p><span style="font-size: 140%">1.</span> <strong>They’re not local to your method</strong>. Simply put, we can’t do the following in C:</p>
<pre class="sh_c">// a() is called by main()
void a() {
  printf("hello world\n");
  label1:
  printf("then you say...\n");
  b();
}
void b() {
  printf("then I say...\n");
  goto label1;
}</pre>
<p>This should print &quot;hello world&quot; followed by &quot;then you say&quot;, &quot;then I say&quot;, in a never-ending loop. Problem is, it won&#8217;t compile. Without getting into the nitty-gritty of why C can’t do this, I’ll just simply show how we can actually get away with it using continuations:</p>
<pre class="sh_ruby">def a
  puts "hello world"
  callcc {|cc| $label1 = cc } # pretend this says "label1:"
  puts "then you say..."
  b
end

def b
  puts "then I say"
  $label1.call # pretend this says "goto label1"
end</pre>
<p>As the comments indicate, this is almost a one-to-one translation of the C code above. Our continuation object is set to a global variable, essentially making it a “<em>global label</em>” that can be goto’d by running the method #call (picture it as “label.goto” instead of #call).</p>
<p><span style="font-size: 140%">2.</span> <strong>They maintain stack-frame state</strong>. That’s the reason why labels in C are local to a function, because you can’t just jump between functions without switching stack frames. Actually, there are tricks in C to do just that (namely <tt>longjmp</tt> and <tt>setjmp</tt> to jump to arbitrary addresses and continue execution which is actually how continuations are done in C), but we’re focusing on Ruby here, right? Basically, the continuation object yielded from callcc (the {|cc| thing}) contains a snapshot of our stack frame at the point it was yielded at (remember, the block is only yielded that first time). This allows us to jump between methods in a class, between classes, and jump back from a nested call when we are arbitrarily deep in a stack frame. </p>
<h4>Anyone Up For A Quick Real World Example?</h4>
<p>The last situation is the one with some real world usage. Imagine we’re writing a web framework with a Rails-style before_filter and we want the ability to halt the execution during a filter and jump all the way back up to the router code to find the next matching route. <a href="http://www.sinatrarb.com">Sinatra</a> (sort-of) does this with the `pass` method, and though it probably doesn’t use continuations to achieve the result, the concept here is a perfect example of wanting to jump back through our stack frames arbitrarily. We could be 3 method calls deep, or we could be 20 method calls deep, but we need to “go to” a specific point in our program execution. Usually, people implement this with try/catch style exception handling (RouteAbortError maybe), but continuations may be a little cleaner depending on the scenario (we might have a method handling the exception 3 method calls up, but we want to jump 7 method calls up to the initial point in code).</p>
<h4>Less Powerful, How?</h4>
<p>There’s one thing you may have noticed from the initial example, it’s that jumping forward looks different from the example where we jumped backwards. The limitation is that continuations can’t actually jump <em>forwards</em>, at least not between method calls. The reason is that in C, labels are compiled into the program statically, but in Ruby, the continuation objects are created at runtime. This means that we’d need to execute that callcc call in our future method to generate the continuation, but we can’t run code that hasn’t yet been run. In short, continuations are great for jumping back in time, not quite so for jumping forwards.</p>
<h3>Final Correction</h3>
<p>So I initially called continuations “glorified gotos”. Hopefully this got you to understand the simple concept behind their use; but now I should fess up and modify the definition just a little bit to be slightly more accurate. Instead of glorified gotos, think of continuations as:</p>
<h2>GLORIFIED, <u>STATEFUL, BACKWARDS JUMPING,</u> GOTOs</h2>
<p>Now that you know what the fuss is about, you can decide to hate continuations all you want.</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2009/03/21/demystifying-continuations-in-ruby/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ruby 1.9 Common Problems Pt. 1: Encoding</title>
		<link>http://gnuu.org/2009/02/02/ruby-19-common-problems-pt-1-encoding/</link>
		<comments>http://gnuu.org/2009/02/02/ruby-19-common-problems-pt-1-encoding/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 06:05:41 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[BlueCloth]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[problems]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby 1.9]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[unicode]]></category>

		<guid isPermaLink="false">http://gnuu.org/2009/02/02/ruby-19-common-problems-pt-1-encoding/</guid>
		<description><![CDATA[If you’re migrating from Ruby 1.8.x to 1.9 you probably have run into one of the following error messages: invalid multibyte char (US-ASCII) - OR - CompatibilityError: incompatible encoding regexp match (Windows-31J regexp with UTF-8 string) The errors themselves are relatively self-explanatory. Ruby 1.9 is far more Unicode aware than 1.8, and this error happens [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re migrating from Ruby 1.8.x to 1.9 you probably have run into one of the following error messages:</p>
<p><code class="dark">invalid multibyte char (US-ASCII)</code></p>
<p>- OR -</p>
<p><code class="dark">CompatibilityError: incompatible encoding regexp match (Windows-31J regexp with UTF-8 string)</code></p>
<p>The errors themselves are relatively self-explanatory. Ruby 1.9 is far more Unicode aware than 1.8, and this error happens when have some Unicode (usually UTF-8) in one of your files. What you have to do to fix these, however, is not always as straightforward.</p>
<p>Well, after some time pulling my hair out, I&#8217;ve figure out that the solutions to these issues are actually quite simple. </p>
<h3>Invalid multibyte char (encoding here)</h3>
<p>If you get this issue, add the following to the top of each exploding file (below the <a href="http://en.wikipedia.org/wiki/Shebang_(Unix)">shebang</a> if there is one):</p>
<pre class="dark"># encoding: utf-8</pre>
<p style="border-right: #ccc 1px solid; padding-right: 7px; border-top: #ccc 1px solid; padding-left: 7px; font-size: 0.8em; background: #eee; padding-bottom: 7px; margin: 7px; border-left: #ccc 1px solid; padding-top: 7px; border-bottom: #ccc 1px solid"><strong>Note:</strong> You can also use &quot;coding:&quot; or even the Emacs style <tt>-*- encoding: utf-8 -*-</tt> but I like the simple term, &#8216;encoding&#8217;. Also note that you might need to replace &#8216;utf-8&#8242; wth your specific encoding if it&#8217;s something else.</p>
<p>This should resolve the issue.</p>
<p>Basically, Ruby by default assumes that every file is encoded as US-ASCII, and so when it reads UTF-8 (or any Unicode) it freaks out because it is beyond the 7-bit encoding. You have to tell it that the file is encoded as utf-8 by listing it as we did at the top of the file. Yes, it&#8217;s a little anal, but I&#8217;m sure we&#8217;ll get used to it.</p>
<h3>Incompatible encoding regexp match</h3>
<p>This issue is a little bit hairier. I had this problem with the <a href="http://www.deveiate.org/projects/BlueCloth/">BlueCloth</a> 1.0.0 gem (on line 972 of bluecloth.rb). It turns out that there are a <a href="http://www.zenspider.com/Languages/Ruby/QuickRef.html#11">few switches</a> that turn on specific encodings, and for some reason BlueCloth turns on the <tt>//s</tt> switch which enables the SJIS encoding (maybe <a href="http://daringfireball.net/">John Gruber</a> wanted <tt>//m</tt> for multiline?). Ruby 1.8 didn&#8217;t mind having this on, but 1.9 freaks out. Moral of the story, when you see this error, check your Regexp switches.</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2009/02/02/ruby-19-common-problems-pt-1-encoding/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Making a Basic HTTP Request in Eiffel (and a rant)</title>
		<link>http://gnuu.org/2008/09/19/a-basic-http-req-in-eiffel-and-rant/</link>
		<comments>http://gnuu.org/2008/09/19/a-basic-http-req-in-eiffel-and-rant/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 04:57:34 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[design by contract]]></category>
		<category><![CDATA[eiffel]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[sockets]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://gnuu.org/2008/09/19/a-basic-http-req-in-eiffel-and-rant/</guid>
		<description><![CDATA[<p>I originally just wanted to post my findings on implementing an HTTP client to serve as an example to others learning Eiffel, but I realized that the importance of the following example would be lost on many people without a little background on the subject and felt like an explanation in the form of a rant should also be included. Therefore, if you're just looking for the example, scroll down to the later sections and take a look. Otherwise, keep reading.</p> ]]></description>
			<content:encoded><![CDATA[<p>I originally just wanted to post my findings on implementing an HTTP client to serve as an example to others learning Eiffel, but I realized that the importance of the following example would be lost on many people without a little background on the subject and felt like an explanation in the form of a rant should also be included. Therefore, if you&#8217;re just looking for the example, scroll down to the later sections and take a look. Otherwise, keep reading.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2008/09/19/a-basic-http-req-in-eiffel-and-rant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Very Flat Merb Projects, New in 0.9.0</title>
		<link>http://gnuu.org/2008/02/15/very-flat-merb-projects-new-in-090/</link>
		<comments>http://gnuu.org/2008/02/15/very-flat-merb-projects-new-in-090/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 23:41:12 +0000</pubDate>
		<dc:creator>Loren Segal</dc:creator>
				<category><![CDATA[post]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[microframework]]></category>
		<category><![CDATA[miniframework]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://gnuu.org/2008/02/15/very-flat-merb-projects-new-in-090/</guid>
		<description><![CDATA[Man oh man am I happy. I recently discovered Merb, a more lightweight thread-safe alternative to Ruby on Rails. I might devote an entire post to this framework because there&#8217;s a lot to be said, but I want to get this off my chest. I need a mini-framework I&#8217;ve been looking at all these different [...]]]></description>
			<content:encoded><![CDATA[<p>Man oh man am I happy. I recently discovered <a title="Merb: Ruby Framework" href="http://www.merbivore.com">Merb</a>, a more lightweight <strong>thread-safe</strong> alternative to <em>Ruby on Rails</em>. I might devote an entire post to this framework because there&#8217;s a lot to be said, but I want to get this off my chest. </p>
<h3>I need a mini-framework</h3>
<p>I&#8217;ve been looking at all these different frameworks to find something that can run more efficiently on my tiny little ghetto server, because I don&#8217;t have the resources to run these memory hogging rails apps for my relatively tiny websites. I really need a small framework for the kind of apps I make. You know, pull out a quick blog, wiki, or other, with no DB access at all. What about <a title="Camping: a Microframework" href="http://code.whytheluckystiff.net/camping/">Camping</a>? No, that&#8217;s a little too small. I settled on Merb. Merb is considerably bulkier than Camping, and for a bit I was wondering if even it was too much, until now&#8230;</p>
<p>The Merb guys have just <a title="Merb 0.9.0" href="http://gweezlebur.com/2008/2/14/merb-0-9-0-released-kinda">released a developer version 0.9.0</a> which has some neat changes, but what definitely caught my eye was (from the last few lines of the post) the <tt>--very-flat</tt> option for the application template generator. No need to explain, I&#8217;ll just <em>show</em> you how awesome it is:</p>
<pre lang="bash">titanium:merb jinx$ merb-gen blog --very-flat
Fri, 15 Feb 2008 22:57:23 GMT ~ Not Using Sessions
RubiGen::Scripts::Generate
      create  /blog.rb
      create  /README.txt</pre>
<p>Now, if we load up the <strong>one</strong> file created for our project: </p>
<pre lang="ruby">Merb::Router.prepare do |r|
  r.match('/').to(:controller => 'blog', :action => 'index')
end

class Blog < Merb::Controller
  def index
    "hi"
  end
end

Merb::Config.use { |c|
  c[:framework]           = {},
  c[:session_store]       = 'none',
  c[:exception_details]   = true
}</pre>
<p><big>BAM!</big></p>
<p><strong>Imagine that?</strong> That's all there is to our app. That's the <em>entire source code</em>-- program logic, configuration <em>and</em> support files. It's fully executable as its own application with the command <tt>merb -I blog</tt>. Microframework indeed. Granted, it's pulling all of the '<tt>merb-core</tt>' gem, but that's pretty small. This code is super portable (in the <em>put-it-on-a-usb-key</em> sense, not the <em>platform-to-platform</em> sense) and really quick to develop with. Step aside, <em>Camping</em>.</p>
<p>Granted, I don't think I'll use this method of development since it's the same reason I won't use Camping, but it's nice to know I can drop down to the really simple level if I need to just prototype one quick &quot;one-button&quot; app and still have room to grow it out. The fact that Merb <em>can</em> actually do this is what's most mindblowing. It's a true testament to the modularity and extensibility of the framework's design. Getting Rails to run without <em>ActiveRecord</em> is a pain enough, let alone pulling out everything but routing and controllers.</p>]]></content:encoded>
			<wfw:commentRss>http://gnuu.org/2008/02/15/very-flat-merb-projects-new-in-090/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
