Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unless and Until in programming languages

What is the difference between

if (false == <condition>)

and

if (!<condition>)

and

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

unless (<condition>)


What is the difference between

while (false == <condition>)

and

while (!<condition>)

and

until (<condition>)


Why isn’t unless and until in all programming languages?

Thank you for your help.

>Solution :

if (false == <condition>)

and

if (!<condition>)

and

unless (<condition>)

Logically, they are all equivalent.

Likewise:

while (false == <condition>)

and

while (!<condition>)

and

until (<condition>)

Logically they are equivalent. Except syntactically, until() might be used at the end of a loop and while() at the beginning of a loop.

Although logically they are equivalent, some programming languages provide them (unless, until) for readability.

And you might want to take a look of this to trace back their first usage in programming language.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading