开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
今日推荐开源项目:《炒股 RL-Stock》
今日推荐英文原文:《The Art of Discarding for Programmers》

今日推荐开源项目:《炒股 RL-Stock》传送门:GitHub链接
推荐理由:机器学习是一种工具,要怎么用完全看人的想法——当然也可以用在炒股上。通过在过去的数据上进行模拟炒股演练来学习行动策略,从而用于未来的炒股行动中,尽管机器学习会总结过去的经验,但是风险依然存在,机器学习对未来股市的不确定性依然需要注意。
今日推荐英文原文:《The Art of Discarding for Programmers》作者:Tanmay Deshpande
原文链接:https://medium.com/better-programming/the-art-of-discarding-for-programmers-73a9696d59bd
推荐理由:在开发过程中的丢弃学

The Art of Discarding for Programmers

Recently I came across a very interesting book: “The Art of Discarding: How to Get Rid of Clutter and Find Joy” by Nagisa Tatsumi.

This book talks about ways to discard things in your life that are of no use to you but that you have difficulty letting go.

The more I read about this topic, the more I felt this is true for software professionals too. Hence, I thought I’d write an article.

The book consists of three sections:
  • Ten attitudes to help get rid of things
  • Ten strategies for discarding
  • Alternative ways of throwing
Here’s the summary of these sections from a software professional’s point of view.

Don’t Keep It “For Now”

Often, we have a dead code block that somebody wrote for some feature to be implemented someday. Or we have some job/task running that you know isn’t being used, but since you inherited it, you;re afraid to shut it down. For all such things, people end up saying, “Let’s keep it for now.”

The author suggests, if you haven’t used this code/job/task in some time, it’s better to discard it. It’ll probably not be useful in the future either.

Avoid Temporary Storage — Decide Now

While designing systems, I’ve come across situations where people end up saying , “Let’s keep this data/table here temporarily, and we’ll change it later.” Or they say, “Let’s use this method for now, and we’ll change it later.”

Another way to look at this is when we ask people to discard something, they end up moving things to temporary storage. The author suggests if you plan to discard something, act now and don't think of moving things to temporary storage.

Sometime Never Comes

When asked to discard something, people tend to say, “This might be useful sometime.”

The author says most people don’t discard things, convincing themselves these things will be useful in the future. But most of the time, that time never comes. Hence if you find something not to be useful, discard it right away.

Nothing’s Sacred

If you’re inheriting a giant piece of software code, there will always be some classes, scripts, and code blocks that are treated as sacred, and people fear if you make any changes to those, it’ll end up breaking things.

We need to understand that with time, certain functionalities and features get disabled, and it’s important to keep the code up to date by removing the dead code. This will help you keep your system lean and clean.

Don’t Worry About Getting Rid of Something Useful

This is the biggest fear when discarding things. It’s always good to identify when something’s useful or not useful.

But there are times when you’ll be unsure if something is really being used. In such cases, it’s better to go step by step in discarding these types of things. For example, you might be running a job/task that, even after doing research about its usage, you don’t know if its being used. In such cases, instead of completely discarding the job/tasks, you can start with disabling the execution from the schedule.

This will help you identify if something is really being used, and if something breaks, you’ll be able to enable it quickly.

Don’t Aim for Perfection

It takes time to master the art of discarding, so you shouldn’t try to aim for it on day one. You can start small. And keep practicing the pros and cons of doing or not doing something.

Eventually, you’ll be able to master the art.

Regular Discarding

It shouldn't be the case that you take up discarding as a yearly activity. You may want to do it frequently — maybe every quarter. This will help you strip unnecessary loads from your system.

These days we use the cloud for most software deployments, and we pay for what we use. Regular discarding may even help you reduce costs a bit.

Establish Discarding Criteria

It shouldn’t be one individual who’s deciding what to discard. It might good to establish criteria — this helps to make the decision-making process easier.

For example:
  • Is there any active consumer of the feature/functionality/job?
  • Is there any noise after temporarily disabling the feature/functionality/job?
  • Is there any cost reduction if we discard the feature/functionality/job?
  • Is there any performance improvement if discard the feature/functionality/job?
  • Does discarding some jobs help reduce stress on the operations team? Will they be able to put their focus on business-critical jobs/functionalities?

Don’t Think of It As Waste

The author keeps emphasizing this. We have certain things because we wanted them at some time.

Over a period of time, requirements, users, and demands change, which, in turn, make certain things not useful. Hence, they need to be discarded. If you keep this attitude, discarding will be much easier.

Conclusion

In summary, be it life or software, things get aged over a period of time, and, hence, it’s important to master the art of discarding to keep your life and system lean and clean.
下载开源日报APP:https://openingsource.org/2579/
加入我们:https://openingsource.org/about/join/
关注我们:https://openingsource.org/about/love/