# Boolean not

DevFeed: [Boolean not](<https://devfeed.tech/articles/boolean-not-38642.md>)

Original publisher: [Read original article](<https://krossovochkin.com/posts/2020_10_31_boolean_not/>)

Published: 2020-10-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [Vasya Drobushkov](<https://devfeed.tech/sources/vasya-drobushkov.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [function](<https://devfeed.tech/topics/function.md>)

Tags: [boolean](<https://devfeed.tech/tags/boolean.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [logic](<https://devfeed.tech/tags/logic.md>), [operator](<https://devfeed.tech/tags/operator.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [xor](<https://devfeed.tech/tags/xor.md>)

## AI overview

This Kotlin tutorial explains Boolean negation, focusing on the not() method and the readability of different ways to express negative conditions. It recommends positive function names in general, with negative forms added when they represent common business logic, and explains that not() is an operator function.

## Source excerpt

Introduction Boolean is one of the essential types in programming and probably one of the simplest because it has only two values: true and false. Boolean are usually used as flags for control flow, specifically, conditions. if (string.isEmpty()) { println("String is empty") } It is not much interesting in Boolean, but in Kotlin there is one thing which might be confusing if used - it is method not(). Negate Boolean If we look at declaration of Boolean class in Kotlin we'll see five methods, four of which are pretty obvious: and, or, xor and compareTo. And the fifth is not: