154 reputation
3
bio website
location Washington, DC
age 28
visits member for 2 years, 8 months
seen 22 hours ago

Aug
18
comment Is there a way to avoid type-checking in this scenario?
Sure, there are always trade-offs to consider (is this a one-off script vs. a enterprise application? etc.). The question/context so far is based on how to do this in an OOP appropriate way, which I still submit is not the right way to go about it if you're trying to stick to the tenets of OOP. Your last line could be argued for just about anything :). Hopefully OP chimes in with something a bit more concrete.
Aug
18
comment Is there a way to avoid type-checking in this scenario?
I disagree. That was only one example of why the code could become tricky to maintain. Once you start splitting functionality on Type in multiple ways, you completely lose the ability to let the Types/Interfaces speak for themselves and you end up leaving consumers to guess at how they are used because no contract exists.
Aug
18
awarded  Teacher
Aug
18
answered Is there a way to avoid type-checking in this scenario?
May
3
awarded  Supporter
Feb
9
comment What are some good small-scale refactoring tests?
Do you have any suggestions for those easier ways to weed out bad candidates? I hate a lot of the typical data structure and algorithm tests because they don't really apply to our project which is a web app with pretty high-level concerns. One could argue they are still good candidate filters, but I want to test their design abilities as well (it's something we've found to be lacking in a lot of developers and seems harder to test for).
Feb
9
comment What are some good small-scale refactoring tests?
Really? I would argue the exact opposite. Maybe we're not talking about the same level of reuse, but on the small scale I think dividing code into reusable pieces promotes separation of concerns, easier to understand code (e.g., one large method broken out into pieces that can be reused and each describe exactly what they do, etc.), and makes it easily tested. Maybe I described it wrong. I'm not looking for someone who will apply a design pattern to "Hello World", more-so I want someone who can at least recognize a good opportunity for using one when it's beneficial to the solution.
Feb
8
awarded  Student
Feb
8
asked What are some good small-scale refactoring tests?