Code Monkey home page Code Monkey logo

best-ruby's Introduction

Ruby Tricks, Idiomatic Ruby, Refactorings and Best Practices

Do you know why experienced Ruby programmers tend to reach for basic collections and hashes while programmers from other languages go for more specialized classes? Do you know the difference between strip, chop, and chomp, and why there are three such similar methods when apparently one might suffice? (Not to mention lstrip and rstrip!) Do you know the downsides of dynamic typing? Do you know why the differences between strings and symbols get so blurry, even to experienced Ruby developers? How about metaprogramming? What the heck is an eigenclass? How about protected methods? Do you know what they’re really about? Really? Are you sure? Eloquent Ruby

Ruby is a tricky language, you can check some tricks here. Using tricks and tips and Ruby itself you can make good refactorings in your code.

Absolutely the best way to learn to write idiomatic Ruby code is to read idiomatic Ruby code. Eloquent Ruby

This repository aims to help everyone to write a more idiomatic, clean and tricky ruby code and also try to join a bunch of good refactoring techniques. You can add your own technique or paste it from some website(do not forget the source, of course). All the tricks are in the /tricks folder.

For the sake of reading, you should paste in the markdown format and at the end, paste where the technique come from, if it's not yours.

In this part we can check some obscure or awesome features from the and the standard ruby library which normally we forget.

You can write a Ruby code, but it can look like a Java code for example. Here you can find some tips to write a more natural and take advantage of Ruby.

Contributors

A big thanks to the following persons

Contributing

  1. Fork it
  2. Create your refactoring technique branch: git checkout -b my-technique
  3. Add your technique to the collection of .md files in the correct folder (tricks, refactorings, idiomatic_ruby or best_practices) folder
  4. Commit your changes: git commit -am 'Add my technique'
  5. Push to the branch: git push origin mytechnique
  6. Create a new Pull Request and explain your technique in the markdown file

best-ruby's People

Contributors

0x0dea avatar ciaoben avatar dansandland avatar eftakhairul avatar ezekg avatar filipebarcos avatar franzejr avatar fredkelly avatar gitter-badger avatar jadercorrea avatar lightyrs avatar matugm avatar rafaelsales avatar shadefinale avatar skylerrogers avatar xzgyb avatar

Watchers

 avatar  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.