Thanks for reading my article. It’s much appreciated :)
if is completely fine. I think you’re missing the point. The point is to not use conditional branching to extend your application.
The code you pasted is handling dynamic type discovery.
Also, reflection is entirely suitable in this scenario.