Best-Ruby v2.1 Release Notes

Release Date: 2016-01-29 // about 8 years ago
  • πŸ”¨ 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

    πŸ’Ž > 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.

    πŸ’Ž Tricks

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

    πŸ’Ž Idiomatic Ruby

    πŸ’Ž 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.

    πŸ”¨ Refactorings

    🚧 Small (and big) improvements you can apply to your code and improve it's readability and maintenance. Change the internal structure of the code without changing it's behaviour.

    πŸ’Ž Best Practices

    If you keep your house cleaned constantly you'll never need to waste a weekend cleaning it. The same applys to your code, be disciplined and keep your code looking good with those tips.

    Contributors

    πŸ’Ž A big thanks to the following persons

    Contributing

    πŸ’Ž 1. Fork it

    1. Create a branch with your idea: git checkout -b my-idea πŸ”¨ 3. Check in which category it should be: best practice, idiomatic ruby, refactorying or trick. If you don't know, please open an issue and ask. πŸ’Ž 4. Add your idea to the collection of .md files in the correct folder (tricks, refactorings, idiomatic_ruby or best_practices) folder
    2. Commit your changes: git commit -am 'Add my idea'
    3. Push to the branch: git push origin my-idea
    4. Create a new Pull Request and explain your technique in the markdown file

Previous changes from v2.0