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

Chapter 3. One Piece at a Time – Types, Scopes, and Projects

In Chapter 2, Building Blocks – Variables, Collections, and Flow Control, we developed a very simple program that helped organize a party. Even though we separated parts of the code in a logical way, everything was written in a single file and our functions were all lumped together. As projects grow in complexity, this way of organizing code is not sustainable. In the same way we use functions to separate out logical components in our code at scale, we also need to be able to separate out the logical components of our functions and data. To do this, we can define code in different files and we can also create our own types that contain custom data and functionality. These types are commonly referred to as objects, as a part of the programming technique called object-oriented programming. In this chapter we will cover the following:

  • Structs
  • Classes and inheritance
  • Enumerations
  • Projects
  • Extensions
  • Scope
  • Access control
主站蜘蛛池模板: 濉溪县| 忻城县| 双流县| 元氏县| 张掖市| 轮台县| 高密市| 中超| 陆川县| 鄂托克前旗| 徐州市| 山丹县| 达拉特旗| 永川市| 扎赉特旗| 梧州市| 凤山市| 临朐县| 犍为县| 东乡族自治县| 上高县| 隆回县| 甘泉县| 任丘市| 衢州市| 台湾省| 苏尼特左旗| 分宜县| 金湖县| 大石桥市| 成都市| 汕头市| 东莞市| 洛宁县| 灯塔市| 华池县| 墨竹工卡县| 嘉义县| 叙永县| 龙江县| 新巴尔虎右旗|