---
title: "Comment by Maxi Contieri on \"How to code like a pro in 2022 and avoid If-Else\" | Hashnode"
description: "I am a senior programmer and I avoid IFs althougheter by using polymorphism Your &quot;senior&quot; example violates Open Closed Principle So, IMHO article is n"
url: "https://hashnode.com/posts/how-to-code-like-a-pro-in-2022-and-avoid-if-else/62aab3692b2b09182b654c62/comment/62afc2eed8afe74aa51fe397"
---

[Discussion](https://hashnode.com/posts/how-to-code-like-a-pro-in-2022-and-avoid-if-else/62aab3692b2b09182b654c62)

Comment [How to code like a pro in 2022 and avoid If-Else](https://hashnode.com/posts/how-to-code-like-a-pro-in-2022-and-avoid-if-else/62aab3692b2b09182b654c62)

[Maxi Contieri](https://hashnode.com/@mcsee)

[Jun 20, 2022](https://hashnode.com/posts/how-to-code-like-a-pro-in-2022-and-avoid-if-else/62aab3692b2b09182b654c62/comment/62afc2eed8afe74aa51fe397)

I am a senior programmer and I avoid IFs althougheter by using polymorphism

Your "senior" example violates Open Closed Principle

So, IMHO article is nice but incomplete

[Thai Tran](https://hashnode.com/@thaitran)

[Jun 20, 2022](https://hashnode.com/posts/how-to-code-like-a-pro-in-2022-and-avoid-if-else/62aab3692b2b09182b654c62/comment/62afc2eed8afe74aa51fe397#reply-62afc9f40924134a8048af80)

Hi [Maxi Contieri](https://hashnode.com/@mcsee). Thank you for reading and commenting on my blog post. As always, I'm interested in hearing about SOLID principles. Would you please mind sharing with us more on that so that we could all learn from you?

[Maxi Contieri](https://hashnode.com/@mcsee)

[Jun 20, 2022](https://hashnode.com/posts/how-to-code-like-a-pro-in-2022-and-avoid-if-else/62aab3692b2b09182b654c62/comment/62afc2eed8afe74aa51fe397#reply-62b06df2c0f84f6b540d0f2d)

Hi [Thai Tran](https://hashnode.com/@thaitran)

Yes of course!

This article brings your senior solution:

[maximilianocontieri.com/code-smell-133-hardcoded-…](https://maximilianocontieri.com/code-smell-133-hardcoded-if-conditions)

This one talks about the problem with IFs

[maximilianocontieri.com/code-smell-36-switchcasee…](https://maximilianocontieri.com/code-smell-36-switchcaseelseifelseif-statements)

And this one shows how to use polymorphism instead of IFs

[maximilianocontieri.com/how-to-get-rid-of-annoyin…](https://maximilianocontieri.com/how-to-get-rid-of-annoying-ifs-forever)

Thanks again for your article. It started a good conversation

[Thai Tran](https://hashnode.com/@thaitran)

[Jun 21, 2022](https://hashnode.com/posts/how-to-code-like-a-pro-in-2022-and-avoid-if-else/62aab3692b2b09182b654c62/comment/62afc2eed8afe74aa51fe397#reply-62b1304cc0f84f6b540d2504)

Hi [Maxi Contieri](https://hashnode.com/@mcsee) . Thanks very much for sharing it. This will be very helpful for my next posts.
