Question: I have this simple Ruby code that is processing command line arguments:

```
if !ARGV.length <= 2
    print "clierr: please pass an arg"
end

```

It is giving me this error message:

```
client.rb:rb:1:in `<main>': undefined method `<=' for false:FalseClass (NoMethodError)

```

As far as I know, `<=` means less than or equal to. And `ARGV` is the global argument list in Ruby. So why is it erroring?

Answer: 
> 
> So why is it erroring?
> 
> 
> 

This is **not** because `!` is a method and you need to call it with parentheses. This is due to [operator precedence or order of operations](https://en.wikipedia.org/wiki/Order_of_operations)

In Ruby, all integers evaluate to `true`, the only values that are evaluated to `false` are `false` and `nil`, per [the documentation](http://ruby-doc.org/core-2.1.1/FalseClass.html). Now, let's look at your condition:

```
if !ARG.length <= 2

```

In this example, `!` is the NOT operator. Performing this operation implicitly coerces it into a boolean for boolean operation. And since, as mentioned earlier, `ARGV.length` is an integer, it is evaluated to `true`, thus `!true` is `false`. 

`!` happens first because `!` has [higher precedence](https://gist.github.com/tian-im/3877402) than `<=`. After `!ARGV.length` is evaluated, Ruby then reports that you are trying to do comparison on `false` and an integer, that's illegal. You have to use grouping to control which operations happen when:

```
if !(ARGV.length <= 2)

```

The parentheses will tell Ruby to evaluate the condition inside the parentheses first, then continue evaluating, like order of operations. So, the inside is evaluation, then logical NOT happens.
The right syntax is:

```
if  !(ARGV.length <= 2)
    print "clierr: please pass an arg"
end

```

Or you can use unless.