3.22 Use the Latest Stable Language Version
Languages evolve regularly, and it’s important for security and performance reasons to keep on top of the technology stack you are using. It’s also important to consider whether the language you are using is appropriate or optimized for the task you wish to use it for.
Criteria
- Versioning: Use the latest build of your chosen syntax language and its coupled framework.
- Language Choice: Use the most appropriate programming language for a task. Many tools and programming languages are optimized for performing particular tasks, and utilizing those most appropriate to the problem, especially if there is a reasonable visitor base involved justifies the time and effort, as long as it doesn’t impact PPP factors such as the well-being of those involved or become too cost prohibitive.
Impact
Medium
Effort
Medium
Benefits
- Environmental:
Using the latest language version may improve efficiency and reduce data center energy consumption. Verify benefits are worthwhile before major build upgrades. - Security:
Often, older versions may have security issues that could expose your website or app (and thereby your visitors) to harm. Maintaining an upgrade schedule is good for security. - Performance:
Language version updates are usually coupled with performance improvements. Regarding language choice, an algorithm implemented in a compiled language such as C or Rust, for example, can have greatly reduced execution time and energy usage compared to the same algorithm written in an interpreted language like Python or JavaScript. - Economic:
Using the latest and more performant language version could help hosting companies reduce their costs. That could be beneficial for the company and the visitor.
GRI
- materials: Medium
- energy: Medium
- water: Medium
- emissions: Medium
Example
- Use benchmarks to identify the efficiency of languages.
Resources
- Best PHP Performance Tips From Community & Influencers
- Energy Efficiency across Programming Languages (PDF)
- PHP 5.6 vs PHP 7 Performance Comparison
- Programming Language Benchmarks
- Speed comparison
- Web Framework Benchmark
- Web Framework Benchmarks