Light weight coding in website development is the writing of code that is as brief and simple as possible while still providing the desired information and other functions. Code, also called source code, is the set of instructions that determines the structure, appearance, functionality and behavior of a website.
There has been a long-term upward trend in the share of websites developed using automated website construction and management programs, including website builders such as WordPress, Wix, Squarespace, GoDaddy and Hostinger. Such programs make it easy even for people with little or no web development skills to quickly create professional-looking sites that have advanced functions such as online stores, blogs and other forms of user interaction. This trend is also a result of intense competition among entrepreneurs, website developers and others to construct sites with ever-more advanced and complex functions.
However, such systems require very long and complicated code as compared with manually written code that uses solely, or mostly, HTML (hypertext markup language) and CSS (cascading style sheets), thus resulting in very large file sizes. They also rely extensively or entirely on calls to databases for every page request, thus greatly increasing server load, energy consumption and page rendering times as compared to hand-coded HTML and CSS, which send pre-built files directly to users' browsers without database queries and server-side processing.
The share of websites built with just HTML and CSS has continued to decline, and industry sources estimate that it is now only around 30 to 35 percent. The resulting code bloat has been a major factor in the rapid increase in energy consumption by the internet, along with newer technologies such as blockchain and artificial intelligence. Industry sources estimate that the internet now accounts for about 2.5 percent of total worldwide electricity use, which is roughly double that of 2015, and some projections suggest that by 2030 it could soar to six percent and produce more than five percent of global carbon dioxide emissions. This is despite continuous improvements in the energy efficiency of servers and other internet hardware.
An increased use of light weight coding could provide some important advantages both for the environment and for users of the internet. The main benefits for the environment would come from reduced electricity consumption, which would result in less carbon dioxide output from fossil fuel power plants and less radioactive waste from nuclear power plants, and from less water use.
Light weight coding can also result in a better experience for web users, including faster page loading and a more consistent browser performance. These improvements are particularly noticeable on older devices and in low bandwidth situations, which are still common in much of the world. It can also result in less stress on computer hardware, leading to less frequent hardware replacement and thus reduced electronic waste. Additional benefits can include simplified hardware maintenance, greater resistance to hacking and malware, and, in some cases, greater ease of website updating.
Providing incentives to reduce code bloat could be an important tool for reducing the rapid growth in electric power consumption by the internet, along with such things as requiring server farms to bear the full costs of their environmental effects (e.g., air and water pollution), the development of more efficient artificial intelligence technologies, and the further development of more energy-efficient servers and other computer hardware.
The GEPREP website, in addition to the use of light weight coding, has additionally minimized its energy consumption through the avoidance of all images and most other non-text functions. Although it might not be practical for most websites to go to this extreme, there are still a vast number of sites that could utilize greatly simplified coding, fewer images, etc. without any major loss in usefulness — and perhaps even with improvement in some cases.