How to Get Rid of Annoying IFs Foreverby@mcsee
2,689 reads
2,689 reads

How to Get Rid of Annoying IFs Forever

by Maximiliano Contieri4mNovember 8th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Most IF sentences are coupled to accidental decisions. This coupling generates ripple effect and make code harder to maintain. Ifs open doors to even worse problems, like switches, cases, defaults, return, continue and breaks. They make algorithms darker and force us to build accidentally complex solutions. Part II: Create a Polymorphic Hierarchy for every IF condition (if it doesn’t already exist). Move every IF Body to the former abstraction. Replace IF Call by polymorphic method call.

Company Mentioned

Mention Thumbnail

Coins Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - How to Get Rid of Annoying IFs Forever
Maximiliano Contieri HackerNoon profile picture
Maximiliano Contieri

Maximiliano Contieri

@mcsee

I’m senior software engineer specialized in declarative designs and S.O.L.I.D. and Agile lover.

About @mcsee
LEARN MORE ABOUT @MCSEE'S
EXPERTISE AND PLACE ON THE INTERNET.

Share Your Thoughts

About Author

Maximiliano Contieri HackerNoon profile picture
Maximiliano Contieri@mcsee
I’m senior software engineer specialized in declarative designs and S.O.L.I.D. and Agile lover.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
L O A D I N G
. . . comments & more!