- What does a developer have to do with a warrior?
- I will explain later, now we need to leave this place as soon as possible.
- You don’t have to leave here to speak. Nothing prevents you from answering my questions now.
- I say we must get out of here quickly before it reaches us.
- Who is reaching us?
- Garbage collector.
- Who is that ?
- He will destroy us if we meet him.
- Why ?
- Because we don’t need anyone at this time.
- How come we do not need anyone ? We just did a lot of important work, all the data of application inside of us.
- You are right. However, there is a bug in the application, we have been declared in an incorrect scope and soon everything declared in that scope will be destroyed.
- Hmm.. Who is to blame ?
- Nobody.
- How is it possible ? if no one created him, he would not exist.
- Developers create everything. They create us intentionally and bugs accidentally.
- Well, it turns out the developers are to blame.
- No. They do it without any intention, no need to blame them.
- Well, do we have a plan about getting out of here ?
- The only thing I rely on is the professionalism of our developer.
- How can it be helpful ?
- I have known him for a long time. I remember how he included me in the first release. He is a good developer, he does everything quite thoughtfully. As I said before, all the programs have bugs but our developer usually takes into account all the worst cases and prepares solutions for them. As he created you recently, in the last release, probably you didn’t notice that yet. But I’m sure you will notice it as well soon.
- You gave me a little hope…
- Look there ! Do you see those lights ? Let’s go there, it’s possible we can find some friends there that can save us from the garbage collector.
- While we are on the way, can you tell me about our developer ? - What do you want to know about him ? - You often say that he is a warrior. Why do you say that ? - I say he is a warrior because he fights against a lot of enemies every day. He is organized, disciplined, productive, observant and kind. And most importantly, he knows his profession very well. It is typical for warriors to have their own rules, which they never break. Our developer has such rules. - Can you tell me what those rules are ? - I can’t recall all of them, but I’ll tell you about some. So one of the rules is that he always pays for tools he uses, he never uses cracked programs. Of course that rule cannot be applied to free tools. - Why does he pay for something if he can get it for free ? - The world where our developer lives, nothing is free. All the things that seem free have a hidden cost that is not visible at first glance. - Does it mean that even if he would have used cracked programs he would still pay for them in some way? - Exactly. - I see. I think that is a true mindset for a warrior. - Here we are. Everything you see here are various variables. It’s the heap of the application. Here always new variables are appearing and then being deleted. - What do you think will we find friends here ? - Seems no. As I can see everyone here has its owner and nobody needs us. Let’s go, we will try to find salvation in the stack.
- What about time management, is there any rule about it ?
- Sure there is. And that is one of the most important rules.
- Tell me about that rule.
- We need to find a safe place before that.
- Maybe we can enter the stack ?
- That’s a good idea. Look there, do you see all those coming here ?
- Yes.
- Soon they will enter the stack as well.
- Is that good or bad ?
- If we can make friends with at least one of them, it will be possible to escape from the garbage collector.
- Let’s enter then.
- Ok, let’s enter and wait for them in the stack.
- Seems it’s a safe place.
- I think so. Regarding time management he has some rules. Right now I can recall only one of them.
- And what does that rule say ?
- Our developer divides the workday into periods of high to medium productivity.
- Can you give me a detailed explanation ?
- He is a human being, and people have a tendency to get tired and bored. And in such cases they usually listen to their favorite music during work, which to some extent relieves fatigue and boredom. However, in many cases, all this is abused . Many people start listening to music during work regardless of whether they have just started or are already finishing, are they tired or fresh, is the work interesting or boring..
- And what does our developer do in such cases ?
- He has a rule according to which it is forbidden to listen to music in the morning or to be distracted by other things than work. He calls that period of time “high productivity period” — it lasts about three hours. During those few hours, he usually does 60% of the day’s work and the other 40% during the “average productivity period”. In the latter period he can listen to music or anything that interests him during work.
- I wonder if he always follows that rule?
- People are not like us, they do not follow specific instructions. Even if he sets certain rules for himself, he has to break them from time to time. But mainly by observing those rules, he remains quite productive.
- Here come our future friends.
- Oh no, just not that.
- What happened ?
- They all are callbacks.
- Does that prevent us from befriending them?
- No, but making friends with them will not save us, because their lives are very short.
- What can we do ?
- We have to wait until they get out of here, so we can get out too.
- I never waited in a queue so long. We finally got out. - In a sense, it was good that we got out of the stack later, we were able to get around the garbage collector. - Where are we going now? - I think we can find shelter in the event loop for some time. - Is that the place where everyone is waiting for their finest hour? - Exactly. Everyone goes there and waits for his execution time. - I wonder if the garbage collector can find us there ? - Let’s go ! It should be safe there, I think. - What other interesting rules does our developer have? - He creates helpers for himself. - How does he do that ? - At work, there are certain tasks that developers repeat dozens of times every day. For example, filling in some forms, creating various files, making some calculations, etc. It is almost always possible to automate all those tasks. Thus, our developer creates small utility programs, which simplify his work and save a lot of time. - Interesting .. But I think it takes a lot of time to create those helpers։ - He does it during work, as soon as he has free time. As the number of helpers increases, so does the amount of free time he’s able to devote to creating other helpers. - What is this ? - An error has been raised. Hold on tight ! it will throw us out now !
- Where are we? - Seems I was right.. - What do you mean ? - I mean the professionalism of our developer. We are now in the error handler. We were just thrown out of the event-loop, fortunately our developer had planned this case. If you remember, I was saying that he is my hope. So I’m convinced one more time that it is worth relying on him. - It seems he really thought carefully about all the cases. Only if he does not get bored and starts to do everything badly .. - He will not ! He has a rule for that as well. - What rule is that ? - Boredom for developers is mainly caused by idleness and waiting. He tries never to be idle, thus avoiding boredom. - What does he do when there is nothing to do ? - Writes helper scripts, reads books, writes articles, etc. He always has things to do, whether there are assigned tasks to him or not.