Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a single word meaning 'not null'?

In if statements, I am used to seeing x != null, and reading it as "x is not null".

But in function names, having to say 'NotNull' or 'IsNotNull' to explain a similar state feels overly complicated. Not only because it is two or three words, but it also comes with the feeling of being a double negative used to express a positive concept.

What is a good word, hopefully not a long or compound word, which means the same as 'not null'?

Some ideas I've already brainstormed and rejected, and why:

  • "Initialized" would not be great because in most programming languages you can can initialize a variable to be null.

  • "something" might imply "not nothing", and so "not null" to you, but other people's interpretation may differ...

If there is no such word, then you can create one - your suggestions are welcome and I'm sure people will love to vote on their favorites.

like image 729
Tim Lovell-Smith Avatar asked Jan 11 '13 07:01

Tim Lovell-Smith


3 Answers

In PHP there is a function named isset - I think there's no shorter version than this.

like image 90
luukes Avatar answered Nov 20 '22 09:11

luukes


It is based on your preference I think, isset / is / set / exist / has / ...

But don't you think code readability is more important to understand and write, instead of shortening every word

like image 31
strike_noir Avatar answered Nov 20 '22 09:11

strike_noir


VALUED

The caveat here is NULL may be considered a value in some languages, so universal use of VALUED as the antithesis of NULL is not appropriate.

In PHP however, VALUED cleanly opposes NULL.

like image 4
Dave Avatar answered Nov 20 '22 10:11

Dave