3.21 Take advantage of native features and functionality
Use native features and functionality that exist within languages before constructing new ones that may not be as optimized.
Criteria
- Native over custom: Machine-testable
Use native functions, APIs, and features over writing your own.- 15 Tips to Optimize Your PHP Script for Better Performance for Developers
- Energy Efficiency across Programming Languages (PDF)
- GPF – General Policy Framework (PDF) – 1.9 – Strategy (Interoperable Technologies)
- GPF – General Policy Framework (PDF) – 4.5 – UX and UI (Native Components)
- How to improve PHP performance in your web application
- Native features of the browser
- PHP Function and Method listing
- Web APIs
Benefits
- Economic
Using existing features means you do not need to invest more time in ‘development or maintenance, which reduces costs. - Environment
Avoiding repetition of pre-existing features improves efficiency, which ultimately will reduce redundancy, development time, and emissions associated with building the product or service. - Performance
Using browser-native functionality and features allows you to take advantage of their natural optimization. They will generally load faster while using fewer resources. Custom components are unlikely to beat their performance.
GRI
- Materials: Medium
- Energy: Medium
- Water: Medium
- Emissions: Medium