---
title: "Comment by Nate Sire on \"Code Smell 119 - Stairs Code\" | Hashnode"
description: "I often use object literals in place of if/else or switch statements. JS is nice about that."
url: "https://hashnode.com/posts/code-smell-119-stairs-code/6226ce6456920671339a0c0c/comment/622711c056920671339a18fe"
---

[Discussion](https://hashnode.com/posts/code-smell-119-stairs-code/6226ce6456920671339a0c0c)

Comment [Code Smell 119 - Stairs Code](https://hashnode.com/posts/code-smell-119-stairs-code/6226ce6456920671339a0c0c)

[Nate Sire](https://hashnode.com/@natesire)

[Mar 8, 2022](https://hashnode.com/posts/code-smell-119-stairs-code/6226ce6456920671339a0c0c/comment/622711c056920671339a18fe)

I often use object literals in place of if/else or switch statements. JS is nice about that.

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

[Mar 8, 2022](https://hashnode.com/posts/code-smell-119-stairs-code/6226ce6456920671339a0c0c/comment/622711c056920671339a18fe#reply-6227755533120280724e7626)

That's ok if it brings more declarativeness

But switches violate open closed principle so they are yet another code smell
