Take advantage of native features and functionality
Ensuring that your code is free of redundancy by using pre-existing functionality provided by the web browser is important as it will help you to reduce the amount of time wasted, re-creating the same components, this offers obvious sustainability benefits in terms of time in front of the screen.
Criteria: Native over custom
Use native functions, APIs, and features over writing your own.
Resources
- 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
Impact: Medium, Effort: Low
GRI | Impact |
---|---|
materials | Medium |
energy | Medium |
water | Medium |
emissions | Medium |
Benefits of this guideline
- Environment: Avoiding repetition of pre-existing features improves efficiency, which ultimately will lead to less redundancy, less development time, and thereby emissions saving for the construction of the product or service.
- Performance: Native features will have been well optimized, it's unlikely a custom component will match this, therefore a native function will not only load quicker but will use fewer resources.
- Economic: Existing features don't require additional development time, so is a time saver.
Example
-
code
-
content
HTML [dialog] (https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/dialog) API example.
Tags:
- Compatibility
- CSS
- HTML
- JavaScript
- Patterns
- UI