The naughty child Xiao Ming and his moonlighting aunt one story The naughty kid Xiao Ming is going to have his 7th birthday. He blocked the door of his house early in the morning and asked for red envelopes from relatives who came to celebrate his birthday. He also said that he would make trouble if they didn't give him red envelopes. Knowledge Points
two story After eating the cake and seeing everyone off, Xiao Ming happily opened the red envelope. Wow! There are so many Mao Zedongs in this red envelope! Wow! There are actually US dollars in this red envelope! Wow! This red envelope is actually empty!!! Xiao Ming cried, cried so sadly, and the whole person collapsed. Knowledge Points
three story In the blink of an eye, Xiao Ming is about to celebrate his 8th birthday. Recalling the empty red envelopes he received when he was 7 years old, Xiao Ming prepared a transparent plastic bag early. When receiving red envelopes, he asked everyone to put the contents of the red envelopes into the plastic bag in front of him before he could go into the house to eat. If nothing fits into the plastic bag, Xiao Ming will throw a tantrum and spit (what a naughty child-_-|||) Knowledge Points This story is about optional binding of Optional type data.
Four story Xiao Ming has grown up and knows that it is not good to ask relatives to open the red envelopes in front of him. He doesn't care about some unscrupulous relatives giving empty red envelopes. He has learned to play dumb (how did he suddenly change so much-_-|||). Although he still gets upset when he opens an empty red envelope. Knowledge Points Implicitly unwrapped optional types Sometimes in the program architecture, after the first assignment, it can be determined that an optional type will always have a value. In this case, it is very inefficient to check and parse the optional value every time, because it is certain that it will always have a value. end Well, Xiao Ming's story is over! Don't give your juniors empty red envelopes in the future! Otherwise, when he grows up, he won't be able to implicitly interpret you! Haha |
<<: 25 great tips for intermediate Git users
>>: Don’t use subclasses! Swift is protocol-oriented at its core
As traffic dividends disappear and corporate cust...
Zhihu started operating in September 2019, and it...
Kunming tea tasting has its own studio. Recommend...
Recently, we learned from relevant channels that ...
"Apple has become the most important company...
Experts in this article: Zhao Aili, PhD candidate...
Preface Greed is an inherent ability of human bei...
In the Android system, to start an Activity, whet...
Regarding rotation, it's not that simple. By ...
HTC was once the king of the Android camp. In Apr...
Dongfeng Honda, which has had mediocre sales in re...
[51CTO.com Quick Translation] Swift Algorithm Clu...
2021 Week 49 Issue 14 Total Issue 360 Hello every...
In 2014, the Discovery Channel designed a program...
Many people find that their total cholesterol lev...