Open ghost opened 6 years ago
Do we need to worry about the short circuiting in C, as it can lead to edge cases in our evaluation. But its part of the spec. but also doesnt it count as a type of optimization? Shall we consider this when creating our compilers?
I am not sure what is in the assessment, but I assume you do. The following style of code, for eg, is fairly common in programs.
bool first_element_greater_than_1(int *a, int len) { return len > 0 && a[0] > 0; }
Do we need to worry about the short circuiting in C, as it can lead to edge cases in our evaluation. But its part of the spec. but also doesnt it count as a type of optimization? Shall we consider this when creating our compilers?