开源日报 每天推荐一个 GitHub 优质开源项目和一篇精选英文科技或编程文章原文,坚持阅读《开源日报》,保持每日学习的好习惯。
今日推荐开源项目:《六个字符 jsfuck》
今日推荐英文原文:《A chaotic mind leads to chaotic code》

今日推荐开源项目:《六个字符 jsfuck》传送门:GitHub链接
推荐理由:一切学问的基础都是简单的,其他知识皆由简单的基础发展而来,这点在 JS 上当然适用,不过你可以把基础用一些不同的方式展现出来。这个项目可以用六种字符来完成 JS 代码的编写,听上去似乎不太可能,但是读一读原理就能明白一二,比如凭空造数这种看似离奇的操作实际上是由语言本身的原理完成的——打好基础的重要性就在于此。
今日推荐英文原文:《A chaotic mind leads to chaotic code》作者:Dler Ari
推荐理由:适时重整自己的状态而不是带着 debuff 继续前进

A chaotic mind leads to chaotic code

Did not find any good example of chaotic code, but found an example of callback hell 🙂

We live in a world with many things that consume our time, and the constant need of always doing something. And if we don’t do it, we are left behind while the world moves on.

To stay alive and be competitive today means always checking whats new on Twitter, Reddit, Instagram, Facebook, podcasts or any other social media platforms. Or learning every JS framework out there, understanding every programming concept, and so forth. It seems that the only option is doing a dozen things.

In the end, it all leads to a chaotic mind, and we cannot think straight anymore. We just live through each day while tasks stack up. And after a while it reduces the quality of the content we produce, such as code or other things in our day to day work.

The focus of this article is to find effective ways to deal with a chaotic mind in order to produce high quality content. I’ll talk about few well-known concepts, and why they are important, but won’t cover the details.

Let’s understand how the brain works!
The brain is one of the largest and most complex organs in the human body. It’s made up of more than 100 billion nerves that communicate in trillions of connections called synapses.
Here’s what we’ll address
  • What leads to a chaotic mind
  • Accept that it exists
  • It starts within you
  • Focus on your breathing
  • Mindfulness
  • Reward yourself

What leads to a chaotic mind?

A chaotic mind is simply another word for stress. If you have many things to do, and cannot prioritize the ones that are really important, you are left with an equal focus on everything, which leads to stress. There is nothing wrong with having a bit of stress, as it prepares you for challenges, and things that matter.

However, the issue is when it takes over your mind, the things you produce, and alters the way behave. It’s not something you can get rid of, but learning how to deal with a chaotic mind helps you to make better decisions, and live in the present.

Here are few definitions of how we end up with a chaotic mind
  1. Pressure or tension exerted on a material object.
  2. A state of mental or emotional strain or tension resulting from adverse or demanding circumstances.
It’s not your fault that the world we live in is full of “do this, not that, but wait, you must do this!” in other words, lots of things that drain our energy.

If you try to sit down for a second, clear your thoughts and get some work done on the computer, you’ll most probably get distracted by something on the web. And before you know it, you’ve spend a couple of minutes or maybe hours on everything except the work that matters.

Next day, you do the same, and the day after. It seems that it’s impossible to do work without losing focus these days.

One thing that you need to understand is that the world is built upon getting your attention, because more attention equals more money. That is a part of the business model, and how everything else works in the business world. Social media, mobile apps, TV-commercials, you name it, they are all constructed to get the most out of your time. Some do it for the better, while others don’t.

Let’s face it, there will always be distractions, and something that takes your attention. That is why it’s important to manage a chaotic mind, otherwise you’ll just float in the middle of nowhere.

So what exactly leads to a chaotic mind?
  • Limited time: Too many things that must be done within a specific deadline
  • Financial budget: Not able to buy the stuff you need to live a decent life
  • Friends/family: Not satisfied with what you do, too many expectations
  • Self-image: Not able to fulfill your desired goals
These are few reasons out of many. It depends on the person, and their environment. It’s interesting that the majority of people fall under same categories that cause stress.

Accept that it exists

First of all, you just need to accept it. Secondly, understand that it exists, and don’t try to fight it. Thirdly, analyze how your body and mind react. It’s not easy to detect a chaotic mind. And if you are not aware of it, few things can help.

One way to detect a chaotic mind is when the thoughts just burst around and it’s difficult to pinpoint something. If you forget things often, that may also be sign of a chaotic mind.

Once you realize it exists, and how you react to it, you can gradually find ways to reduce it. Just to be clear, stress is normal, but it doesn’t mean it cannot be maintained for the better.

For instance, if you drive somewhere, you might get an image where you turn the steering wheel too quickly to the left, and maybe hit someone. It does not define you, but is simply a thought out of dozens that randomly enters your mind. What defines you is the action you actually take. And thoughts like these are not unusual.

Here are a couple of ways to reduce a chaotic mind!

It starts within you

It’s common for people to say that in order to reduce a chaotic mind, you need to exercise, be healthy, join a boot camp, talk to someone, be with someone, listen to podcasts and so forth. It may work. But if you think about it, these are things that point to external activities.

Don’t get me wrong, exercising and eating healthy food is good for the mind and the body. But it’s important to realize the problem lies within you, and it’s you who must deal with the problem.

For instance if my car needs an oil change, I don’t go and fill up more gasoline, or continue to drive. The source of the problem is that I need to change the oil, that's it, otherwise the car will be damaged.

Here’s the thing, always doing something doesn’t make us happier, it just takes our attention away from what we are struggling with. We need to be able to deal with emotions, deal with things that are not fun. Mike Tyson was asked once, what is the most difficult thing about training. He said, the mind.

You can meditate all day, eat healthy food and exercise 3 times a week, but if you can’t deal with a chaotic mind, you are simply increasing the severity of the damage. Learn to deal with your emotions by accepting that they exist, and don’t avoid them!

Focus on your breathing

Breathing is an essential activity which supplies our body and its various organs with oxygen, which is vital for staying alive. We can live without food and water for a couple of days or maybe weeks, but if we stop breathing we die within a few minutes. There is a strong link between breathing and our mind. This is not something we really think of because most of the process happens automatically. Knowing how to breathe helps us to control our emotions, fears and keep a clear mind.

For instance, if a programming task is too difficult to solve, your breathing becomes quick and shallow. Breathing deeply and slowly will instantly calm you down mentally as well as physically.

So how can you know if you are breathing correctly? If you are sitting on a chair, put your hand on your stomach, and the other one on your chest, then check if your chest or stomach is moving when you inhale. If your chest is moving, then that’s not a good sign. The reason why is because the chest has limited space, which prevents maximum breathing (short cycles). On the other hand, if you do sports activities, then chest breathing is normal because you need oxygen quickly. But for non sport activities, the breathing should happen through your stomach.


It’s about bringing awareness to what you’re directly experiencing, being aware of where you are and what you are doing, not overly reactive or overwhelmed by whats happening around you. It sounds easy to sit down for a couple of minutes and live in the present, but trust me, it’s not! We are so caught up with living in the past and the future that we simply forget to live in the present.

Mindfulness is not something new. It’s been used for a long time, and even religions use it. Praying to god is a form of relaxation, for example, and bringing thoughts to the present. I’ve used this technique of mindfulness to clear my thoughts, and often I’ve found solutions to problems just by doing it. It’s a bit funny how we are able to find answers when we are not sitting at a desk.

Reward yourself

If we want an animal to do a certain thing, we give it a treat every-time it does it, and after a while, it learns and knows that in order to get the treat it must perform the action. But if we don’t want it to perform it, we either shout or spray water on the animal (not recommended). These are things that humans have used to teach animals to do certain things, for instance dolphins to do back flips, dogs to roll and even lions to jump through fire (in a circus).

We humans are not that different from animals. It’s important that we rewards ourselves when we do good things, as this rewires the neurological pattern of the brain to keep performing the action. Buy yourself something you like, for instance a chocolate bar, energy drink or ice cream when you do something good, and you’ll continue to do it. It can also be watching a movie, your favorite series on Netflix, and so forth. Find what works for you.


A chaot mind is not something we want, and as mentioned, it leads to producing poor quality content. It first starts within you, so you need to understand how you think and react to certain things, and not try to avoid it by doing external activities all the time. Deal with your thoughts and emotions through mindfulness, breathing, and make sure you reward yourself when doing something good.

If you understand how your mind works, you’ll be able to improve lots of things in your business as well as personal life.

Please share if you have any good techniques on dealing with a chaotic mind.