Article 4QSAZ Why do scripting languages use a reverse convention for indicating TRUE and FALSE?

Why do scripting languages use a reverse convention for indicating TRUE and FALSE?

by
hazel
from LinuxQuestions.org on (#4QSAZ)
In C, numerals have a boolean significance. Zero is FALSE as are its equivalents: the NULL pointer and the NULL character. Non-zero numbers are TRUE; in practice TRUE=1. This is clearly intuitive. Computers work in binary: 1 and 0, on and off, set and unset, pulse or no pulse. It seems logical that if there is no pulse when a pulse was expected, that signifies FALSE.

But when calling exit() in your program, you pass 0 for success and 1 for error or failure. That's because a script may need to analyse the behaviour of your program and all Unix scripting languages use that convention rather than the more intuitive one. I assume there must be some historical reason for that. Does anyone know how it originated?latest?d=yIl2AUoC8zA latest?i=nbD0d1QnZdk:HGyDDzoPrjI:F7zBnMy latest?i=nbD0d1QnZdk:HGyDDzoPrjI:V_sGLiP latest?d=qj6IDK7rITs latest?i=nbD0d1QnZdk:HGyDDzoPrjI:gIN9vFwnbD0d1QnZdk
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments