Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Polished Ruby Programming
  • Table Of Contents Toc
Polished Ruby Programming

Polished Ruby Programming - Second Edition

By : Jeremy Evans
close
close
Polished Ruby Programming

Polished Ruby Programming

By: Jeremy Evans

Overview of this book

Most successful Ruby applications become more difficult to maintain as the codebase grows in size. Polished Ruby Programming, 2nd Edition provides you with the skills and advice you need to design Ruby programs and libraries that are robust, performant, scalable, and maintainable. The book takes you through possible implementation approaches for many common programming situations, discusses the trade-offs inherent in each approach, and explains why you may sometimes choose to use different approaches. You'll start by learning fundamental Ruby programming principles, such as correctly using core classes, class and method design, variable usage, error handling, and code formatting. Then you’ll move on to higher-level topics such as library design, metaprogramming, domain-specific languages, and refactoring. Finally, you'll learn about the pros and cons of different approaches to concurrency, what you should consider when deciding whether to use static types in your Ruby code, and how best to optimize your Ruby code. The 2nd edition of Polished Ruby Programming has been updated to include relevant changes between Ruby 3.0 and 4.0. While most principles discussed in the book apply to all recent Ruby versions, some of the content in the book is specific to Ruby 4.0, the latest release at the time of publication.
Table of Contents (20 chapters)
close
close
18
Other Books You May Enjoy
19
Index

Learning about the refactoring process

In general, the process of refactoring existing code is similar to writing code in the first place. In many cases, it's even easier. You can think of new development as writing, and refactoring as editing. For many people, editing is easier than writing. Assuming you've followed the advice in Chapter 11, Testing to Ensure Your Code Works, you already have a good set of tests for the behavior you are refactoring, with either no mocking or minimal mocking. If you've inherited code without tests, or with tests that heavily use mocks and don't give you good confidence that they will catch bugs that can be introduced during refactoring, then, before you start refactoring, the goal should be to get the tests in a good enough shape that you are comfortable they will catch you if you fall. If you refactor some code, and then run the tests and everything passes, and your first thought is, "Maybe I am missing a case where this fails...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Polished Ruby Programming
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon