Ce diaporama a bien été signalé.
Le téléchargement de votre SlideShare est en cours. ×

Optimizing for programmer happiness

Ad

Optimizing for Programmer
Happiness
Or my seven year love affair with Ruby

Ad

Once upon a time...
Not Mine :-(

Ad

Josh Schramm
TW: @joshreedschramm
Level Seven

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Ad

Chargement dans…3
×

Consultez-les par la suite

1 sur 30 Publicité
1 sur 30 Publicité

Optimizing for programmer happiness

Télécharger pour lire hors ligne

An overview of the Ruby language and Ruby on Rails from a historical, cultural and technical perspective.

An overview of the Ruby language and Ruby on Rails from a historical, cultural and technical perspective.

Plus De Contenu Connexe

Optimizing for programmer happiness

  1. 1. Optimizing for Programmer Happiness Or my seven year love affair with Ruby
  2. 2. Once upon a time... Not Mine :-(
  3. 3. Josh Schramm TW: @joshreedschramm Level Seven
  4. 4. Today’s Talk Why do people show up every month to talk about Ruby? Discussion not a lecture Mix of new people and “vets”. Lots of opinion in these slides. References where referenceable History, Culture (both ‘social’ and programming), unique parts of the language and impact on the industry. Not much code
  5. 5. History Lesson - Founding Fathers Yukihiro Matsumoto “Matz” Invented the Ruby Language in ‘93, first release in ‘95 Influenced by Perl, Eiffel, Ada, Lisp and Smalltalk Much of the culture of the Ruby community comes from the principals Matz followed when building out the early versions of the language
  6. 6. History Lesson - Founding Fathers David Heinemeier Hansson “DHH” Invented the Ruby on Rails web framework. First release in 2005 Founder of 37signals (now Basecamp) Coauthor of Agile Web Development w/ Rails (along with Dave Thomas and Sam Ruby) Rails was largely responsible for the rise in popularity of the Ruby language. Inflection point in 2006
  7. 7. Jim Weirich Inventor of Rake, co-founder/early contributor to Rubygems Was a prominent conference speaker _why the lucky stiff Wrote the semi-irreverent “Why’s (poignant) Guide to Ruby” Yehuda Katz Co-inventor of Merb, an early Rails competitor that merged w/ Rails. It helped introduce modularity to Rails.
  8. 8. The Ruby Way “Matz is nice and so we are nice” - Early culture of niceness, inclusiveness and evangelism. - Lead to a spike in user groups, conferences and events (like Rails Rumble) - Regional conferences took off (Windy City Rails, Madison Ruby, Steel City Ruby, Great Lakes Ruby Bash) - Evangelism gave way to great tools for learning the language: - Ex: Ruby Koans, Try Ruby Is this still true?
  9. 9. Culture of the Code Principle of Least Astonishment (POLA) - The language should minimize confusion amongst experienced users. - Matz’s early driving design principle - Confusing to whom? Optimized for Programmer Happiness - Inspired by POLA - Language decisions are intended to delight the user (the programmer) even if that has performance, verboseness or other tradeoffs.
  10. 10. The Rails Doctrine Convention over Configuration - Starts from the position of opinionated software. That most use cases in web development are similar and we shouldn’t reinvent the wheel every time. Push Up a Big Tent - That said, the tool should support customization and the introduction of new tools if people prefer / have valid use cases. - Ex: RSpec over MiniTest / TestUnit More: http://rubyonrails.org/doctrine/
  11. 11. _Why Ruby? - Dynamic With Ruby you can manipulate or modify the program you are running as it runs. Part of a concept known as metaprogramming.
  12. 12. _Why Ruby? - Dynamically and Strongly Typed Dynamic Typing: A variable can change type to whatever you assign to it. Strong Typing: You cannot perform an action on a variable that doesn’t make sense for the current type.
  13. 13. _Why Ruby? - Reflective You can inspect the characteristics of a class, method, variable at runtime. Combine this with the dynamic language features and dynamic typing and you can make decisions about what your code should be based on what your code currently is. How very zen
  14. 14. There are no primitive types in Ruby. Literally everything you interact with is an object of some sort. A class, an instance of a class, etc. Contrast with .NET / Java / C where int, char, decimal and several others are primitives, not objects Main differences Primitives tend to be faster to interact with, pull out of memory and copy but immutable and inflexible. Objects are slower, more memory but far more flexible _Why Ruby? - Everything is an Object (Super OO)
  15. 15. _Why Ruby? - Lack of Ceremony Ruby syntax tends to be clean(er) and devoid of most markers that other languages require like semicolons or parentheses At the same time ruby can support those things if preferred
  16. 16. _Why Ruby? - Domain Specific Languages Ruby tools are usually written to be expressive and easy to read. They leverage a concept called DSL to describe the actions the tool can take. Ex: Rspec
  17. 17. Why Not Ruby?
  18. 18. Ruby and Rails’ Impact - RubyGems One of the most comprehensive dependency management / library distribution tools anywhere at its release. Helped contribute to rise of social coding Inspired other platforms: NuGet (.NET), Composer (PHP), CocoaPods (Swift/Obj-C), NPM (Node.JS)
  19. 19. Ruby and Rails’ Impact - Testing Flexibility of the language drove the rise in BDD and ATDD as a first class practice. Tools like: RSpec, Cucumber, Capybara, Watir Inspired other platforms: SpecFlow (.NET), Watin/Watij (.NET/Java), Jasmine (Javascript)
  20. 20. Ruby and Rails’ Impact - Web MVC Rails implementation of a full-stack web framework designed around a Model View Controller architecture became the standard for framework design for about a decade. Just now starting to see a change to this with API driven, single page apps and functional programming. Inspired other platforms: ASP.Net MVC (.NET), Play (Java and Scala), Laravel / CodeIgniter (PHP)
  21. 21. Ruby and Rails’ Impact - DevOps The DSL features of Rails helped spur the adoption of configurable operations tooling. It became easier to automate the setup of infrastructure and ultimately spawned an entire “new” category of IT. Examples: Chef / Puppet
  22. 22. Ruby and Rails’ Impact - Opinionated Programming Rails “Convention over Configuration” mantra broke down some of the stigma associated with setting intelligent defaults in frameworks / tools. Now most platforms package with a preferred DBMS, View Layer, Emailing Tool, etc. even if they are customizable. Ex: ASP.Net MVC with Entity Framework
  23. 23. Questions / Discussion

Notes de l'éditeur

  • Dates may be a bit off

    Started career in .net

    One day a friend told me about user groups, these strange places where programmers got together to nerd out about some language or technology they loved and he dragged me along to this tiny group called the Cleveland Ruby Brigade.

    It was on this beatup old restaurant boat on lake erie that this weird software company called Lean Dog had made home. I think twice during the meeting people came in asking if they were serving dinner that night.

    I think the topic was an overview of the latest version of Rails… something like 2.3 maybe at the time.

    Web development could be easy. .NET had alwasy been overly complicated and PHP, the language i used to work in, was ugly and hard to maintain.

    Some friends and I decided we would get into ruby in a crazy way, by staying up for 2 nights straight and competing in a hackathon. Rails Rumble. We lost but had so much fun working on the idea that I knew I needed to get a job building ruby apps.



  • Introduction
    - Noticed quite a few new people
    - Why does this group exist? What drew a bunch of us to ruby and why do we meet every month to talk about a programming language?
    - End w/ discussion. Vets can talk about why they stick around, newbies can explain why they showed up.
    - Much of this talk is subjective / opinion, which is why I'm looking forward to the discussion part. I've tried to cite sources in a few places but generally treat this as an opinion piece
  • .NET in 2002, Java in May ‘95 just a couple of months before Ruby

    More on language influences in a bit


    References:

    https://www.ruby-lang.org/en/about/
    https://en.wikipedia.org/wiki/.NET_Framework
    https://en.wikipedia.org/wiki/Java_(programming_language)

  • References:

    Inflection Point: https://www.ruby-lang.org/en/about/
  • References:

    https://en.wikipedia.org/wiki/Why%27s_(poignant)_Guide_to_Ruby
    https://en.wikipedia.org/wiki/Jim_Weirich
    https://en.wikipedia.org/wiki/Merb
  • References:

    https://www.ruby-lang.org/en/community/conferences/
  • References:

    https://en.wikipedia.org/wiki/Principle_of_least_astonishment
    https://www.python.org/dev/peps/pep-0020/
  • References:

    http://rubyonrails.org/doctrine/
  • Apologies to _why

    Tied to but not the same as compiled vs interpreted. Dynamic languages run though many common tasks at run time like extending code. In ruby this happens in order of the interpreter encountering the code.

    References:
    http://ruby-metaprogramming.rubylearning.com/html/ruby_metaprogramming_2.html
    http://archive.oreilly.com/pub/post/what_is_a_dsl.html
    https://en.wikipedia.org/wiki/Smalltalk#Object-oriented_programming
    https://www.ruby-lang.org/en/about/
    http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/
  • Reference:

    https://gist.github.com/matugm/db363c7131e6af27716c
  • Apologies to _why


    References:
    http://ruby-metaprogramming.rubylearning.com/html/ruby_metaprogramming_2.html
    http://archive.oreilly.com/pub/post/what_is_a_dsl.html
    https://en.wikipedia.org/wiki/Smalltalk#Object-oriented_programming
    https://www.ruby-lang.org/en/about/
    http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/
  • Reference:

    https://gist.github.com/matugm/db363c7131e6af27716c
  • Reference:

    https://gist.github.com/matugm/db363c7131e6af27716c
  • Apologies to _why


    References:
    http://ruby-metaprogramming.rubylearning.com/html/ruby_metaprogramming_2.html
    http://archive.oreilly.com/pub/post/what_is_a_dsl.html
    https://en.wikipedia.org/wiki/Smalltalk#Object-oriented_programming
    https://www.ruby-lang.org/en/about/
    http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/
  • Reference:

    https://gist.github.com/matugm/db363c7131e6af27716c
  • Apologies to _why

    For MRI this means everything is on the the heap

    Difference
    http://stackoverflow.com/questions/8643276/object-vs-primitive

    References:
    http://ruby-metaprogramming.rubylearning.com/html/ruby_metaprogramming_2.html
    http://archive.oreilly.com/pub/post/what_is_a_dsl.html
    https://en.wikipedia.org/wiki/Smalltalk#Object-oriented_programming
    https://www.ruby-lang.org/en/about/
    http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/
  • Reference:

    https://gist.github.com/matugm/db363c7131e6af27716c
  • Apologies to _why


    References:
    http://ruby-metaprogramming.rubylearning.com/html/ruby_metaprogramming_2.html
    http://archive.oreilly.com/pub/post/what_is_a_dsl.html
    https://en.wikipedia.org/wiki/Smalltalk#Object-oriented_programming
    https://www.ruby-lang.org/en/about/
    http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/
  • This is a little unfair. The 2nd find implementation is unnecessary because AR does that. Also I’m introducing an entire repository to demonstrate how that pattern typically works in C# which isn’t really needed.

    Reference:

    https://gist.github.com/matugm/db363c7131e6af27716c
  • Apologies to _why


    References:
    http://ruby-metaprogramming.rubylearning.com/html/ruby_metaprogramming_2.html
    http://archive.oreilly.com/pub/post/what_is_a_dsl.html
    https://en.wikipedia.org/wiki/Smalltalk#Object-oriented_programming
    https://www.ruby-lang.org/en/about/
    http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/
  • Reference:

    https://gist.github.com/matugm/db363c7131e6af27716c
  • Apologies to _why


    References:
    http://ruby-metaprogramming.rubylearning.com/html/ruby_metaprogramming_2.html
    http://archive.oreilly.com/pub/post/what_is_a_dsl.html
    https://en.wikipedia.org/wiki/Smalltalk#Object-oriented_programming
    https://www.ruby-lang.org/en/about/
    http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/

×