language agnostic - True until disproven or false until proven? -
I've noticed something about my coding which is a little undefined. Suppose we have two dimension arrays, a matrix or a table, and we are looking to check that any asset is right for each line or nested dimension.
Say that I have a Boolean flag that is used to check if a property is right or wrong. My options are:
- Start it right And check each cell until it is certified false. This gives the wrong name until the code is executed completely.
- Start on the lie and check each line until prove the truth. Only if all rows are correct, the data will be correct. What is the safest way to do this without a counter?
I have always done without thinking, but today I started thinking about it. About 2?
They actually both amount to the same thing and since you say "of a property The investigation is true for every line or nested dimension ", I believe that reading the first method and maybe a little faster.
Until the code is fully executed, you should not try to read the value of the flag, because the check is not finished if you are running asynchronous code, by reaching the value while you are unstable Should stop.
Both methods "give false names" until the code is executed. 1 gives false positive and 2 gives false negative. I'm not sure what you are trying to avoid by saying this - if you can get the "true" value before running your code completely, then you have not run your code in the first place.
How to apply without each counter (if you do not have foreach syntax in your language, then appropriate enumerator-> gt; next Loop syntax):
1:
Bull flag = true; Foreign currency (items in array) {if ((check items (!) {Flag = false; break; }} 2:
Bull flag = false; Foreign currency (item in array) {if ((check item (see)) {break; } And if (item. Isistlist) {flag = true; }}
Comments
Post a Comment