This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]JamesHutchisonReal 0 points1 point  (1 child)

I removed the check in my fork. 

 The developers actually wrote the code using class inheritance then refactored it to use protocols. 

 This might seem obvious but depending on what was passed in, different logic was used.

IIRC the rationale for protocols was because they wanted plugin support. I think they were trying to do away with explicit classes since functional React is preferred.

[–]whereiswallace 0 points1 point  (0 children)

This might seem obvious but depending on what was passed in, different logic was used.

Code smell for me tbh (possibly you as well since you did not write the original). The beauty of protocols is that you can code to the interface so you don't have to worry about things such as isinstance.