Do you ever think — “How to explain to the one, who never faced it before”. programming Original articles was created long time ago, in another galaxy. This is a just a translation trial, and it did not contain as much jokes, as it can. So, lets imagine — you have a friend, who is not by computer science, never try to automate something, never play , never write a single line of code. soiled factorio So, lets imagine a normal human being. And lets call him Bill. He is not very good in Math, even just “not good”, ! but he loves candies Your task is to Bill some IT , you do every day. The simplest ones. Encipher the secret knowledge. teach magic things What shall you do? Feed him! Long story short, but one day asking Bill: Andrey Alexandrescu — Andrey: Hi Bill, do you want a candy? — Bill: Yep, sure! Then Bill will get the candy, unwrap it from Candy and eat the . wrapper payload Simple? And we have used 2 magic words! — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Just few day later asking Bill: Wirth — Wirth: Hi Bill, do you want a candy? — Bill: Yep! SURE! — Wirth: Hey, I`v got another one, do you want it do? — Bill: Yep! SURE! It was a , or a condition-controlled loop cycle. — Wirth: Hey, I`v got another one, do you want it do? — Bill: Yep! SURE! But there was no candy, and Bill got a common . null pointer exception — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Beware — if will suddenly returns and continues to feed Bill with candies — a will occur. At long Bill will always accept a new candy. Alexandrescu buffer overflow Buffer overflow — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Next day Wirth was prepared. He has got a big bag of candies. — Wirth: Ok, let me check bag of mine…. — Wirth: I still have a candy. Bill, do you want a candy? — Bill: Yep! SURE! In this case Wirth will provide a candy only if he has one. Here we hot a . cycle with precondition — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — But one day Bill come to Wirth`s house, and house: — Bill: GIVE ME A CANDY! — Wirth: Nothing lasts forever! You have eaten everything! — Bill: But I will take it IN ANY CASE!!! — Bill: DO YOU HAVE A CANDY??? It was a . Sad story. Thanks god police were nearby. Be careful next time, and do not feed wild birds. cycle with postcondition — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Decades later Dan Abramov come to Bill and put all his candies on the table: — Dan: speechless gazing at Bill. — Bill: speechless gazing at a first candy — Dan: Bill, do you want one on these candies? — Bill: Yes, sure. It was a . collection-controlled loop — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Just after it, Dan got another bag, put all candies on the table, count them, and put back to the bag. — Dan: Bill, look like I still have a candy. Do you want a candy? — Bill: Yes, sure. It was a . count-controlled loop — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Sooner or later, but come to feed Bill. Bjarne_Stroustrup — Bjarne: Bill, do you have a candy. — Bill: Yep, sure. — Bjarne: Bill, do you want a candy. — Bill: — — — Bill was munching a candy. He was busy and nothing can disturb him. He raise a , thread got locked and time stops… mutex Thread lock. — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Bjarne was a very clever one, and he found a solution: — Bjarne: Bill, do you want a candy. — Bill: — — — — Bjarne: Ok, I`ll wait until for finish munching… Here we got a . thread synchronization — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — Ok, this time we will call for . Peter_Norton — Peter: Bill, do you want a candy. — Bill: Yep! Sure! — Peter: I`ll provide a whole pack. Munch it by youself. Next Bill will get candies, one by one, from a bag, and eat them, one by one. This is called — last it, last out. As long the candy from the bottom of the pack will be eaten last. LIFO In the same time Bill`s digestion is a — first in, first out. FIFO You had to know it before. — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — also joined the feeding team. But one day he got tired of buying new candies for Bill and he asks a catering company to do it. Donald_Knuth — Donald: Hey, my friend, can you buy best candies in the nearest shop and present them to Bill? Here is Bill`s address and money… Since that time Bill always has new candies from Donald. In this case catering company is a , and address and money are . And a candy is a . function arguments return value If for the same address and the same amount of money Bill will always get the same candies — it will be called . pure function But only in case the company will only transfer candies from point A to point B, and shop will always be non-pure function, as long it loses candies. But was even clever! Dennis_Ritchie — Dennis: Hi Bill, do you want a candy? — Bill: You know it! — Dennis: So here is an address. You will found your so desired candy there. It was a . pointer But, then Bill reaches that address he found there a military object. Any way — he got an address, and tries to reach his target at all costs, but security is security. . Access violation A few months later, after escaping from a jail, he tried to repeat, but yet again cant reach “the target”. Something stopping him at the distance — invisible, and indestructible walls of . bounds checking — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — But one day…. Even, to say the truth — night — comes to Bill`s house and shout: Cyberdemon :DO YOU WANT A CANDY? — Cyberdemon — Bill: YES! AT THE DAY TIME, AND THEN THE STARS SHINE! ALWAYS! So, Bill has got his candies yet again. But this is a bit sad story, as long he forget to check type of payload or perform any other . ☠️ data validation — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — After that Bill woke up in a void, and hear: — Cosmos: Bill! Do you want a candy? — Bill: Yes! — Cosmos: Bill! Do you want a candy? — Bill: Yes! — Cosmos: Bill! Do you want a candy? — Bill: Yes! This how works. ping In the disturbed systems with non-zero this might look so: latency — Cosmos: Bill! Do you want a candy? — Cosmos: Bill! Do you want a candy? — Cosmos: Bill! Do you want a candy? — Bill: Yes! — Bill: Yes! — Bill: Yes! But this case valid only for TCP/ . In case of TCP/ it might change UDP IP — Cosmos: Bill! Do you want a candy? Bill! Do you want a candy? — Cosmos: Bill! Do you want a candy? — Bill: Yes! Yes! Yes! As long sibling packets will be joined by time or size factor( ). MTU The End I have a lot of untold stories, like a Bill and , or candy. Gang-of-Four non-crossbrowser But let me told the last one, about The Indivisible Candy: Bill eats it hundreds of times, but it zap back to his hand, unmunched and even still sweet! So Indivisible candy may be a or a as long garbage collector cant digest it. singleton memory leak, Have a good time, Bill. Original article “The Val`s Candies” was released 7 years ago, and since that time it got a lot of new examples as user comments — recursion, delegation, interfaces, stack overflow, procedures vs functions, classes, B-trees, and so on. So, From abstract computer world using a candy, a cake or something else…. can you describe something from IT? Bill is still very hungry, he is starving. You have to feed him.