DiscoverProgramming Tech Brief By HackerNoonCode Smell 07 - Avoid Boolean Variables
Code Smell 07 - Avoid Boolean Variables

Code Smell 07 - Avoid Boolean Variables

Update: 2025-10-18
Share

Description

This story was originally published on HackerNoon at: https://hackernoon.com/code-smell-07-avoid-boolean-variables.

Avoid Boolean variables, they lead to conditional logic and force you to write Ifs. Create polymorphic states instead

Check more stories related to programming at: https://hackernoon.com/c/programming.
You can also check exclusive content about #programming, #technology, #software-development, #learn-to-code, #code-smells, #clean-code, #refactoring, #boolean-algebra, and more.




This story was written by: @mcsee. Learn more about this writer by checking @mcsee's about page,
and for more stories, please visit hackernoon.com.





Avoid Boolean variables, they lead to conditional logic and force you to write Ifs. Create polymorphic states instead

Comments 
00:00
00:00
x

0.5x

0.8x

1.0x

1.25x

1.5x

2.0x

3.0x

Sleep Timer

Off

End of Episode

5 Minutes

10 Minutes

15 Minutes

30 Minutes

45 Minutes

60 Minutes

120 Minutes

Code Smell 07 - Avoid Boolean Variables

Code Smell 07 - Avoid Boolean Variables

HackerNoon