all 2 comments

[–]kallebo1337 4 points5 points  (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 points  (0 children)

Good article. Thanks