PTE · Reading · easy
Read the text and answer the multiple-choice question by selecting the correct response. Only one response is correct.
In software engineering, two prominent paradigms govern how developers formulate computational tasks: imperative programming and declarative programming. Imperative programming requires the programmer to explicitly delineate every step the computer must execute to achieve an intended outcome. Using commands, conditional branches, and state modifications, the code acts as an algorithmic recipe that dictates precisely how computations proceed from start to finish. In contrast, declarative programming focuses entirely on specifying what the final result should look like, leaving the underlying execution details to the software environment or compiler. Database query languages represent a classic example of this approach. When an analyst writes a query to extract specific customer records, they define the criteria that the matching data must satisfy, rather than scripting the low-level search loops or memory indexing routines. Proponents of declarative paradigms argue that this abstraction minimizes common programming bugs and makes complex code significantly easier to read and maintain, although imperative approaches often provide superior control over fine-grained machine performance.
According to the passage, how does declarative programming differ fundamentally from imperative programming?
- It provides developers with greater control over fine-grained machine efficiency.
- It describes the intended output rather than outlining sequential operational instructions.
- It requires software engineers to manually write low-level memory indexing routines.
- It relies predominantly on conditional branches to manipulate internal system states.
- It is suited exclusively for executing database queries rather than general computation.