Reddit Reddit reviews Refactoring: Ruby Edition: Ruby Edition (Addison-Wesley Professional Ruby Series)

We found 5 Reddit comments about Refactoring: Ruby Edition: Ruby Edition (Addison-Wesley Professional Ruby Series). Here are the top ones, ranked by their Reddit score.

Computers & Technology
Books
Computer Science
Computer Systems Analysis & Design
Refactoring: Ruby Edition: Ruby Edition (Addison-Wesley Professional Ruby Series)
Check price on Amazon

5 Reddit comments about Refactoring: Ruby Edition: Ruby Edition (Addison-Wesley Professional Ruby Series):

u/SquireCD · 7 pointsr/rubyonrails

Practical Object-Oriented Design by Sandi Metz and Refactoring: Ruby Edition by Jay Fields, Shane Harvie, and Martin Fowler with Kent Beck were both invaluable for me. They’re more Ruby focused than Rails, but these will help with Rails and so much more.

I apply what I learned in these books in Python, PHP, Ruby, and any other object oriented language I happen to be using.

u/acconrad · 3 pointsr/rails

Extract properties into a class, so if you have a class like User and it has a series of address properties, create an Address class and extract those properties out into your new class and make sure it belongs_to :user. Then, if other types of classes need something similar (such as a Billing object), you can use the same class and have that belong to that object as well.

As far as naming, feel free to use whatever you want, though it might be best to use province instead of state since the word "state" in programming means something different, not to mention a province generally covers that same kind of location as a US state does (in fact I'm pretty sure under the hood Google Maps API handles it this way as well). Also make sure you store zip codes as a string since many countries use letters in their zips and US zip codes use a dash to include localized neighborhoods or PO boxes.

I'd pick up a book like Refactoring (Ruby ed.) which covers this pattern and a whole lot more.

u/fedekun · 1 pointr/ruby

It can be hard at first, but it's really worth it. If you surpass the 100 lines limit for a class it's surely doing too much, try splitting it into several smaller classes, or at least some concerns.

Something which can help with that is Refactoring: Ruby Edition, it's more of a senior-level book than POODR, and you can't read it from cover to cover, you have to stop at each pattern, see if you can apply it, then repeat, but it's definitely a great resource, and it helps you "develop an eye" for bad code.

Reek seems to use some smells from the Refactoring book. Not sure if all of them can be analyzed statically though.

EDIT: I didn't know Sandi was updating POODR, I think she's just working on 99 Bottles of OOP, her new book.

u/rodreegez · 1 pointr/rails

I second the comment to learn SQL really well. Also regular expressions come up frequently enough to be worth learning a bit about. Some familiarity with data structures is worth picking up, and getting a grasp on some common design patterns is well worth the time.

On the last point, I’d recommend Design Patterns in Ruby and Refactoring Ruby

Hope that helps.