312-50V9 · Question #125
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. Scripting languages incur a performance penalty because their code is executed line-by-line by an interpreter at runtime rather than being pre-compiled to 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
(18 responses)- A6% (1)
- C6% (1)
- D89% (16)
Why each option
Scripting languages incur a performance penalty because their code is executed line-by-line by an interpreter at runtime rather than being pre-compiled to machine code.
Scripting languages are generally considered easier to learn than compiled languages due to simpler syntax and dynamic typing, making this statement incorrect.
Many scripting languages such as Python and Ruby are fully object-oriented, so lack of OOP support is not a valid disadvantage.
Scripting languages can be used to create graphical user interfaces - for example, Python supports GUI development via Tkinter, PyQt, and other frameworks.
Scripting languages such as Python, Bash, and JavaScript rely on an interpreter that parses and executes code at runtime, which introduces overhead compared to compiled languages like C++ that translate code directly to machine code before execution. This interpretation step means each instruction must be processed dynamically, resulting in slower execution speeds. For performance-critical applications, this is the primary trade-off when choosing a scripting language.
Concept tested: Interpreter overhead in scripting vs compiled languages
Source: https://learn.microsoft.com/en-us/windows/wsl/compare-versions
Topics
Community Discussion
No community discussion yet for this question.