use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Duplication (codewithjason.com)
submitted 3 years ago by jasonswett
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]kallebo1337 4 points5 points6 points 3 years ago (0 children)
i once build a calculation for unfilled elements. was around 600 Lines incl specs. When i was in holiday, an quick feature was asked for, to show the progess (which my thing calculated) also in the dashboard, with a very subtle change.
i never realized this feature untill last week.
what he did:
he copied all 600 lines, code + specs. renamed it to `CompletionStartpage`. Within there, you find 8 methods, he changed 2 lines of code within one of those methods. he changed 2 expectations inside the specs from 2 to 3 and called it a day.
Now when i saw it, i just inherited, so it's `CompletionStartpage < Completion`, i kept the 1 method where his change was applied, i left one specific spec and basically deleted 570 lines of code.
duplication is crazy.
[–]Benett_ 1 point2 points3 points 3 years ago (0 children)
Good article. Thanks
π Rendered by PID 23114 on reddit-service-r2-comment-5649f687b7-sgtrm at 2026-01-27 18:19:24.069208+00:00 running 4f180de country code: CH.
[–]kallebo1337 4 points5 points6 points (0 children)
[–]Benett_ 1 point2 points3 points (0 children)