News for hackers. Stuff that matters.
Re:Goodbye, Clean Code by BeetleB on Saturday January 11, 2020 @07:45PM (#22023560)
I disagree.

If they had separate classes for TextBlock and Rectangle, then likely there are separate requirements involved. It may have been that at the time they needed separate classes the requirements for resizeTopLeft was identical, but they are still two separate requirements.

I suggest everyone take a minicourse or read a book on systems engineering - at least the part where they discuss requirements. The fact that two distinct entities have an identical requirement for something does not mean there is one requirement. It means there are two requirements which (for now) happen to be identical.

The key phrase is happen to be. You do not apply DRY to separate requirements even if they are the same/similar.

Look at it from a testing perspective[1], which is similar to how a systems engineer will look at it. If you would write a separate test for it, it is a distinct requirement. (Actually, the ordering should be the opposite: If it is a separate requirement, it should have a separate test).

[1] And not from a TDD perspective!

Re:Goodbye, Clean Code by _____s on Saturday January 11, 2020 @11:14PM (#22024429)
> I suggest everyone take a minicourse or read a book on systems engineering - at least the part where they discuss requirements. The fact that two distinct entities have an identical requirement for something does not mean there is one requirement. It means there are two requirements which (for now) happen to be identical.

I'd love to do this -- do you have any recommendations for a book like this?

Re:Goodbye, Clean Code by BeetleB on Saturday January 11, 2020 @11:35PM (#22024503)
Not really. I took it as part of an inhouse training at work.