---
title: "Discussion on \"Code Smell 212 - Elvis Operator\" | Hashnode"
description: "Discussion on \"Code Smell 212 - Elvis Operator\". Your code is not safer using this operator\n\nTL;DR: Don't propagate nulls.\n\nProblems\n\nNULL propagation\n\nHarder to read code\n\nHacky code\n\n\nSolutions\n\nRemove the nulls. \n\nIf you can't remove it, deal explicitly with them.\n\n\nContext\nThe Elvis operator is..."
url: "https://hashnode.com/posts/code-smell-212-elvis-operator/645f8ac33159e7dc504eba5f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Code Smell 212 - Elvis Operator](https://maximilianocontieri.com/code-smell-212-elvis-operator?utm_source=hashnode&utm_medium=feed)

Your code is not safer using this operator TL;DR: Don't propagate nulls. Problems NULL propagation Harder to read code Hacky code Solutions Remove the nulls. If you can't remove it, deal explicitly with them. Context The Elvis operator is...

May 13, 2023 · 2 min read · maximilianocontieri.com  
Updated May 24, 2023  
Read the article

-   [#programming](https://hashnode.com/tag/programming)
-   [#null](https://hashnode.com/tag/null)
-   [#refactoring](https://hashnode.com/tag/refactoring)
-   [#code-smell-1](https://hashnode.com/tag/code-smell-1)
-   [#clean-code](https://hashnode.com/tag/clean-code)

## Written by

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

@mcsee · Buenos Aires

  
[View profile](https://hashnode.com/@mcsee)

Software Engineer

I’m a senior software engineer loving clean code, and declarative designs. S.O.L.I.D. and agile methodologies fan.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
