SlideShare a Scribd company logo
by Jon Kruger
Independent consultant in Columbus, OH
.NET, Ruby on Rails, Agile

Email: jon@jonkruger.com
Twitter: @JonKruger
Blog: http://jonkruger.com/blog
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
public void Page_Load(Object sender, EventArgs e)
{




}
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
“Sometimes I want to do Ruby
because it means that I’m more likely
to be able to do TDD.”

                     -- Greg Malcolm
“I feel like the shackles have been
taken off.”

                      -- Leon Gersing
public interface IGetObjectService<T> where T : EntityBase
{
   public T Get(int id);
   public IList<T> GetAll();
}

public class GetObjectService<T> : IGetObjectService<T>
{
   public GetObjectService(IRepository<T> repository) { }

    public T Get(int id) { ... }
    public IList<T> GetAll() { ... }
}
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
ASP .NET MVC and Rails are very similar
Learning the Ruby/UNIX way
You can do more with less code
create table Users
(
    id int,
    name varchar(100),
    user_status_id int,
    created_at datetime,
    updated_at datetime
)

class User < ActiveRecord::Base
  belongs_to :user_status
  has_many :roles, :through => :user_roles
  validates_length_of :name, :maximum => 100
  named_scope :active,
              :conditions => ["user_status.id = ?", UserStatus::ACTIVE]
end
create table Users
(
    id int,
    name varchar(100),
    user_status_id int,
    created_at datetime,
    updated_at datetime
)

class User < ActiveRecord::Base
  belongs_to :user_status
  has_many :roles, :through => :user_roles
  validates_length_of :name, :maximum => 100
  named_scope :active,
              :conditions => ["user_status.id = ?", UserStatus::ACTIVE]
end
create table Users
(
    id int,
    name varchar(100),
    user_status_id int,
    created_at datetime,
    updated_at datetime
)

class User < ActiveRecord::Base
  belongs_to :user_status
  has_many :roles, :through => :user_roles
  validates_length_of :name, :maximum => 100
  named_scope :active,
              :conditions => ["user_status.id = ?", UserStatus::ACTIVE]
end
create table Users
(
    id int,
    name varchar(100),
    user_status_id int,
    created_at datetime,
    updated_at datetime
)

class User < ActiveRecord::Base
  belongs_to :user_status
  has_many :roles, :through => :user_roles
  validates_length_of :name, :maximum => 100
  named_scope :active,
              :conditions => ["user_status.id = ?", UserStatus::ACTIVE]
end
create table Users
(
    id int,
    name varchar(100),
    user_status_id int,
    created_at datetime,
    updated_at datetime
)

class User < ActiveRecord::Base
  belongs_to :user_status
  has_many :roles, :through => :user_roles
  validates_length_of :name, :maximum => 100
  named_scope :active,
              :conditions => ["user_status.id = ?", UserStatus::ACTIVE]
end
create table Users
(
    id int,
    name varchar(100),
    user_status_id int,
    created_at datetime,
    updated_at datetime
)

class User < ActiveRecord::Base
  belongs_to :user_status
  has_many :roles, :through => :user_roles
  validates_length_of :name, :maximum => 100
  named_scope :active,
              :conditions => ["user_status.id = ?", UserStatus::ACTIVE]
end
If it’s hard, you’re probably doing it wrong
Innovation is everywhere
Patterns and “best practices” are
different between static and dynamic
             languages
public class Employee
{
       public static Employee Load(int id) { ... }
       public bool Save() { ... }
       public bool Delete() { ... }
}


 How do I stub out the Load method in a test?
 How can I implement cross-cutting concerns (e.g.
caching when saving) without duplicating code?
In Ruby, I can stub out class methods (i.e. static
methods)
class Employee < ActiveRecord::Base
  include Cacheable
end

module Cacheable
  def save
    Cache.save(self)
    super
  end
end


 In Ruby, I can mix in modules that will modify the
class
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer
Twitter   Github




Hulu      Groupon
   Rails for .NET Developers
     by Jeff Cohen and Brian Eng
   Agile Web Development With Rails
     by Sam Ruby, Dave Thomas, David Heinemeier Hansson
   Programming Ruby 1.9 (aka the “Pickaxe” book)
     by Dave Thomas, with Chad Fowler and Andy Hunt

   All found at http://pragprog.com
   Ruby Koans
     http://rubykoans.com
   Railscasts
     http://railscasts.com
   Why’s Poignant Guide To Ruby
     http://mislav.uniqpath.com/poignant-guide/
   Email: jon@jonkruger.com
   Twitter: @JonKruger
   Blog: http://jonkruger.com/blog

More Related Content

PPTX
Testable, Object-Oriented JavaScript
PPTX
Solid Software Design Principles
PPTX
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
PDF
History of jQuery
PPTX
jQuery from the very beginning
KEY
Backbone js
PDF
Node.js in action
PDF
SOLID PRINCIPLES
Testable, Object-Oriented JavaScript
Solid Software Design Principles
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
History of jQuery
jQuery from the very beginning
Backbone js
Node.js in action
SOLID PRINCIPLES

What's hot (20)

KEY
Why ruby
KEY
Ruby/Rails
PDF
Web Crawling with NodeJS
PPTX
KEY
Week 4 - jQuery + Ajax
PDF
jQuery in 15 minutes
PDF
Javascript Frameworks for Joomla
PDF
05 JavaScript #burningkeyboards
PPT
PDF
06 jQuery #burningkeyboards
PDF
Joe Walker Interactivewebsites Cometand Dwr
PDF
Remy Sharp The DOM scripting toolkit jQuery
PPTX
jQuery Best Practice
PPTX
JavaScript Promises
PDF
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
PDF
Class-based views with Django
PPTX
Component lifecycle hooks in Angular 2.0
PPTX
jQuery
Why ruby
Ruby/Rails
Web Crawling with NodeJS
Week 4 - jQuery + Ajax
jQuery in 15 minutes
Javascript Frameworks for Joomla
05 JavaScript #burningkeyboards
06 jQuery #burningkeyboards
Joe Walker Interactivewebsites Cometand Dwr
Remy Sharp The DOM scripting toolkit jQuery
jQuery Best Practice
JavaScript Promises
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Class-based views with Django
Component lifecycle hooks in Angular 2.0
jQuery
Ad

Similar to Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer (20)

PDF
Ruby on Rails 2.1 What's New
PDF
Carlosbrando Rubyonrails21 En
PDF
From Rails legacy to DDD - Pivorak, Lviv
PDF
Rails workshop for Java people (September 2015)
KEY
Desarrollando aplicaciones web en minutos
KEY
Building Web Service Clients with ActiveModel
KEY
Building Web Service Clients with ActiveModel
PPT
Ruby On Rails
KEY
Intro to Ruby - Twin Cities Code Camp 7
PDF
Ruby on Rails ステップアップ講座 - 大場寧子
PDF
Story for a Ruby on Rails Single Engineer
PDF
td_mxc_rubyrails_shin
PDF
td_mxc_rubyrails_shin
KEY
SOLID Ruby, SOLID Rails
PDF
From legacy to DDD
KEY
Rails traps
PDF
Ruby on Rails For .Net Programmers
PDF
RubyOnRails-Cheatsheet-BlaineKendall
PDF
RubyOnRails-Cheatsheet-BlaineKendall
PPT
Ruby on rails
Ruby on Rails 2.1 What's New
Carlosbrando Rubyonrails21 En
From Rails legacy to DDD - Pivorak, Lviv
Rails workshop for Java people (September 2015)
Desarrollando aplicaciones web en minutos
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
Ruby On Rails
Intro to Ruby - Twin Cities Code Camp 7
Ruby on Rails ステップアップ講座 - 大場寧子
Story for a Ruby on Rails Single Engineer
td_mxc_rubyrails_shin
td_mxc_rubyrails_shin
SOLID Ruby, SOLID Rails
From legacy to DDD
Rails traps
Ruby on Rails For .Net Programmers
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendall
Ruby on rails
Ad

More from Jon Kruger (7)

PPTX
The Business of You: 10 Steps To Run Your Career Like a Business
PPTX
Developing an Automated Testing Strategy
PPTX
A Whole Team Approach To Testing
PPTX
An ATDD Case Study
PPTX
Productivity Boosters for .NET Developers
PPTX
Test-Driven Development In Action
PPTX
Advanced Object-Oriented/SOLID Principles
The Business of You: 10 Steps To Run Your Career Like a Business
Developing an Automated Testing Strategy
A Whole Team Approach To Testing
An ATDD Case Study
Productivity Boosters for .NET Developers
Test-Driven Development In Action
Advanced Object-Oriented/SOLID Principles

Recently uploaded (20)

PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
KodekX | Application Modernization Development
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
cuic standard and advanced reporting.pdf
PPT
Teaching material agriculture food technology
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
KodekX | Application Modernization Development
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Network Security Unit 5.pdf for BCA BBA.
Dropbox Q2 2025 Financial Results & Investor Presentation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
Chapter 3 Spatial Domain Image Processing.pdf
Modernizing your data center with Dell and AMD
NewMind AI Monthly Chronicles - July 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
Teaching material agriculture food technology
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
Review of recent advances in non-invasive hemoglobin estimation
Understanding_Digital_Forensics_Presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing

Venturing Into The Wild: A .NET Developer's Experience As A Ruby Developer

  • 2. Independent consultant in Columbus, OH .NET, Ruby on Rails, Agile Email: jon@jonkruger.com Twitter: @JonKruger Blog: http://jonkruger.com/blog
  • 4. public void Page_Load(Object sender, EventArgs e) { }
  • 7. “Sometimes I want to do Ruby because it means that I’m more likely to be able to do TDD.” -- Greg Malcolm
  • 8. “I feel like the shackles have been taken off.” -- Leon Gersing
  • 9. public interface IGetObjectService<T> where T : EntityBase { public T Get(int id); public IList<T> GetAll(); } public class GetObjectService<T> : IGetObjectService<T> { public GetObjectService(IRepository<T> repository) { } public T Get(int id) { ... } public IList<T> GetAll() { ... } }
  • 13. ASP .NET MVC and Rails are very similar
  • 15. You can do more with less code
  • 16. create table Users ( id int, name varchar(100), user_status_id int, created_at datetime, updated_at datetime ) class User < ActiveRecord::Base belongs_to :user_status has_many :roles, :through => :user_roles validates_length_of :name, :maximum => 100 named_scope :active, :conditions => ["user_status.id = ?", UserStatus::ACTIVE] end
  • 17. create table Users ( id int, name varchar(100), user_status_id int, created_at datetime, updated_at datetime ) class User < ActiveRecord::Base belongs_to :user_status has_many :roles, :through => :user_roles validates_length_of :name, :maximum => 100 named_scope :active, :conditions => ["user_status.id = ?", UserStatus::ACTIVE] end
  • 18. create table Users ( id int, name varchar(100), user_status_id int, created_at datetime, updated_at datetime ) class User < ActiveRecord::Base belongs_to :user_status has_many :roles, :through => :user_roles validates_length_of :name, :maximum => 100 named_scope :active, :conditions => ["user_status.id = ?", UserStatus::ACTIVE] end
  • 19. create table Users ( id int, name varchar(100), user_status_id int, created_at datetime, updated_at datetime ) class User < ActiveRecord::Base belongs_to :user_status has_many :roles, :through => :user_roles validates_length_of :name, :maximum => 100 named_scope :active, :conditions => ["user_status.id = ?", UserStatus::ACTIVE] end
  • 20. create table Users ( id int, name varchar(100), user_status_id int, created_at datetime, updated_at datetime ) class User < ActiveRecord::Base belongs_to :user_status has_many :roles, :through => :user_roles validates_length_of :name, :maximum => 100 named_scope :active, :conditions => ["user_status.id = ?", UserStatus::ACTIVE] end
  • 21. create table Users ( id int, name varchar(100), user_status_id int, created_at datetime, updated_at datetime ) class User < ActiveRecord::Base belongs_to :user_status has_many :roles, :through => :user_roles validates_length_of :name, :maximum => 100 named_scope :active, :conditions => ["user_status.id = ?", UserStatus::ACTIVE] end
  • 22. If it’s hard, you’re probably doing it wrong
  • 24. Patterns and “best practices” are different between static and dynamic languages
  • 25. public class Employee { public static Employee Load(int id) { ... } public bool Save() { ... } public bool Delete() { ... } }  How do I stub out the Load method in a test?  How can I implement cross-cutting concerns (e.g. caching when saving) without duplicating code?
  • 26. In Ruby, I can stub out class methods (i.e. static methods)
  • 27. class Employee < ActiveRecord::Base include Cacheable end module Cacheable def save Cache.save(self) super end end  In Ruby, I can mix in modules that will modify the class
  • 30. Twitter Github Hulu Groupon
  • 31. Rails for .NET Developers  by Jeff Cohen and Brian Eng  Agile Web Development With Rails  by Sam Ruby, Dave Thomas, David Heinemeier Hansson  Programming Ruby 1.9 (aka the “Pickaxe” book)  by Dave Thomas, with Chad Fowler and Andy Hunt  All found at http://pragprog.com
  • 32. Ruby Koans  http://rubykoans.com  Railscasts  http://railscasts.com  Why’s Poignant Guide To Ruby  http://mislav.uniqpath.com/poignant-guide/
  • 33. Email: jon@jonkruger.com  Twitter: @JonKruger  Blog: http://jonkruger.com/blog

Editor's Notes

  • #4: Losing bids – software development takes too long. Why is it so hard?Wanting to go fasterWanted to write code that does what it says and says what it does
  • #5: I want my framework to help me fall into the pit of successWould someone new to the framework be more likely to succeed or fail?
  • #6: Started a new projectLower estimatesConventions (FNH, grid button clicks)Company framework
  • #8: How many of you do TDD?
  • #9: Ever been annoyed by:Not being able to override a method unless it’s marked as virtualNot being able to inherit from a sealed classGetting generic constraint errorsNot being able to add methods to an existing classNot having mixinsHaving to use dependency injection in order to testHaving to compile your code every time you change anything
  • #11: Stories of people going fasterRuby-based consulting companies are doing it that way for a reason
  • #12: Code and coffeeRails for .NET Developers (next slide)Practice problems
  • #15: UNIX is very command line driven (install apps through the command line, shell scripting)Closer to the metalUsing Vim as my IDE
  • #16: Less code means less work, fewer chances to write bugs, easier to maintain
  • #22: I haven’t written any methods! I’m writing code that writes code for me!
  • #23: There are gems for everythingIt’s really easily to write little DSLs, so you do the hard things once
  • #24: Gems for everything, people always trying to improve
  • #30: -Rails can be the &quot;company framework&quot; that everyone is trying to build  -things are done the same way in most Rails projects, so you can join a Rails team and you don&apos;t have to learn someone else&apos;s homegrown framework  -homegrown frameworks often are a big detriment to getting things done (maintenance is hard, keeps you from upgrading your codebase, etc.)Rails works in the enterprise - cleanest 4 yr old codebase I&apos;ve ever worked on, wouldn&apos;t gain much if I could rewrite itLots of big companies using Rails……. (next slide)
  • #31: Lots of big companies using Rails (Twitter, Github, Hulu, Groupon)-not &quot;switching to Ruby&quot;, not &quot;leaving .NET&quot;- don&apos;t be afraid of leaving your comfort zone (framework, language, syntax, etc.)- you will learn things that will help you on other platforms/languages-Ruby on Rails is just another tool in my toolbox (that happens to be really good at building web applications)-If Ruby on Rails can help your team develop things better and faster, isn’t it even worth considering?-Do a cost-benefit analysis – will the long term benefit of using Ruby outweigh the time needed to adopt a new technology?