What are you wanting to represent with it? If you're just trying to represent 
whether something is present or not, the `Option` type will do well. It's also 
typesafe, and won't crash the program if you try to use it as a normal value. 
On the other hand, you can use `nil` for ref types, which is a direct 
equivalent of `NULL` in C, aka `0` used as a pointer that points to nothing.

In Nim, if you try to `get` an Option value that is `None`, it'll raise an 
exception, similar to what you might expect from a language like Python or 
JavaScript. On the other hand, trying to use a `nil` value will result in a 
program crash, like in C. In most cases, you should use `Option` if you need 
something that could be none, and avoid nil, even on reference types.

Reply via email to