in Compiler Design recategorized by
4,959 views
15 votes
15 votes

Using longer identifiers in a program will necessarily lead to:

  1. Somewhat slower compilation
  2. A program that is easier to understand
  3. An incorrect program
  4. None of the above
in Compiler Design recategorized by
5.0k views

2 Answers

27 votes
27 votes
Best answer

AnswerOption A) is Correct because lex will take more time to recognize the longer identifiers.

edited by

3 Comments

Is it not ''A program that is easier to understand'' because more identifier makes a program more understandable ??
0
0
It is “longer identifier”, not “more identifiers”. Also, longer identifier may not necessarily be meaningful
3
3
edited by

anmolsingh123 int  mirzapurseason3= 5; longer identifier but not meaningful :) .

4
4
1 vote
1 vote

Option A: The longer the identifier, the more time it will take to scan the input string. Therefore, leading to more compilation time. Correct.

Option B: focus on the word necessary in the question. In simple language, option B can be paraphrased as

Longer identifiers in the program is a necessary condition for a program to be easier to understand which is equivalent to 

If no longer identifiers in the program, the program is not easy to understand, the contrapositive of which is

If the program is easy to understand, it has longer identifiers. 

The last implication is not a tautology. Hence option B is incorrect.

Conclusion: Option B can be made incorrect using mathematical logic.

 

 

Answer:

Related questions