---
title: "Discussion on \"Explicit is better than tricks\" | Hashnode"
description: "Discussion on \"Explicit is better than tricks\". When writing code, it is always better to be as explicit as possible instead of going for tricks. This concept is best explained by examples so let's get right into it.\nThe double bang !! (logical NOT)\nThis one is by far the most common \"trick\" in th..."
url: "https://hashnode.com/posts/explicit-is-better-than-tricks/61e2b5a01f35f37864469479"
---

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

Discussion

# [Explicit is better than tricks](https://blog.bracketsinstitute.com/explicit-is-better-than-tricks?utm_source=hashnode&utm_medium=feed)

When writing code, it is always better to be as explicit as possible instead of going for tricks. This concept is best explained by examples so let's get right into it. The double bang !! (logical NOT) This one is by far the most common "trick" in th...

Jan 15, 2022 · 5 min read · blog.bracketsinstitute.com  
Updated Jan 18, 2022  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#programming](https://hashnode.com/tag/programming)
-   [#beginners-learningtocode-100daysofcode](https://hashnode.com/tag/beginners-learningtocode-100daysofcode)

## Written by

[NRF](https://hashnode.com/@therealnrf)

@therealnrf

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

React Developer

I'm a front-end web developer mostly focused on JavaScript. Specifically, React.

## Responses 4

Markdown supported · ⌘↵ to post

[Basharath](https://hashnode.com/@basharath)

[Jan 18, 2022](https://hashnode.com/posts/explicit-is-better-than-tricks/61e2b5a01f35f37864469479/comment/61e653f6be5d7633af87cb0b)

It's interesting to read this.

[Jon Randy](https://hashnode.com/@jonrandy)

[Jan 16, 2022](https://hashnode.com/posts/explicit-is-better-than-tricks/61e2b5a01f35f37864469479/comment/61e3b1df8a425719c1733e03)

Potential performance gains should not be dismissed. Some of these 'tricks' can make your code orders of magnitude faster

[NRF](https://hashnode.com/@therealnrf)

[Jan 16, 2022](https://hashnode.com/posts/explicit-is-better-than-tricks/61e2b5a01f35f37864469479/comment/61e3b1df8a425719c1733e03#reply-61e4903c9f8415199ccae419)

If that really is the case then go for it. And comment the code I guess.

[Jesse Bellingham](https://hashnode.com/@jessebellingham)

[Jan 16, 2022](https://hashnode.com/posts/explicit-is-better-than-tricks/61e2b5a01f35f37864469479/comment/61e3b1df8a425719c1733e03#reply-61e4968e8a425719c1735151)

I disagree, they should be dismissed if performance is not strictly a primary goal for the piece of code you are writing. If there is evidence to suggest that performance is, or will be a problem, then by all means.

[Jesse Bellingham](https://hashnode.com/@jessebellingham)

[Jan 16, 2022](https://hashnode.com/posts/explicit-is-better-than-tricks/61e2b5a01f35f37864469479/comment/61e369819f8415199ccacc2a)

Good stuff!

> When writing code, readability should be a priority.

I can't agree with this more, and I would add that sometimes even things that aren't necessarily _tricks_, things like common language constructs, do more harm than good to the readability of code. An idea I've seen come up a lot is **shorter == better**; so for example, people will apply ternary operators to make the code more concise, but it just means that you have to study the code for those extra few seconds.

[NRF](https://hashnode.com/@therealnrf)

[Jan 16, 2022](https://hashnode.com/posts/explicit-is-better-than-tricks/61e2b5a01f35f37864469479/comment/61e369819f8415199ccacc2a#reply-61e490208a425719c17350e7)

Precisely. The 'shorter is better' mentality is, for some reason, very prevalent.

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

[Jan 15, 2022](https://hashnode.com/posts/explicit-is-better-than-tricks/61e2b5a01f35f37864469479/comment/61e2cbebd546507ab0344863)

Great Article !

Please do write more on this topic!

[NRF](https://hashnode.com/@therealnrf)

[Jan 15, 2022](https://hashnode.com/posts/explicit-is-better-than-tricks/61e2b5a01f35f37864469479/comment/61e2cbebd546507ab0344863#reply-61e2ff2bd546507ab0344fc5)

Thanks!
