# Style question: ternary operator or short circuit operator or if-end

**URL:** <https://discourse.julialang.org/t/style-question-ternary-operator-or-short-circuit-operator-or-if-end/34224>\
**Category:** General Usage\
**Created:** [February 5, 2020, 9:32pm UTC](https://discourse.julialang.org/t/style-question-ternary-operator-or-short-circuit-operator-or-if-end/34224 "2020-02-05T21:32:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![NicholasWMRitchie](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nicholaswmritchie/32/22449_2.png) [@NicholasWMRitchie](https://discourse.julialang.org/u/NicholasWMRitchie)\
**Post date:** [February 5, 2020, 9:55pm UTC](https://discourse.julialang.org/t/style-question-ternary-operator-or-short-circuit-operator-or-if-end/34224/3 "2020-02-05T21:55:20Z")

</div>

How about `a = max(a,0)` and let the compiler do it’s magic? Easy to understand and likely to inline to almost nothing.

---

_[View the full topic](https://discourse.julialang.org/t/style-question-ternary-operator-or-short-circuit-operator-or-if-end/34224)._
