That time I wrote a query with chained ruby methods weighing in at 41 lines and 2844 chars
First things first, I REFACTORED THIS NASTY MESS! And this is focused on how I got into the mess and some of the first things I did to addressed it.In my opinion Ruby is great and Rails is amazing. They make me a happy programmer and pretty productive. But I find keeping some solid rules in mind when coding is always good. I’ve started trying to hold myself to things like “more classes are better then fewer” and “keep methods short” - when I hit 10 lines really think about how to break it out.
#ruby #rails #rubyonrails #bosnia #programming #tutorials #news #rubydeveloper #railsdeveloper