Comments on Sequence Points

Veetrag said:

I completely agree with what you are trying to say. I tried to explain the same stuff 6 years back when I was put incharge of designing questions for a programming competition. I tried to explain it to organizers how ambiguous these questions can be, considering the fact that most participants/compilers do not follow the ANSI standard properly. Secondly, these questions are not real test of programming skills, they are just some gimmicks to 'wow' people, real life programming is much different.

Susam Pal said:

The answers to such questions are not ambiguous. They have an unambiguous answer: undefined behaviour. In fact, I believe that these questions are a good test of how well one knows the C language. If one writes code that invokes undefined behaviour or tries to predict the output of such code, it indicates missing knowledge.

Further the knowledge of undefined behaviour is important for a professional software developer writing code in C. Writing code in C without understanding the concept of undefined behaviour leads to fragile and insecure software.

Javin Paul said:

There are other features also in other programming languages like threading in Java which is completely dependent on JVM behavior or garbage collection in Java which varies across JVM to JVM.

CH Gowri Kumar said:

Well, the reason why the same or similar questions arise is simple. People, out of ignorance, read wrong books and there are a few who can guide them to use the right books and the right platform/environment to learn C. The Indian market is full of books that still teach C using Turbo C and the questions/exercises contain precisely questions about these. Many of the examples in such books include conio.h!