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
There are so many clocks in the Louis XV era in F...
References [1] Keendjele TPT, Eelu HH, Nashihanga...
In the morning, when our mother calls us to get u...
Among the many ways to find customers, telephone ...
The Future Science Prize Committee announced the ...
I. Definition of advertiser violation Advertiser ...
Since its invention, instant noodles have been lo...
The author of this article is Zhao Hang, the publ...
Human civilization spreads across all continents ...
The National Space Administration announced today...
According to industry insiders, mini programs wil...
Recently, a bottle of mineral water with a "...
Some people can't sleep in the middle of the ...
Your browser does not support the video tag It is...
Shanghai Mylike is the earliest group enterprise ...