end def url_for # url logic module Foo2 end def url_for end # url logic end module Foo5 end def url_for # url logic module Foo3 end def url_for end # url logic end end this happens five times
orientation gives Ruby much of its power and expressiveness. […] In Rails, however, sadly, there are large swathes which are not object oriented, and in my opinion, these areas tend to be the most painful parts of Rails.” this is mostly true, especially if you’re talking about weird corners of the Rails internals
orientation gives Ruby much of its power and expressiveness. […] In Rails, however, sadly, there are large swathes which are not object oriented, and in my opinion, these areas tend to be the most painful parts of Rails.”
orientation gives Ruby much of its power and expressiveness. […] In Rails, however, sadly, there are large swathes which are not object oriented, and in my opinion, these areas tend to be the most painful parts of Rails.” I mostly agree with this. but only MOSTLY.
ignore a really obvious, practical OOP choice like creating a URL class, and you instead create Lisp-like code, you’re probably going to be able to get away with ignoring the obvious, practical OOP choice.
talks to the database • It communicates across the network • It touches the file system • It can't run at the same time as any of your other unit tests • You have to do special things to your environment to run it. and he said this about testing
talks to the database • It communicates across the network • It touches the file system • It can't run at the same time as any of your other unit tests • You have to do special things to your environment to run it.
into your unit tests, they aren’t really about those methods any more; they are about the integration of your code with that other software. and he said this about testing
into your unit tests, they aren’t really about those methods any more; they are about the integration of your code with that other software. and he said this about testing
was hard to even persuade a lot of people to take TDD seriously in the first place. now everybody knows they need to do it. so maybe there’s more to the story.
end foo.bar # => 42 this is 100% valid Ruby where you add a method to an object without adding it to a class. I hope it’s obvious that transformations of this nature do not make it effortless to reason about your software coherently.
do |format| if @user.save UserMailer.deliver_welcome_email(@user) end end end end you never see this on day-to-day Rails work, but the code which gets @user from here out into your view is working at a similar level of crazy
do |format| if @user.save UserMailer.deliver_welcome_email(@user) end end end end you never see this on day-to-day Rails work, but the code which gets @user from here out into your view is working at a similar level of crazy
do |format| if @user.save UserMailer.deliver_welcome_email(@user) end end end end you never see this on day-to-day Rails work, but the code which gets @user from here out into your view is working at a similar level of crazy
orientation gives Ruby much of its power and expressiveness. […] In Rails, however, sadly, there are large swathes which are not object oriented, and in my opinion, these areas tend to be the most painful parts of Rails.” again I have to disagree!
class to change. so this, to some extent, is classic thinking, but also, to some extent, legacy thinking. it’s a good rule of thumb. you should DEFINITELY give it serious consideration and it very often leads to good code. but you can’t be fanatical about it either. OOP zealotry is not the way to understand Rails.
this is one of the amazingly obvious insights behind Rails’s success. and the way you make it easy is by writing code! Rails is full of code which exists purely to make the experience of building applications a PLEASANT one. and that is SO IMPORTANT.