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
Weibo can be said to be a big brother-level platf...
February 19 news Google today released the first ...
In 2016, competition in the mobile Internet arena...
With the continuous development and progress of s...
Many new products are doing very well, but people...
In this issue of A Brief History of Global Festiv...
How often do you clean your house? Once every two...
As UI design continues to gain popularity, althou...
Many new products are doing very well, but people...
With the explosion of technologies such as 5G and...
Author: Duan Yuechu and Huang Xianghong A tardigr...
Apple iPhone finally uses OLED display for the fi...
Source: Dr. Curious...
I don't think my life is unconventional. Of c...
Some time ago, a certain brand positioned as high...