I'm discussing with some colleagues about the efficiency of If statements and which is the best in cost of memory and CPU use, at this stage, doesn't matter the language used.
The two conditionals is the following:
If value is present then
skip
If value = "1234" then
execute
So, the first controlls if the value is null, in that case exit (skip) the routine, the second statement compare the variable to a specific value. What I'm thinking is that the first uses more CPU and the second more Ram, what do you think about it?
Do I have to use both so that if the value is null the second statement is skipped? Or is better to use only the second who compare two values? Thank you
Aucun commentaire:
Enregistrer un commentaire