Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

not-operator

Should I use `!IsGood` or `IsGood == false`?

May 13, 2023 by Tarik

I follow the same syntax as you, it’s less verbose. People (more beginner) prefer to use == true just to be sure that it’s what they want. They are used to use operator in their conditional… they found it more readable. But once you got more advanced, you found it irritating because it’s too verbose.

Categories language-agnostic Tags boolean, language-agnostic, not-operator Leave a comment

Which is clearer form: if(!value) or if(flag == value)?

March 31, 2023 by Tarik

if (!value) is easier/faster to follow. Subjective as you said. As long as you are consistent, this is the main thing. EDIT One other point to add – omitting the true/false keywords should also (hopefully) force the coder to use better named variables. Bool variables should always indicate meaning or state purpose, such as: if … Read more

Categories c# Tags c++, not-operator Leave a comment

What does “!–” do in JavaScript?

September 23, 2022 by Tarik

! inverts a value, and gives you the opposite boolean: !true == false !false == true !1 == false !0 == true –[value] subtracts one (1) from a number, and then returns that number to be worked with: var a = 1, b = 2; –a == 0 –b == 1 So, !–pending subtracts one … Read more

Categories javascript Tags decrement, javascript, not-operator, prefix-operator Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa