Book Image

Polished Ruby Programming

By : Jeremy Evans
5 (1)
Book Image

Polished Ruby Programming

5 (1)
By: Jeremy Evans

Overview of this book

Anyone striving to become an expert Ruby programmer needs to be able to write maintainable applications. Polished Ruby Programming will help you get better at designing scalable and robust Ruby programs, so that no matter how big the codebase grows, maintaining it will be a breeze. This book takes you on a journey through implementation approaches for many common programming situations, the trade-offs inherent in each approach, and why you may choose to use different approaches in different situations. You'll start by refreshing Ruby fundamentals, 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 programming principles, such as library design, use of metaprogramming and domain-specific languages, and refactoring. Finally, you'll learn principles specific to web application development, such as how to choose a database and web framework, and how to use advanced security features. By the end of this Ruby programming book, you’ll be a well rounded web developer with a deep understanding of Ruby. While most code examples and principles discussed in the book apply to all Ruby versions, some examples and principles are specific to Ruby 3.0, the latest release at the time of publication.
Table of Contents (23 chapters)
Section 1: Fundamental Ruby Programming Principles
Section 2: Ruby Library Programming Principles
Section 3: Ruby Web Programming Principles

What this book covers

Chapter 1, Getting the Most out of Core Classes, focuses on the optimal usage of the built-in classes.

Chapter 2, Designing Useful Custom Classes, focuses on when it makes sense to implement a custom class, applying SOLID design to custom classes, and the trade-offs between having large classes and having a large number of classes.

Chapter 3, Proper Variable Usage, focuses on how best to use each of Ruby's variable types.

Chapter 4, Methods and Their Arguments, focuses on method naming principles, the best usage of each of the method argument types, and choosing proper method visibility.

Chapter 5, Handling Errors, focuses on the trade-offs between using exceptions and return values for handling errors, handling transient errors, and designing exception class hierarchies.

Chapter 6, Formatting Code for Easy Reading, focuses on different viewpoints on the importance of syntactic complexity and the downsides of arbitrary limits.

Chapter 7, Designing Your Library, focuses on designing your library around the user experience and complexity trade-offs when designing methods for your library.

Chapter 8, Designing for Extensibility, focuses on designing useful plugin systems to allow for extensibility in libraries.

Chapter 9, Metaprogramming and When to Use It, focuses on the pros and cons of abstraction, avoiding redundancy, and trade-offs between the two approaches Ruby has for metaprogramming.

Chapter 10, Designing Useful Domain-Specific Languages, focuses on when and how best to design DSLs.

Chapter 11, Testing to Ensure Your Code Works, focuses on why testing is so important, how to approach testing and manage complexity during testing, and the importance of code coverage.

Chapter 12, Handling Change, focuses on when and how best to implement refactoring in libraries, and deprecation strategies.

Chapter 13, Using Common Design Patterns, focuses on principles for the best usage of five common design patterns.

Chapter 14, Optimizing Your Library, focuses on determining when optimization is needed and how to approach optimization if it is needed.

Chapter 15, The Database Is Key, focuses on why database design is so important in web programming, how best to use database features, and how best to handle database errors.

Chapter 16, Web Application Design Principles, focuses on trade-offs for different types of application design, different frameworks, and different URL designs.

Chapter 17, Robust Web Application Security, focuses on important web security techniques and how to approach designing web applications for high-security environments.