Compilers are less forgiving.
For example, if you omit the quotation mark close to the end of the instruction,
if (int_rate > 100) message_box("Interest rate error);the C++ compiler will get quite confused and complain that it cannot translate an instruction containing this error which is a good thing. If the compiler were to try to guess what you did wrong and try to fix it, it might not guess your intentions correctly.
In that case, the resulting program would do the wrong thing with side effects.
When a compiler reads programming instructions in a programming language, it will translate them into machine code only if the input follows the language conventions exactly. Just as there are many human languages, there are many programming languages. Consider the instruction
if (int_rate > 100) cout << "Interest rate error";This is how you must format the instruction in C++. But in Visual Basic (a popular programming language for business applications) the same instruction would be written as
if int_rate > 100 then System.Console.Write("Interest rate error") end ifCompilers are language-specific and the C++ compiler will translate only C++ code, whereas a Visual Basic compiler will reject anything but legal Visual Basic code. For example, if a C++ compiler reads the instruction
if int_rate > 100 then ...,
it will complain, because the condition of the if statement is not surrounded by parentheses ( ), and the compiler does not expect the word then. The choice of the layout for a language construct such as the if statement is somewhat arbitrary. The designers of different languages make different tradeoffs among readability, easy translation, and consistency with other constructs.