1. Aids to Development: Libraries & Generators
Modern software development rarely starts from scratch. Developers use tools to speed up the process and improve quality. Two key aids are program libraries and program generators. A Program Library is a collection of pre-written, pre-tested code modules that can be 'called' by another program to perform common tasks. For example, instead of writing code to calculate a square root, a developer can use a function from a math library. A Program Generator is a tool that automatically writes source code based on a specification or model. They are often used to create 'boilerplate' code, such as the basic structure of a file, or to generate complex user interfaces by allowing a developer to drag and drop components.
Key term
Examiner insight
Fun fact
Worked example 14 marks
A developer is creating a new graphics editing application. Explain two benefits of using a program library for handling file formats like JPEG and PNG.
- 1
Benefit 1: Reduced Development Time. The developer does not need to write the highly complex code required to parse, compress, and render JPEG/PNG files from scratch. They can simply call functions from a pre-existing graphics library, which significantly speeds up the project timeline.
- 2
Benefit 2: Increased Reliability. Established graphics libraries have been used and tested by thousands of developers and users. This means they are likely to be more robust and have fewer bugs than brand new code written by a single developer, preventing issues like file corruption or incorrect image rendering.
Recap
- Program libraries are collections of pre-written, tested code for common tasks.
- Using libraries saves development time, reduces costs, and increases program reliability.
- Program generators are tools that automatically create source code from a high-level specification.
- Generators are useful for creating repetitive code structures or graphical user interfaces (GUIs).
- Both libraries and generators leverage existing work to make development more efficient.
Quick check
- State one reason why using a library function for a complex mathematical calculation is better than writing your own.1 mark