开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
今日推荐开源项目:《塔防 Mindustry》
今日推荐英文原文:《As Web Developers, How Can We Help Fight Climate Change?》

今日推荐开源项目:《塔防 Mindustry》传送门:GitHub链接
推荐理由:国庆节当然就是玩啊,下次放假可就是元旦了。这次要推荐的项目是一款开源塔防游戏,兴许有人已经在某蒸汽平台上看到过它了,在这里你要做的不仅是造塔防御,还需要自己动手收集材料,这也是它比起其他塌方来说有所创新的地方。国庆虽长,但也要注意劳逸结合,谁也不知道下次周末还能不能抽出空闲来休息。
今日推荐英文原文:《As Web Developers, How Can We Help Fight Climate Change?》作者:FelDev
原文链接:https://medium.com/better-programming/as-web-developers-how-can-we-help-fight-climate-change-80bc8dd4ec56
推荐理由:尽管网络开发者这个职业看起来很环保,但一样可以使用更环保的工作方式阻止气候的变暖

As Web Developers, How Can We Help Fight Climate Change?

The internet is a growing source of pollution worldwide. Can we be part of the solution?

When you think of “dirty” professions, IT professionals rarely come up first. We don’t burn coal in the office or throw away single-use computers daily, but the internet is a growing source of pollution. Most of the problem comes from the fact that many countries get their electricity from fossil fuels, coal, and other non-renewable resources.

Recent studies estimate that video streaming alone creates 300 tons of CO2 yearly. (Numbers vary from study to study, but it’s safe to assume that the truth is many hundreds of tons.)

So, as web developers, what can we do to help? Quite a few things, actually. Starting with our own personal impact.

The Things That Apply to Any Office Worker

Remote work

Not using a car to go to work is obviously a great way to reduce your impact. For those of us who really can’t get to the office without a car, there’s something even better than cycling to work. Work from home!

Even if you do it only one day out of 10, that’s 10% less car-related pollution.

Stream less

Streaming music is nice, but it’s surprisingly not much greener than buying CDs. You know that you’ll listen to some music over and over again, so why not save those tunes to your local drive?

Also, when you do stream music, avoid loading the 4K video clips that come with it if you’re not going to watch it.

Use less

Are you still subscribed to a boating newsletter even though it’s been a decade since your last boat trip? Unsubscribing to services you don’t use anymore is good for the environment and even better for your sanity. At least unsubscribe from marketing lists you don’t enjoy anymore.

(It’s cool if you want to use {LESS} as your CSS preprocessor too.)

Talk to your coworkers

“The world will not be destroyed by those who do evil, but by those who watch them without doing anything.” ― Albert Einstein
It’s awesome if you walk to the office and bring your lunch in a reusable container and all, but it’s even better if the whole office makes an effort. You don’t have to be annoying to raise awareness levels. Just suggest solutions when you see them. Open up conversations when the timing feels right. People are likely to be thankful in the long run.

The Web Developer Specific Stuff

You’ll be happy to learn that a great way to make your websites greener is to make them more performant.

Is your website overweight?

As you might know, the web has an obesity problem. Websites are getting heavier year after year, and this has an impact on the number of resources required to store and serve them. Clearly, the people who make those websites can be part of the solution!

I won’t get technical, but general ideas for a thinner initial load include optimizing media assets, lazy loading, optimized code, and not using a whole framework just to display text and images. Use one if you need one — not because X is trendy.

Don’t call for no reason

Another way to make your projects both greener and more performant is to reduce the amount of HTTP requests.

Not so long ago, I stumbled on a forEach loop that was iterating over an array of IDs and sent a request to the server for every ID. Why not send the whole array in one request? I did. And then the performance was instantly better.

You can also make your API calls thinner. If all you need from a JSON object is one value, why send the whole object? The more users you have, the more relevant those considerations are.

Clean up after yourself

Whether it’s SAAS, PAAS or IAAS, all cloud services require energy to run. If not both energy and money! It’s very easy to leave stuff hanging around for no reason in software.

When was the last time you made sure all the services you use actually do something? It’s an exercise worth repeating every other year and definitely at every new job. I remember finding SSL certificates on auto-renew that were attached to nothing, GBs of worthless data hosted on a CDN, a small server doing nothing 24/7…

You get the idea. If you don’t use it, lose it.

Speaking of cloud services…

There’s now such a thing as “Green Hosting.” In a nutshell:
“Green hosting includes Carbon offsetting, powering a data center directly with renewable energy, planting trees, plants and grass around and over Data Centers and more day-to-day activities such as energy conservation and the use of energy saving appliances.” ―Wikipedia
It’s the digital equivalent of buying organic food. And while the cost could be a bit higher, truthfully claiming that your servers are eco-friendly is an easy way to boost a company’s reputation.

If your boss thinks customers don’t care about green certifications, you can show him this picture of 500,000 people demanding action towards climate change.

September 27, 2019, in Montréal. Source: The New Climate

Using your skills

If you’re reading this, you probably have in-demand skills. Why not use those to create useful tools? There are so many things you could do with your expertise! What if you could:
  • Make carpooling easier.
  • Ease the process of giving food that would go to waste.
  • Make interesting data visualization to help raise consciousness.
  • Build management tools for local initiatives.
Don’t like my ideas? Take a look at the many open source projects already going on and see if you can contribute to those! There’s a lot you can do. Greenpeace even has a guide for people who want to contribute to the redesign of their website. Your skills can be part of the solution.

Closing Thoughts

The challenge of climate change is one that will most likely be solved by tons of small changes, not one superheroic breakthrough.

Making one website 1MB lighter will not improve the web’s ecological footprint by much. But if thousands of people make their websites 1MB lighter, that’s a small step forward as well as faster load times.

Until we come up with a superheroic breakthrough, the least we can do is our part.
下载开源日报APP:https://openingsource.org/2579/
加入我们:https://openingsource.org/about/join/
关注我们:https://openingsource.org/about/love/