官术网_书友最值得收藏!

Summary

In this chapter, we developed a great foundation of Swift knowledge. You learned the various built-in mechanisms Swift has to represent complex information in expressive and accessible ways. We know that by default, we should declare information as constant until we find a practical need to change it and then we should make it a variable. We explored how every piece of information in Swift has a type associated with it by the compiler, whether it is through type inference or it is declared specifically. We are familiar with many of the built-in types, including simple types, such as String, Int and Bool, as well as containers, such as tuples, arrays, and dictionaries. We can use console output to better investigate our programs, especially with the use of string interpolation for dynamic output. We recognized the power of controlling the flow of our programs with if statements, conditionals, switches, and loops. We have functions in our skill set to write more understandable, maintainable, and reusable code. Finally, we saw an example of how all of these concepts can be combined to write a full program.

As a challenge to you, I suggest you fix the final program to stop it from trying to assign shows if there are not enough invitees. When you can do that, you are more than ready to move onto the next topic, which is types, scopes, and projects.

These are all tools that we can use to write even more organized code and they become critical as we write larger and larger projects.

主站蜘蛛池模板: 吉林市| 永年县| 瓦房店市| 苏州市| 双柏县| 二手房| 安阳县| 广宁县| 玛沁县| 和林格尔县| 恩平市| 玛曲县| 永善县| 桂平市| 双牌县| 景洪市| 富顺县| 堆龙德庆县| 葵青区| 绥江县| 泌阳县| 兰溪市| 北碚区| 攀枝花市| 延安市| 灵宝市| 房产| 阳东县| 嘉荫县| 金秀| 那坡县| 宣城市| 伊宁市| 大余县| 成安县| 扶沟县| 无极县| 锦州市| 葵青区| 枣阳市| 陵水|