312-50V11 · Question #350
What is the main disadvantage of the scripting languages as opposed to compiled programming languages?
The correct answer is D. Scripting languages are slower because they require an interpreter to run the code.. The primary disadvantage of scripting languages compared to compiled languages is execution speed, because scripts are interpreted line-by-line at runtime rather than being pre-compiled to native machine code.
Question
What is the main disadvantage of the scripting languages as opposed to compiled programming languages?
Options
- AScripting languages are hard to learn.
- BScripting languages are not object-oriented.
- CScripting languages cannot be used to create graphical user interfaces.
- DScripting languages are slower because they require an interpreter to run the code.
How the community answered
(48 responses)- B2% (1)
- C4% (2)
- D94% (45)
Why each option
The primary disadvantage of scripting languages compared to compiled languages is execution speed, because scripts are interpreted line-by-line at runtime rather than being pre-compiled to native machine code.
Scripting languages like Python and JavaScript are widely considered easier to learn than compiled languages such as C++ or Java, making this the opposite of the actual tradeoff.
Many scripting languages are fully object-oriented - Python, Ruby, and JavaScript all natively support classes, inheritance, and encapsulation.
Scripting languages can create graphical user interfaces, as demonstrated by Python's tkinter library and JavaScript's DOM manipulation for browser-based UIs.
Scripting languages rely on an interpreter to parse and execute code at runtime, introducing overhead on every execution cycle. Compiled languages convert source code to machine code once before execution, allowing the CPU to run instructions directly without translation. This fundamental difference makes interpreted scripts significantly slower in compute-intensive scenarios compared to compiled equivalents.
Concept tested: Interpreted vs compiled language performance tradeoffs
Source: https://developer.mozilla.org/en-US/docs/Glossary/Script
Topics
Community Discussion
No community discussion yet for this question.