[Rails] Re: ruby koans don't understand the principle sandwhich code
> But I don't get the principle.
There is no such principle as the Sandwich principle. The principle is
Don't Repeat Yourself(DRY). So if you find yourself writing the same or
similar code over and over again, try to figure out a way to extract the
repeated part into a method. That way you can write the code once in
the method, and then call the method when needed.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home