<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: A question for Rubyists</title>
	<atom:link href="http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Fri, 17 May 2013 09:02:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Roco</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2617</link>
		<dc:creator>Roco</dc:creator>
		<pubDate>Tue, 21 Sep 2010 10:41:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2617</guid>
		<description>Scott,

That really helped clarify a few things for me. Thanks again.

I will continue on with Rails first. At least that gives me some established structure to work with as I learn the ropes.


</description>
		<content:encoded><![CDATA[<p>Scott,</p>
<p>That really helped clarify a few things for me. Thanks again.</p>
<p>I will continue on with Rails first. At least that gives me some established structure to work with as I learn the ropes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Bellware</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2616</link>
		<dc:creator>Scott Bellware</dc:creator>
		<pubDate>Tue, 21 Sep 2010 04:20:15 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2616</guid>
		<description>Roco,

I wouldn&#039;t start with trying to replace classes with callable objects like blocks, procs, or lambdas. There are classes in Ruby and OO is still a perfectly good way to represent abstractions. I don&#039;t avoid using classes, in fact, I use them more often then other kinds of representations. But I also use modules, and there are a whole other set of ideas that go along with modeling compositions with modules, and with dealing with the particularities of modules.

The only way to practice not thinking in terms of interface types, or not thinking n terms of types at all, is to force yourself to not think in those terms. If you pick at it, it will just continue to itch. Just stop thinking that way until it becomes natural.

Everyone experiences the panic of not doing things with interfaces and abstract types. You just have to take the step knowing that there&#039;s going to be ground under your feet and there&#039;s no fall waiting for you.

The challenge with using ActiveRecord models, frankly, is often more cultural that technological. Moving away from the DDD patterns to ActiveRecord initially feels like taking a step backward in what &quot;proper&quot; design should be, but it&#039;s that drive for &quot;properness&quot; or &quot;purity&quot; that drives a lot of people to get caught up in the DDD orthodoxy without understanding why.

It&#039;s a bit cold, but there&#039;s really only one thing you can do: get over it. It is, in fact, something to get over. If I were working in .NET, though, I&#039;d still create modules for persistence that are separate from model logic. That&#039;s because .NET dependencies are static dependencies and this constraint means pre-formulating strict separation before hand.

If you used the Active Record pattern in .NET, it would likely lead to less overall simplicity as a measure of simplicity for the whole effort and the whole system, while in Ruby, the absence of static dependencies allows systemic simplicity to be sustained.

Ultimately, it&#039;s a cognitive pattern that has to be overcome; what I called &quot;un-learning&quot;. It&#039;s much harder to un-learn than to learn. Adding new habits to a blank slate is more work that moving existing habits aside while also doing the work to form new habits.

Ultimately, if everything could be learned without the formation of attachments like habits, it would all be a lot easier. But in the face of habitual patterns, the only thing to do is recognize their presence, and move on despite all of their protests about how &quot;unnatural&quot; these new patterns are.

That&#039;s why I think it&#039;s so much easier to start at Rails. At least with Rails, you don&#039;t have to start from scratch, and your code can largely be held in an outer structure that lets you start with the basics of plain old class-oriented development that you already know.

One more thing about Rails, though: there&#039;s no need for those Domain Service patterns in Rails. All of that code belongs in the model objects. And that can be one hell of a hurdle for .NET developers with the DDD pattern language bug - maybe even harder to accept that ActiveRecord in some cases. Nonetheless, it&#039;s an exercise you have to undertake to make the transition.

The one advantage you already have over many Rails developers is that Rails developers often believe that the only archetypes in a Rails app are models, views, and controllers. Many Rails devs suffer from their own orthodoxy that leads to the unquestioned belief that all classes with code are model objects.

You already know that there&#039;s more to a MVC app than models, views, and controllers. What you might not already know is that there are far fewer of those other classes than you likely need. But working in Rails and in the Rails ecosystem will show you all these things, and you&#039;ll have to temper what you hear with your own experience, and you&#039;ll have to temper your own habits. It&#039;s a fine balancing act, and you&#039;ll inevitably fall back to C# habits. Just question them and become more aware of them. One day, you might even have legitimate questions about the Rails way, once you get a firm grip on on the subtleties.</description>
		<content:encoded><![CDATA[<p>Roco,</p>
<p>I wouldn&#8217;t start with trying to replace classes with callable objects like blocks, procs, or lambdas. There are classes in Ruby and OO is still a perfectly good way to represent abstractions. I don&#8217;t avoid using classes, in fact, I use them more often then other kinds of representations. But I also use modules, and there are a whole other set of ideas that go along with modeling compositions with modules, and with dealing with the particularities of modules.</p>
<p>The only way to practice not thinking in terms of interface types, or not thinking n terms of types at all, is to force yourself to not think in those terms. If you pick at it, it will just continue to itch. Just stop thinking that way until it becomes natural.</p>
<p>Everyone experiences the panic of not doing things with interfaces and abstract types. You just have to take the step knowing that there&#8217;s going to be ground under your feet and there&#8217;s no fall waiting for you.</p>
<p>The challenge with using ActiveRecord models, frankly, is often more cultural that technological. Moving away from the DDD patterns to ActiveRecord initially feels like taking a step backward in what &#8220;proper&#8221; design should be, but it&#8217;s that drive for &#8220;properness&#8221; or &#8220;purity&#8221; that drives a lot of people to get caught up in the DDD orthodoxy without understanding why.</p>
<p>It&#8217;s a bit cold, but there&#8217;s really only one thing you can do: get over it. It is, in fact, something to get over. If I were working in .NET, though, I&#8217;d still create modules for persistence that are separate from model logic. That&#8217;s because .NET dependencies are static dependencies and this constraint means pre-formulating strict separation before hand.</p>
<p>If you used the Active Record pattern in .NET, it would likely lead to less overall simplicity as a measure of simplicity for the whole effort and the whole system, while in Ruby, the absence of static dependencies allows systemic simplicity to be sustained.</p>
<p>Ultimately, it&#8217;s a cognitive pattern that has to be overcome; what I called &#8220;un-learning&#8221;. It&#8217;s much harder to un-learn than to learn. Adding new habits to a blank slate is more work that moving existing habits aside while also doing the work to form new habits.</p>
<p>Ultimately, if everything could be learned without the formation of attachments like habits, it would all be a lot easier. But in the face of habitual patterns, the only thing to do is recognize their presence, and move on despite all of their protests about how &#8220;unnatural&#8221; these new patterns are.</p>
<p>That&#8217;s why I think it&#8217;s so much easier to start at Rails. At least with Rails, you don&#8217;t have to start from scratch, and your code can largely be held in an outer structure that lets you start with the basics of plain old class-oriented development that you already know.</p>
<p>One more thing about Rails, though: there&#8217;s no need for those Domain Service patterns in Rails. All of that code belongs in the model objects. And that can be one hell of a hurdle for .NET developers with the DDD pattern language bug &#8211; maybe even harder to accept that ActiveRecord in some cases. Nonetheless, it&#8217;s an exercise you have to undertake to make the transition.</p>
<p>The one advantage you already have over many Rails developers is that Rails developers often believe that the only archetypes in a Rails app are models, views, and controllers. Many Rails devs suffer from their own orthodoxy that leads to the unquestioned belief that all classes with code are model objects.</p>
<p>You already know that there&#8217;s more to a MVC app than models, views, and controllers. What you might not already know is that there are far fewer of those other classes than you likely need. But working in Rails and in the Rails ecosystem will show you all these things, and you&#8217;ll have to temper what you hear with your own experience, and you&#8217;ll have to temper your own habits. It&#8217;s a fine balancing act, and you&#8217;ll inevitably fall back to C# habits. Just question them and become more aware of them. One day, you might even have legitimate questions about the Rails way, once you get a firm grip on on the subtleties.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roco</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2615</link>
		<dc:creator>Roco</dc:creator>
		<pubDate>Mon, 20 Sep 2010 22:56:12 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2615</guid>
		<description>Scott,

That makes sense. During my initial explorations of Rails I instantly noticed how they stepped away from some of the DDD hallmarks in favor of a more simple approach. The models are aware of their persistence to an extent, which was hard for me to deal with at first.  Regardless, in hindsight my repository example was stupid as it doesn&#039;t really apply here ;)

I guess what I am struggling with, is how can I train myself to stop thinking in terms of defining behavior in the form of an interface or abstract class construct that is essentially &quot;fixed&quot;, and instead do it the ruby way. More specifically, how do I replace the interface/ class dependency approach with a more dynamic approach using things like code blocks in Ruby? It still eludes me.

</description>
		<content:encoded><![CDATA[<p>Scott,</p>
<p>That makes sense. During my initial explorations of Rails I instantly noticed how they stepped away from some of the DDD hallmarks in favor of a more simple approach. The models are aware of their persistence to an extent, which was hard for me to deal with at first.  Regardless, in hindsight my repository example was stupid as it doesn&#8217;t really apply here <img src='http://lostechies.com/jimmybogard/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I guess what I am struggling with, is how can I train myself to stop thinking in terms of defining behavior in the form of an interface or abstract class construct that is essentially &#8220;fixed&#8221;, and instead do it the ruby way. More specifically, how do I replace the interface/ class dependency approach with a more dynamic approach using things like code blocks in Ruby? It still eludes me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Bellware</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2614</link>
		<dc:creator>Scott Bellware</dc:creator>
		<pubDate>Mon, 20 Sep 2010 22:07:55 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2614</guid>
		<description>Roco,

In Rails apps, for example, there&#039;s no corollary to a repository class. It&#039;s not really needed, and the Rails community never got involved in using Domain-Driven Design that way.

So, this kind of comparison, as I mentioned earlier, isn&#039;t one that can be made point-for-point.

Nonetheless, let&#039;s say that you&#039;re using something like Sequel in Ruby rather than ActiveRecord, and if you&#039;re doing class-oriented programming exclusively, then you might indeed have something like a repository.

So, if I had a controller class that made use of a repository class, the controller code would likely instantiate the repository by calling its contsructor, or would get an existing the repository instance from some kind of Singleton pattern implementation.

There&#039;s not much to show here beyond SomeRepository.new - unless of course you&#039;re writing a framework. But like I said, writing a framework at this stage of learning might be a very bad idea.

The comparisons break down because the design patterns can be quite different, and desing can be modularized quite differently to reflect the capabilities of the raw materials of the design. The primary raw material is the language you&#039;re using.

Specifically to your question, yes, you &quot;new them up in the ctor&quot;. But be wary of what you presume about &quot;default implementations&quot;, because this is part of an unrecognized bias of working in a pre-compiled class-oriented language.

The only time you have a default implementation in Ruby is when you choose to.

With C#, what you see in the editor is what you get. It&#039;s all default implementations - all the way down to the turtles.

Even an implementation of an interface type - even though you might not see it as a default implementation - is indeed a default implementation. It&#039;s just a replaceable implementation - but only at a class level. The class itself always defaults to the one and only implementation that it has.

If you want a default implementation to be anything different in C#, you&#039;ve gotta irradiate the turtles in an attempt to re-write their genetic code so that they&#039;ll carry your default implementations differently.</description>
		<content:encoded><![CDATA[<p>Roco,</p>
<p>In Rails apps, for example, there&#8217;s no corollary to a repository class. It&#8217;s not really needed, and the Rails community never got involved in using Domain-Driven Design that way.</p>
<p>So, this kind of comparison, as I mentioned earlier, isn&#8217;t one that can be made point-for-point.</p>
<p>Nonetheless, let&#8217;s say that you&#8217;re using something like Sequel in Ruby rather than ActiveRecord, and if you&#8217;re doing class-oriented programming exclusively, then you might indeed have something like a repository.</p>
<p>So, if I had a controller class that made use of a repository class, the controller code would likely instantiate the repository by calling its contsructor, or would get an existing the repository instance from some kind of Singleton pattern implementation.</p>
<p>There&#8217;s not much to show here beyond SomeRepository.new &#8211; unless of course you&#8217;re writing a framework. But like I said, writing a framework at this stage of learning might be a very bad idea.</p>
<p>The comparisons break down because the design patterns can be quite different, and desing can be modularized quite differently to reflect the capabilities of the raw materials of the design. The primary raw material is the language you&#8217;re using.</p>
<p>Specifically to your question, yes, you &#8220;new them up in the ctor&#8221;. But be wary of what you presume about &#8220;default implementations&#8221;, because this is part of an unrecognized bias of working in a pre-compiled class-oriented language.</p>
<p>The only time you have a default implementation in Ruby is when you choose to.</p>
<p>With C#, what you see in the editor is what you get. It&#8217;s all default implementations &#8211; all the way down to the turtles.</p>
<p>Even an implementation of an interface type &#8211; even though you might not see it as a default implementation &#8211; is indeed a default implementation. It&#8217;s just a replaceable implementation &#8211; but only at a class level. The class itself always defaults to the one and only implementation that it has.</p>
<p>If you want a default implementation to be anything different in C#, you&#8217;ve gotta irradiate the turtles in an attempt to re-write their genetic code so that they&#8217;ll carry your default implementations differently.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roco</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2613</link>
		<dc:creator>Roco</dc:creator>
		<pubDate>Mon, 20 Sep 2010 21:10:59 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2613</guid>
		<description>Scott -

Thank you for taking the time to respond. I am already on the path to learning Ruby and at the same time &quot;unlearning&quot; my C# habits at the same time.

Still, I would like to see a little bit of code. Not an enterprise app, but something very small. For example, some class that takes an IRepository or ISomeService to coordinate and do some work. In C# we may only have one implementation of these interfaces but use these abstractions to promote good design and testability. What does the Ruby version look like? Do we just new them up in the ctor with default implementations as you may be hinting at? </description>
		<content:encoded><![CDATA[<p>Scott -</p>
<p>Thank you for taking the time to respond. I am already on the path to learning Ruby and at the same time &#8220;unlearning&#8221; my C# habits at the same time.</p>
<p>Still, I would like to see a little bit of code. Not an enterprise app, but something very small. For example, some class that takes an IRepository or ISomeService to coordinate and do some work. In C# we may only have one implementation of these interfaces but use these abstractions to promote good design and testability. What does the Ruby version look like? Do we just new them up in the ctor with default implementations as you may be hinting at? </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Bellware</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2612</link>
		<dc:creator>Scott Bellware</dc:creator>
		<pubDate>Mon, 20 Sep 2010 20:25:52 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2612</guid>
		<description>Roco and Steve,

I want to reiterate, as I have for many years, that material serves one level of learning - the beginning, and that experience serves everything that comes after the beginning. Far from being armchair philosophy, it&#039;s something that is observed by people who make transitions from the basics of practices, to intuitive mastery of practices.

Unless you&#039;ve realized this for yourself, you will continue to have every confidence that what you know about learning is true of all of learning.

I&#039;m not holding anything back. I spend one hell of a lot of time teaching face-to-face because I know that material learning just doesn&#039;t cut it. In fact, all it can do is get you started.

I know that you want to see point for point comparisons of C# to Ruby. I know that point for point comparisons don&#039;t do much more than reinforce the one-sided understandings that we already have.

I understand that this is a frustrating answer, but it&#039;s the real answer, and it&#039;s an answer that will be given to you by anyone who has experienced the breakthroughs, a-ha moments, and epiphanies of learning, and more difficultly, the realizations of un-learning.

As a more practical matter, I personally can&#039;t afford to invest in building such materials, And because my experience in both learning and teaching has shown me that these things don&#039;t really bridge the gap as we think they might from the outside, I&#039;m reticent to invest in that kind of material. It&#039;s not the kind of teaching I do, and I&#039;ve never seen anyone do it effectively, and do it without creating yet more misunderstanding.

The learning return on that kind of teaching investment is too little for me to invest into it as a teacher - no matter how much you believe you&#039;ll learn from it. I&#039;m not saying this as an armchair philosopher, I&#039;m saying it as an experienced philosopher - in a very literal sense of &quot;philosophy&quot;.

Here&#039;s what you can do right now that will indeed clear up all of this lack of understanding: build an application on Rails. Or better yet, build a business on an application built on Rails. While you&#039;re doing it, keep an eye out for difficulties that you feel would be solved with dependency injection. I think you&#039;ll find vastly fewer of them than you might expect. In the mean time, you&#039;ll have built an app and maybe even a business. And in the process, you&#039;ll have undertaken experiences in learning, and more importantly, in un-learning; in recognizing unconscious biases that direct our ability to learn.

So, you could require me invest in creating a curriculum of material to demonstrate something that I&#039;m very confident won&#039;t have a profound effect, or you could make an investment in understanding on your own by installing Rails, watching some screen casts, reading a book (or three), and using practice and experience to shake loose the un-learning that does create realization.

If you believe that it&#039;s my responsibility to spoon feed any petitioner to greater understanding, then I&#039;ve failed to clarify my position on this kind of learning and teaching over the past five or six years.

Nonetheless, and with great sympathy for your predicament, I&#039;ll offer this: I can&#039;t show you a point-for-point comparison between C# using interfaces and dependency injection and Ruby. These are structural design issues, and they can be very different in either language. And where they&#039;re similar, they&#039;re only profanely similar; the powerful pervasive subtle differences aren&#039;t revealed. They&#039;re revealed through practice.

But a little bit of indulgence nonetheless...

At a very high level though, there are no interface types in Ruby, so there would be no interfaces types. And there&#039;s very little need for an object container in Ruby, so there&#039;d be no dependency injection framework as per what &quot;dependency injection framework&quot; means in C#.

That said, if you&#039;re writing a framework, you&#039;re going to come across dependency management issues. But if the first thing you do in Ruby is invest your C# biases in a new framework in a language that you don&#039;t have fluency with yet, you&#039;re probably letting yourself get ahead of yourself.

And if you&#039;re writing application code within a framework context like Rails, you&#039;re extremely unlikely to need a dependency injection framework and an object container.

What will you use other than static dependency injection? Non-static dependencies - because all dependencies in Ruby are non-static. What&#039;s in the code is just a &quot;hint&quot;. You&#039;ll use object constructors, and Singleton patterns. At a more advanced level, when creating plugins and frameworks, you might add lazy evaluation patterns and configuration patterns.

Specifically, take any C# code that isn&#039;t framework code, remove the interfaces and remove the dependency injection. Replace the dependency injection with calls to constructors (also called &quot;initializers&quot; in Ruby) and Singleton patterns.

At that point, you&#039;ll have the material in our hands that is a beginning to a comparison between C# and Ruby. Heck, you could do this in C# to see what the Ruby might look like, but it still won&#039;t be too terribly representative, and that&#039;s because you can&#039;t represent Ruby thinking with C# thinking, no more than you can represent C# thinking with UML thinking.

To get Ruby, do Ruby. To overcome C# bias enough to get Ruby, do Rails. To get Rails, do something real with it. I&#039;ll eat my hat, your hat, and the collective hats of the entire community if you don&#039;t come back later and corroborate everything I&#039;ve said here - even the stuff that you believe is armchair philosophy.

I&#039;m not trying to be evasive here. I want you to know as much as you need to get an understanding. But I am saying that this kind of understanding is had through experience, and in this case, it&#039;s not experience, that is difficult to get your hands on. It&#039;s not esoteric, it&#039;s just presently obscured.</description>
		<content:encoded><![CDATA[<p>Roco and Steve,</p>
<p>I want to reiterate, as I have for many years, that material serves one level of learning &#8211; the beginning, and that experience serves everything that comes after the beginning. Far from being armchair philosophy, it&#8217;s something that is observed by people who make transitions from the basics of practices, to intuitive mastery of practices.</p>
<p>Unless you&#8217;ve realized this for yourself, you will continue to have every confidence that what you know about learning is true of all of learning.</p>
<p>I&#8217;m not holding anything back. I spend one hell of a lot of time teaching face-to-face because I know that material learning just doesn&#8217;t cut it. In fact, all it can do is get you started.</p>
<p>I know that you want to see point for point comparisons of C# to Ruby. I know that point for point comparisons don&#8217;t do much more than reinforce the one-sided understandings that we already have.</p>
<p>I understand that this is a frustrating answer, but it&#8217;s the real answer, and it&#8217;s an answer that will be given to you by anyone who has experienced the breakthroughs, a-ha moments, and epiphanies of learning, and more difficultly, the realizations of un-learning.</p>
<p>As a more practical matter, I personally can&#8217;t afford to invest in building such materials, And because my experience in both learning and teaching has shown me that these things don&#8217;t really bridge the gap as we think they might from the outside, I&#8217;m reticent to invest in that kind of material. It&#8217;s not the kind of teaching I do, and I&#8217;ve never seen anyone do it effectively, and do it without creating yet more misunderstanding.</p>
<p>The learning return on that kind of teaching investment is too little for me to invest into it as a teacher &#8211; no matter how much you believe you&#8217;ll learn from it. I&#8217;m not saying this as an armchair philosopher, I&#8217;m saying it as an experienced philosopher &#8211; in a very literal sense of &#8220;philosophy&#8221;.</p>
<p>Here&#8217;s what you can do right now that will indeed clear up all of this lack of understanding: build an application on Rails. Or better yet, build a business on an application built on Rails. While you&#8217;re doing it, keep an eye out for difficulties that you feel would be solved with dependency injection. I think you&#8217;ll find vastly fewer of them than you might expect. In the mean time, you&#8217;ll have built an app and maybe even a business. And in the process, you&#8217;ll have undertaken experiences in learning, and more importantly, in un-learning; in recognizing unconscious biases that direct our ability to learn.</p>
<p>So, you could require me invest in creating a curriculum of material to demonstrate something that I&#8217;m very confident won&#8217;t have a profound effect, or you could make an investment in understanding on your own by installing Rails, watching some screen casts, reading a book (or three), and using practice and experience to shake loose the un-learning that does create realization.</p>
<p>If you believe that it&#8217;s my responsibility to spoon feed any petitioner to greater understanding, then I&#8217;ve failed to clarify my position on this kind of learning and teaching over the past five or six years.</p>
<p>Nonetheless, and with great sympathy for your predicament, I&#8217;ll offer this: I can&#8217;t show you a point-for-point comparison between C# using interfaces and dependency injection and Ruby. These are structural design issues, and they can be very different in either language. And where they&#8217;re similar, they&#8217;re only profanely similar; the powerful pervasive subtle differences aren&#8217;t revealed. They&#8217;re revealed through practice.</p>
<p>But a little bit of indulgence nonetheless&#8230;</p>
<p>At a very high level though, there are no interface types in Ruby, so there would be no interfaces types. And there&#8217;s very little need for an object container in Ruby, so there&#8217;d be no dependency injection framework as per what &#8220;dependency injection framework&#8221; means in C#.</p>
<p>That said, if you&#8217;re writing a framework, you&#8217;re going to come across dependency management issues. But if the first thing you do in Ruby is invest your C# biases in a new framework in a language that you don&#8217;t have fluency with yet, you&#8217;re probably letting yourself get ahead of yourself.</p>
<p>And if you&#8217;re writing application code within a framework context like Rails, you&#8217;re extremely unlikely to need a dependency injection framework and an object container.</p>
<p>What will you use other than static dependency injection? Non-static dependencies &#8211; because all dependencies in Ruby are non-static. What&#8217;s in the code is just a &#8220;hint&#8221;. You&#8217;ll use object constructors, and Singleton patterns. At a more advanced level, when creating plugins and frameworks, you might add lazy evaluation patterns and configuration patterns.</p>
<p>Specifically, take any C# code that isn&#8217;t framework code, remove the interfaces and remove the dependency injection. Replace the dependency injection with calls to constructors (also called &#8220;initializers&#8221; in Ruby) and Singleton patterns.</p>
<p>At that point, you&#8217;ll have the material in our hands that is a beginning to a comparison between C# and Ruby. Heck, you could do this in C# to see what the Ruby might look like, but it still won&#8217;t be too terribly representative, and that&#8217;s because you can&#8217;t represent Ruby thinking with C# thinking, no more than you can represent C# thinking with UML thinking.</p>
<p>To get Ruby, do Ruby. To overcome C# bias enough to get Ruby, do Rails. To get Rails, do something real with it. I&#8217;ll eat my hat, your hat, and the collective hats of the entire community if you don&#8217;t come back later and corroborate everything I&#8217;ve said here &#8211; even the stuff that you believe is armchair philosophy.</p>
<p>I&#8217;m not trying to be evasive here. I want you to know as much as you need to get an understanding. But I am saying that this kind of understanding is had through experience, and in this case, it&#8217;s not experience, that is difficult to get your hands on. It&#8217;s not esoteric, it&#8217;s just presently obscured.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2611</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 20 Sep 2010 19:29:03 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2611</guid>
		<description>I worded that poorly.  There are plenty of good sites to go look at Ruby code, but it seems that so much isn&#039;t in the &quot;Ruby Way&quot; (i.e. Tests are rarely shown, etc.)

I&#039;d love to see a github repository of a Rails (or Sinatra app) that is coded the &quot;Ruby Way&quot; with complete tests, exception handling, etc. that I could use as a nice guide.  </description>
		<content:encoded><![CDATA[<p>I worded that poorly.  There are plenty of good sites to go look at Ruby code, but it seems that so much isn&#8217;t in the &#8220;Ruby Way&#8221; (i.e. Tests are rarely shown, etc.)</p>
<p>I&#8217;d love to see a github repository of a Rails (or Sinatra app) that is coded the &#8220;Ruby Way&#8221; with complete tests, exception handling, etc. that I could use as a nice guide.  </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2610</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 20 Sep 2010 18:53:03 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2610</guid>
		<description>Scott,

I think Roco hit the nail on the head there.  I don&#039;t even need the C# version for the code, although someone writing a blog post showing both would be fantastic.

I&#039;m sold that Ruby is &quot;better&quot;, I&#039;m sold that having a framework with testing/DI baked in is &quot;better&quot;, now I just need to see some good examples of it, and unfortunately, they&#039;re not that easy to find.
</description>
		<content:encoded><![CDATA[<p>Scott,</p>
<p>I think Roco hit the nail on the head there.  I don&#8217;t even need the C# version for the code, although someone writing a blog post showing both would be fantastic.</p>
<p>I&#8217;m sold that Ruby is &#8220;better&#8221;, I&#8217;m sold that having a framework with testing/DI baked in is &#8220;better&#8221;, now I just need to see some good examples of it, and unfortunately, they&#8217;re not that easy to find.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roco</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2609</link>
		<dc:creator>Roco</dc:creator>
		<pubDate>Mon, 20 Sep 2010 18:18:56 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2609</guid>
		<description>I&#039;d like to echo the requests for seeing some code. All of this is very interesting, but some times too much armchair philosophy leads to confusion for Ruby newbies like myself. 

How about something like, &quot;Here is an example of a common task as it would be implemented in C# using interfaces, IoC container, i.e. standard C# practices, and now here it is in Ruby.&quot;

It can be a trivial example, just something that highlights all of the topics that have been touched on at length  in recent posts/comments.

As a Ruby newbie, I would really appreciate it.</description>
		<content:encoded><![CDATA[<p>I&#8217;d like to echo the requests for seeing some code. All of this is very interesting, but some times too much armchair philosophy leads to confusion for Ruby newbies like myself. </p>
<p>How about something like, &#8220;Here is an example of a common task as it would be implemented in C# using interfaces, IoC container, i.e. standard C# practices, and now here it is in Ruby.&#8221;</p>
<p>It can be a trivial example, just something that highlights all of the topics that have been touched on at length  in recent posts/comments.</p>
<p>As a Ruby newbie, I would really appreciate it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Bellware</title>
		<link>http://lostechies.com/jimmybogard/2010/09/17/a-question-for-rubyists/#comment-2608</link>
		<dc:creator>Scott Bellware</dc:creator>
		<pubDate>Mon, 20 Sep 2010 17:39:15 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/09/17/a-question-for-rubyists.aspx#comment-2608</guid>
		<description>Steve,

What is it specifically that you want an example of?

I&#039;m asking because some things can be exemplified in materials (code, etc) and some things can be exemplified in experiences (doing, practicing, learning, realizing).

If what you&#039;re looking for can be exemplified in material, I&#039;ll do my best to point you to it. But if it&#039;s something that can be exemplified in experiences, I hope that you won&#039;t be put off if I say that you can only see it through the lens of your own breakthroughs - just as Greg has with a growing awareness of intention-revealing interfaces.</description>
		<content:encoded><![CDATA[<p>Steve,</p>
<p>What is it specifically that you want an example of?</p>
<p>I&#8217;m asking because some things can be exemplified in materials (code, etc) and some things can be exemplified in experiences (doing, practicing, learning, realizing).</p>
<p>If what you&#8217;re looking for can be exemplified in material, I&#8217;ll do my best to point you to it. But if it&#8217;s something that can be exemplified in experiences, I hope that you won&#8217;t be put off if I say that you can only see it through the lens of your own breakthroughs &#8211; just as Greg has with a growing awareness of intention-revealing interfaces.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
