<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ricardo Dantas</title>
    <description>The latest articles on DEV Community by Ricardo Dantas (@ricardodantas).</description>
    <link>https://dev.to/ricardodantas</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F361121%2Fc5d97466-fb6b-40ed-98ee-183d69d67760.jpg</url>
      <title>DEV Community: Ricardo Dantas</title>
      <link>https://dev.to/ricardodantas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ricardodantas"/>
    <language>en</language>
    <item>
      <title>12 Ways To Reduce Carbon Footprints as a Full Stack Developer</title>
      <dc:creator>Ricardo Dantas</dc:creator>
      <pubDate>Sat, 04 Sep 2021 10:37:53 +0000</pubDate>
      <link>https://dev.to/ricardodantas/12-ways-to-reduce-carbon-footprints-as-a-full-stack-developer-imh</link>
      <guid>https://dev.to/ricardodantas/12-ways-to-reduce-carbon-footprints-as-a-full-stack-developer-imh</guid>
      <description>&lt;p&gt;Minimize CO2 emissions&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F6000%2F0%2AEsNtJNcgTorVxyzy" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F6000%2F0%2AEsNtJNcgTorVxyzy" alt="Photo by [Noah Buscher](https://cdn.hashnode.com/res/hashnode/image/upload/v1630750454649/DRixoSz2v.html) on [Unsplash](https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral)" width="800" height="458"&gt;&lt;/a&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@noahbuscher?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;Noah Buscher&lt;/a&gt; on &lt;a href="https://unsplash.com?utm_source=medium&amp;amp;utm_medium=referral" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We had an interesting presentation about Digital Sustainability at &lt;a href="https://dyna.mo/?utm_source=blog_ricardo_dantas&amp;amp;utm_campaign=sustainability&amp;amp;utm_medium=social&amp;amp;utm_term=sustainability&amp;amp;utm_content=sustainability" rel="noopener noreferrer"&gt;Dynamo&lt;/a&gt; recently that made me think about what I could do to reduce my ecological footprint in my day-to-day job as a full stack developer. That inspired me to write this post.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The simplest way to define ecological footprint would be to call it the impact of human activities measured in terms of the area of biologically productive land and water required to produce the goods consumed and to assimilate the wastes generated. More simply, it is the amount of the environment necessary to produce the goods and services necessary to support a particular lifestyle.&lt;/em&gt;&lt;br&gt;
— &lt;a href="https://wwf.panda.org/discover/knowledge_hub/teacher_resources/webfieldtrips/ecological_balance/eco_footprint/" rel="noopener noreferrer"&gt;WWF&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Did you know that the IT industry’s greenhouse gas emissions are &lt;a href="https://www.bbc.com/future/article/20200305-why-your-internet-habits-are-not-as-clean-as-you-think" rel="noopener noreferrer"&gt;predicted to reach 14%&lt;/a&gt; of global emissions by 2040? And that if the internet was a country, &lt;a href="https://www.sustainablewebmanifesto.com/#citation" rel="noopener noreferrer"&gt;it would be the 7th largest polluter&lt;/a&gt;? It’s impressive, isn’t it?&lt;/p&gt;

&lt;p&gt;Thinking about all the approaches I have used during my career to optimize web apps, e-commerce, and portals projects, I have concluded that the lighter and faster the application loads to the user, the more efficient energy consumption the application will have. So here are some tips you could use on your next project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Measure
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4bc6aphtewp7wbp2g7e1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4bc6aphtewp7wbp2g7e1.png" width="800" height="559"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use tools like &lt;a href="https://www.websitecarbon.com/" rel="noopener noreferrer"&gt;WebsiteCarbon.com&lt;/a&gt; to measure how eco-friendly your website is. In addition, you can use &lt;a href="https://webkit.org/blog/8970/how-web-content-can-affect-power-usage/" rel="noopener noreferrer"&gt;Safari's Lighthouse on DevTools&lt;/a&gt; to measure its energy impact. Then, use the following tips to form an attack plan to solve the possible issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose Renewable Energy Host Providers
&lt;/h2&gt;

&lt;p&gt;Host providers and data centers may not look like they use a lot of power, but they have thousands of computers to process data and the room gets very warm. They need to keep the air cool, so air conditioning systems are a must for this industry and those systems consume a lot of energy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.thegreenwebfoundation.org/" rel="noopener noreferrer"&gt;The Green Web Foundation&lt;/a&gt; is doing a fantastic job by &lt;a href="https://www.thegreenwebfoundation.org/directory/" rel="noopener noreferrer"&gt;providing a list&lt;/a&gt; of the most eco-friendly host providers in the world. Consider picking one of them for your next project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop daemons and Servers When You’re Not Using Them
&lt;/h2&gt;

&lt;p&gt;When developers are coding apps they usually need several processes running on their local machines, in order to test and avoid crashing the live version of the app. However, eventually they will switch projects and forget to stop some of those background processes. As a result, they keep running forever or until someone notices a high consumption of memory or processing.&lt;/p&gt;

&lt;p&gt;By stopping unused servers and background processes you can drastically (depending on the type of process) reduce your memory, processing, and power consumption.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Dark Mode
&lt;/h2&gt;

&lt;p&gt;If you’re using an OS that supports Dark Mode, or if you have apps that allow you to switch their theme to use darker colors, consider using it. Darker colors are &lt;a href="https://www.wired.com/story/give-yourself-to-dark-mode-side/" rel="noopener noreferrer"&gt;better for the eyes &lt;/a&gt;and can save battery and energy on both smartphones and laptops.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turn Your Camera Off
&lt;/h2&gt;

&lt;p&gt;In these difficult times, everyone is using tools like Google Meets, MS Teams, and Zoom for online meetings. This behavior has become part of our day-to-day.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.sciencedaily.com/releases/2021/01/210114134033.htm" rel="noopener noreferrer"&gt;Research&lt;/a&gt; has revealed that one hour of video calling or Netflix streaming emits 150 to 1,000 grams of carbon dioxide. By turning your camera off during video calls, you can reduce your carbon footprint by 96%.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimize Fonts
&lt;/h2&gt;

&lt;p&gt;By optimizing your font files you can reduce file sizes by up to 97%.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Use modern web font formats such as WOFF and WOFF2. These formats use higher compression methods compared to TTF, OFT, and SVG file formats.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Give the browser the best chance at getting fonts right by preloading required fonts.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Subset your fonts to include only the characters that are required.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Use CDN and Server That Are Near to Your Users
&lt;/h2&gt;

&lt;p&gt;Using CDNs and servers that are nearer to your users will reduce traffic on telecom networks, which will considerably reduce the energy consumption used by their infra-structure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use AMP (Accelerated Mobile Pages)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://amp.dev/" rel="noopener noreferrer"&gt;AMP&lt;/a&gt; makes content load faster on mobile devices by removing unnecessary code and file weight, rendering a minimalist version of the original web page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Static Web Pages
&lt;/h2&gt;

&lt;p&gt;Using server-side rendering solutions like WordPress will process the information to send back to the user each time someone tries to load a page. That causes the server to use more energy. You can use &lt;a href="https://jamstack.org/generators/" rel="noopener noreferrer"&gt;static generator tools&lt;/a&gt; to help you to distribute content that does not need to be fetched from databases every single pageview. You can also make it even better by using caching on the client side.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do Not Use GIFs
&lt;/h2&gt;

&lt;p&gt;GIF animations are fun but they create significantly larger file sizes, consuming a lot of traffic and energy. The good news is, you can replace them with the &lt;code&gt;&amp;amp;lt;video&amp;amp;gt;&lt;/code&gt; element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;video&lt;/span&gt; &lt;span class="na"&gt;autoplay&lt;/span&gt; &lt;span class="na"&gt;loop&lt;/span&gt; &lt;span class="na"&gt;muted&lt;/span&gt; &lt;span class="na"&gt;playsinline&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/saving-energy.webm"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"video/webm"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"/saving-energy.mp4"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"video/mp4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/video&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: The order of the &lt;code&gt;&amp;amp;lt;source&amp;amp;gt;&lt;/code&gt; tag matters! Specify the WebM &lt;code&gt;&amp;amp;lt;source&amp;amp;gt;&lt;/code&gt; first otherwise the browser will skip it and will play the mp4 version.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Use the Lighthouse tab, available in the DevTools to check your website for GIFs that can be converted to videos. If you have any GIFs that can be converted, you should see a suggestion to “Use video formats for animated content” in the report.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7etqjln6h8xtc15m8qbb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7etqjln6h8xtc15m8qbb.png" width="800" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimize Images
&lt;/h2&gt;

&lt;p&gt;Images are the biggest contributors to page weight. The larger the image files you use, the more data needs to be transferred and the more energy is used. You can use some techniques and tools to solve this problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use the WebP format
&lt;/h3&gt;

&lt;p&gt;WebP images are smaller than JPEG and PNG, usually, it reaches a 25–35% reduction in file size. This decreases page sizes and improves performance. Using the approach below you make sure the browser will render the right image, even if it does not support WebP.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- 
The browser uses the first listed source that's in 
a format it supports. If the browser does not support 
any of the formats listed in the &amp;lt;source&amp;gt; tags, it 
falls back to loading the image specified by the &amp;lt;img&amp;gt; tag.
--&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;picture&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/webp"&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"green-environment.webp"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"image/jpeg"&lt;/span&gt; &lt;span class="na"&gt;srcset=&lt;/span&gt;&lt;span class="s"&gt;"green-environment.jpg"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"green-environment.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/picture&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Lazy load images
&lt;/h3&gt;

&lt;p&gt;You can do it natively! The most popular Chromium-powered browsers (Chrome, Edge, Opera) and Firefox support the &lt;code&gt;loading&lt;/code&gt;attribute on the image element. The implementation for Safari &lt;a href="https://bugs.webkit.org/show_bug.cgi?id=200764" rel="noopener noreferrer"&gt;is in progress&lt;/a&gt;. You also can check the availability of this feature on &lt;a href="https://caniuse.com/#feat=loading-lazy-attr" rel="noopener noreferrer"&gt;caniuse.com&lt;/a&gt;. Browsers that do not support the &lt;code&gt;loading&lt;/code&gt; attribute simply ignore it without side-effects.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"image.png"&lt;/span&gt; &lt;span class="na"&gt;loading=&lt;/span&gt;&lt;span class="s"&gt;"lazy"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"…"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"200"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"200"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check more details about the lazy loading attributes on the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading" rel="noopener noreferrer"&gt;MDN documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Image optimization tools
&lt;/h3&gt;

&lt;p&gt;You can use tools like &lt;a href="https://tinypng.com/" rel="noopener noreferrer"&gt;TinyPNG&lt;/a&gt;, &lt;a href="https://tinyjpg.com/" rel="noopener noreferrer"&gt;TinyJPG&lt;/a&gt;, &lt;a href="https://svghero.app/?utm_source=blog_ricardo_dantas&amp;amp;utm_campaign=sustainability&amp;amp;utm_medium=social&amp;amp;utm_term=sustainability&amp;amp;utm_content=sustainability" rel="noopener noreferrer"&gt;SvgHero&lt;/a&gt;, and &lt;a href="https://shortpixel.com/" rel="noopener noreferrer"&gt;ShortPixel&lt;/a&gt;. You can also use packages like &lt;a href="https://github.com/tcoopman/image-webpack-loader" rel="noopener noreferrer"&gt;image-webpack-loader&lt;/a&gt; , &lt;a href="https://github.com/sindresorhus/gulp-imagemin" rel="noopener noreferrer"&gt;gulp-imagemin&lt;/a&gt; or &lt;a href="https://github.com/gruntjs/grunt-contrib-imagemin" rel="noopener noreferrer"&gt;grunt-contrib-imagemin&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop Using Google Search
&lt;/h2&gt;

&lt;p&gt;The artist &lt;a href="http://www.janavirgin.com/CO2/" rel="noopener noreferrer"&gt;&lt;strong&gt;Joana Moll **created&lt;/strong&gt; &lt;strong&gt;a&lt;/strong&gt; **project&lt;/a&gt; in which users can know how many kilograms of CO2 are emitted by Google search since you access the website.&lt;/p&gt;

&lt;p&gt;There is a nice alternative to Google: &lt;a href="https://www.ecosia.org/" rel="noopener noreferrer"&gt;Ecosia&lt;/a&gt; search engine! Ecosia is not only &lt;a href="https://blog.ecosia.org/why-carbon-neutral-is-not-enough-ecosia-has-built-its-own-solar-plants/" rel="noopener noreferrer"&gt;an eco-friendly search engine&lt;/a&gt; but also &lt;a href="https://info.ecosia.org/privacy" rel="noopener noreferrer"&gt;privacy-friendly&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Reducing the footprint of tech is not only all about reducing energy consumption, it’s a win-win game!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The companies get to optimize their resources consumption and their costs&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The user has a better experience with faster and lighter apps&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The environment will have a significant reduction of pollution.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Do you know some more tips to make it even more eco-friendly?&lt;/strong&gt; Feel free to share in the comments area!&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Engaged
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://climateaction.tech" rel="noopener noreferrer"&gt;ClimateAction.Tech&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.sustainablewebmanifesto.com" rel="noopener noreferrer"&gt;Sustainable Web Manifesto&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://opensustain.tech/" rel="noopener noreferrer"&gt;Open Sustainable Technology&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://webkit.org/blog/8970/how-web-content-can-affect-power-usage/" rel="noopener noreferrer"&gt;How Web Content Can Affect Power Usage&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.wholegraindigital.com/blog/website-energy-efficiency/" rel="noopener noreferrer"&gt;17 ways to make your website more energy efficient&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://ecoping.earth/indexes/world/gatsby/" rel="noopener noreferrer"&gt;Ecoping.earth&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://ecograder.com" rel="noopener noreferrer"&gt;Ecograder&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://web.dev/" rel="noopener noreferrer"&gt;web.dev&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>javascript</category>
      <category>sustainability</category>
    </item>
  </channel>
</rss>
