Coder Social home page Coder Social logo

navidmatin / ruby-science Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thoughtbot/ruby-science

0.0 0.0 0.0 15.78 MB

The reference for writing fantastic Rails applications

License: Other

Shell 0.01% JavaScript 0.12% Ruby 16.90% CSS 0.10% HTML 82.86% Procfile 0.01%

ruby-science's Introduction

title
Ruby Science

Ruby on Rails is more than 15 years old and its community has developed a number of principles for building applications that are fast, fun and easy to change: Don't repeat yourself, keep your views dumb, keep your controllers skinny, and keep business logic in your models. These principles carry most applications to their first release or beyond.

However, these principles only get you so far. After a few releases, most applications begin to suffer. Models become fat, classes become few and large, tests become slow and changes become painful. In many applications, there comes a day when the developers realize that there's no going back; the application is a twisted mess and the only way out is a rewrite or a new job.

Fortunately, it doesn't have to be this way. Developers have been using object-oriented programming for several decades and there's a wealth of knowledge out there that still applies to developing applications today. We can use the lessons learned by these developers to write good Rails applications by applying good object-oriented programming.

Ruby Science will outline a process for detecting emerging problems in code and will dive into the solutions, old and new.

Introduction

  1. Code Review
  2. Smells
  3. Resistance
  4. Bugs and Churn
  5. Tools to Find Smells
  6. Navigating
  7. Example Application

Code Smells

  1. Long Method
  2. Large Class
  3. Feature Envy
  4. Case Statement
  5. Shotgun Surgery
  6. Divergent Change
  7. Long Parameter List
  8. Duplicated Code
  9. Uncommunicative Name
  10. Single Table Inheritance
  11. Comments
  12. Mixins
  13. Callbacks

Solutions

  1. Replace Conditional with Polymorphism
  2. Replace Conditional with Null Object
  3. Extract Method
  4. Rename Method
  5. Extract Class
  6. Extract Value Object
  7. Extract Decorator
  8. Extract Partial
  9. Extract Validator
  10. Introduce Explaining Variable
  11. Introduce Form Object
  12. Introduce Parameter Object
  13. Use Class as Factory
  14. Move Method
  15. Inline Class
  16. Inject Dependencies
  17. Replace Subclasses with Strategies
  18. Replace Mixin with Composition
  19. Replace Callback with Method
  20. Use Convention Over Configuration

Principles

  1. Dry
  2. Single Responsibility Principle
  3. Tell Don't Ask
  4. Law of Demeter
  5. Composition Over Inheritance
  6. Open Closed Principle
  7. Dependency Inversion Principle

ruby-science's People

Contributors

jferris avatar harlow avatar dskecse avatar elisuh avatar ugisozols avatar arunagw avatar cpytel avatar d1 avatar theandrewgraham avatar acandael avatar r00k avatar bpeicher avatar calleluks avatar jhwist avatar jessieay avatar joesims avatar sylvain avatar trhodeos avatar sgrif avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.