close menu
Bookswagon-24x7 online bookstore
close menu
My Account
Refactoring in Ruby (Adobe Reader)

Refactoring in Ruby (Adobe Reader)

          
5
4
3
2
1

Out of Stock


Premium quality
Premium quality
Bookswagon upholds the quality by delivering untarnished books. Quality, services and satisfaction are everything for us!
Easy Return
Easy return
Not satisfied with this product! Keep it in original condition and packaging to avail easy return policy.
Certified product
Certified product
First impression is the last impression! Address the book’s certification page, ISBN, publisher’s name, copyright page and print quality.
Secure Checkout
Secure checkout
Security at its finest! Login, browse, purchase and pay, every step is safe and secured.
Money back guarantee
Money-back guarantee:
It’s all about customers! For any kind of bad experience with the product, get your actual amount back after returning the product.
On time delivery
On-time delivery
At your doorstep on time! Get this book delivered without any delay.
Notify me when this book is in stock
Add to Wishlist

About the Book

The First Hands-On, Practical, All-Ruby Refactoring Workbook!

 

Refactoring—the art of improving the design of existing code—has taken the world by storm. So has Ruby. Now, for the first time, there’s a refactoring workbook designed from the ground up for the dynamic Ruby language.

 

Refactoring in Ruby gives you all the realistic, hands-on practice you need to refactor Ruby code quickly and effectively. You’ll discover how to recognize “code smells,” which signal opportunities for improvement, and then perfect your program’s design one small, safe step at a time.

 

The book shows you when and how to refactor with both legacy code and during new test-driven development, and walks you through real-world refactoring in detail. The workbook concludes with several applications designed to help practice refactoring in realistic domains, plus a handy code review checklist you’ll refer to again and again. Along the way, you’ll learn powerful lessons about designing higher quality Ruby software—lessons that will enable you to experience the joy of writing consistently great code.

 

Refactoring in Ruby will help you

  • Recognize why poor code design occurs, so you can prevent it from occurring in your own code
  • Master better design techniques that lead to more efficient, reliable, and maintainable software
  • Fix code that’s too long, large, or difficult to follow
  • Ferret out duplication, and express each idea “once and only once”
  • Recognize missing or inadequately formed classes
  • Simplify overly complex relationships between classes and their subclasses
  • Achieve the right balance of responsibilities among objects
  • Make your code easier to test and change
  • Cope with incomplete library modules, and fix runaway dependencies
  • Learn the next steps to take after you refactor


Table of Contents:

Foreword xvii

Preface xix

About the Authors xxiii

 

Part I: The Art of Refactoring 1

 

Chapter 1: A Refactoring Example 3

Sparkline Script 3

Consistency 6

Testability 8

Greedy Methods 8

Greedy Module 9

Comments 10

Whole Objects 11

Feature Envy 12

Uncommunicative Names 14

Derived Values 15

Wabi-Sabi 17

Summing Up 18

What’s Next 18

 

Chapter 2: The Refactoring Cycle 19

What Is Refactoring? 19

Smells Are Problems 20

The Refactoring Cycle 21

When Are We Done? 21

Test-Driven/Behavior-Driven Development 22

Exercise 23

What’s Next 23

 

Chapter 3: Refactoring Step by Step 25

The Refactoring Environment 25

Inside a Refactoring 26

The Generic Refactoring Micro-Process 30

Exercises 33

What’s Next 33

 

Chapter 4: Refactoring Practice 35

Read Other Books 35

Practice Refactoring 35

Exercises to Try 36

Participate in the Community 37

Exercise 38

What’s Next 38

 

Part II: Code Smells 39

 

Chapter 5: Measurable Smells 41

Comments 42

Long Method 44

Large Module 46

Long Parameter List 48

Exercises 49

 

Chapter 6: Names 57

Type Embedded in Name 59

Uncommunicative Name 60

Inconsistent Names 61

Exercises 62

 

Chapter 7: Unnecessary Complexity 65

Dead Code 66

Speculative Generality 68

Greedy Method 70

Procedural Code 72

Dynamic Code Creation 74

Exercises 76

 

Chapter 8: Duplication 79

Derived Value 80

Repeated Value 81

Duplicated Code 83

Alternative Modules with Different Interfaces 85

Exercises 86

 

Chapter 9: Conditional Logic 93

Nil Check 94

Special Case 96

Complicated Boolean Expression 98

Control Coupling 100

Simulated Polymorphism 101

Exercises 103

 

Chapter 10: Data 107

Open Secret 108

Data Class 110

Data Clump 112

Temporary Field 114

Exercises 115

 

Chapter 11: Inheritance 125

Implementation Inheritance 126

Refused Bequest 128

Inappropriate Intimacy (Subclass Form) 130

Lazy Class 131

Exercises 133

 

Chapter 12: Responsibility 135

Feature Envy 136

Utility Function 138

Global Variable 140

Inappropriate Intimacy (General Form) 141

Message Chain 143

Middle Man 145

Greedy Module 146

Exercises 148


Chapter 13: Accommodating Change 153

Divergent Change 154

Shotgun Surgery 156

Parallel Inheritance Hierarchies 158

Combinatorial Explosion 159

Exercises 160

 

Chapter 14: Libraries 163

Incomplete Library Module 164

Reinvented Wheel 166

Runaway Dependencies 167

Exercises 168

 

Part III: Programs to Refactor 171

 

Chapter 15: A Simple Game 173

Code 173

Refactoring 175

Development Episodes 180

 

Chapter 16: Time Recording 183

Preparing the Soil 187

Substitute Algorithm 191

Optional Extras 194

 

Chapter 17: Calculator 197

Code 198

Refactoring 209

Thank You 211

 

Part IV: Appendices 213

 

Appendix A: Answers to Selected Questions 215

The Refactoring Cycle 215

Refactoring Step by Step 216

Refactoring Practice 216

Measurable Smells 217

Names 220

Unnecessary Complexity 222

Duplication 225

Conditional Logic 230

Data 233

Inheritance 237

Responsibility 239

Accommodating Change 241

Libraries 244

A Simple Game 246

Time Recording 247

 

Appendix B: Ruby Refactoring Tools 251

Code Smell Detectors 251

Environments with Refactoring Support 252

 

Bibliography 253

Index 255


Best Seller

| | See All

Product Details
  • ISBN-13: 9780321647887
  • Publisher: Addison-Wesley Professional
  • Publisher Imprint: Addison-Wesley Professional
  • Language: English
  • ISBN-10: 0321647882
  • Publisher Date: 27 Apr 2021
  • Binding: Digital download
  • No of Pages: 290


Similar Products

How would you rate your experience shopping for books on Bookswagon?

Add Photo
Add Photo

Customer Reviews

REVIEWS           
Be The First to Review
Refactoring in Ruby (Adobe Reader)
Addison-Wesley Professional -
Refactoring in Ruby (Adobe Reader)
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Refactoring in Ruby (Adobe Reader)

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book
    Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    | | See All


    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!
    ASK VIDYA