Suppose we check for two conditions at the same time:
if( (a == b) & (b == c) ).
a is not equal to
b, that makes the first condition false. And that means the whole expression is false regardless of the second condition. So while executing this code, if we find out that
a != b, we could hypothetically skip the evaluation of the second condition and save some computer time (and gas fee).
Some programming languages check both conditions regardless of the outcome of the first check, and some have such an optimization that lets them skip the unnecessary checking. How does FunC behave in such situations?
This question was imported from Telegram Chat: https://t.me/tondev/86205
Tuseme sisi kuangalia kwa ajili ya hali mbili kwa wakati mmoja: kama ((a == b) & (b == c) ). a si sawa na b, ambayo inafanya hali ya kwanza uongo. Na hiyo ina maana ya usemi mzima ni uongo bila kujali hali ya pili. Hivyo wakati wa kutekeleza code hii, kama sisi kupata kwamba a! = b, tunaweza hypothetically kuruka tathmini ya hali ya pili na kuokoa baadhi ya wakati wa kompyuta (na gesi ada). Baadhi ya lugha za programu kuangalia hali zote mbili bila kujali matokeo ya kuangalia kwanza, na baadhi ya kuwa na optimization kama kwamba inaruhusu yao kuruka kuangalia zisizohitajika. FunC hujiendeshaje katika hali kama hizo? "Kama ilivyoelezwa hapo juu, ujumbe huo ulitolewa kwenye Telegram chat, ambayo ni ""Telegram chat"" na ni ""Telegram chat"" na ""Telegram chat"" ni ""Telegram chat"" na ""Telegram chat"" ni ""Telegram chat"" na ""Telegram chat"" ni ""Telegram chat"" na ""Telegram chat"" ni ""Telegram chat"" na ""Telegram chat"" ni ""Telegram chat"" na ""Telegram chat"" ni ""Telegram chat."""