- Mastering macOS Programming
- Stuart Grimshaw
- 895字
- 2021-07-02 22:54:13
What you'll get from this book
This brings us quite nicely to the goals of this book.
Well, in a general sense, its goal is to help you reach yours, of course. But how exactly are we going to do that?
The focus of this book is very much on real-world programming skills and best practices, with a clear preference for techniques that provide solid, maintainable code over a long app lifetime, as opposed to the latest Thing from the developer conferences. Similarly, we will concentrate more on the functional interior of the code rather than short-lived user-interface design trends that will be of little interest a year from now.
There is also a strong emphasis on developing the skills that a developer will need when working in the industry, within a team that may include other developers, including those working on different platforms, as well as graphic artists, technical leads, project and product managers, system administrators and back-end developers, and any number of other roles with which it is necessary to communicate with clarity and accuracy. These people will have their own corners of the business to attend to, to which you will frequently have to adapt your work, making it all the more important that you have a number of tools at your disposal to deal with rapidly changing requirements and priorities.
Frequently, it is necessary to include third-party frameworks and libraries, often ones that you would not choose yourself: maybe because the team has been using them within a project already; maybe because a client has requested the addition of an analytics engine to an app, or to add functionality to an app not available natively. These are perhaps the most common reasons, but they are not the only ones, and an ability to integrate these resources into your work is an essential part of modern app development, and one that is only likely to increase with time.
Professional coding means writing clear code, adhering where appropriate (which means most of the time) to established practices. We will prefer simplicity over cleverness every time, and hopefully this is a habit you will develop yourself.
A huge part of coding wisely means knowing which techniques to deploy, and which are better left out, in any given situation. It means learning to strike the right balance between clarity and the inevitable complexity that results from the growth of a project over time.
You will also learn to deal with version control safely, an essential part of working on larger projects, even as a sole developer.
Debugging your code is an essential part of programming, and we will look at the tools available to you in Xcode to make these tasks easier, faster, and safer. Fixing bugs can become a major part of your work, and your skills in this area will contribute greatly to your ability to deliver reliable code.
Finally, we will not shy away from references to resources beyond this book. The time is long gone when a developer can be expected to know every detail of a language or platform, and knowing where to search for documentation and help is an indispensable part of our work as developers. It has been said that a good developer spends two thirds of the time reading and one third coding. Although that should perhaps be taken with a pinch of salt, if only because it overlooks writing documentation, testing, and talking to clients, managers, and team members, it nevertheless makes clear that writing code is not only not everything, it's not even most of it.
Our highest priority is to impart knowledge that will be immediately and enduringly useful to you as a developer. That may seem like stating the obvious, but you will notice that the content of this book does not necessarily reflect the buzz and hype around the blogosphere's latest shiny new toys. It is true that even the oldest, best-tested tools were new once, but it is not our intention here to get lost in the esoteric delights of functional programming, protocol-oriented programming, reactive programming, or whatever else is the subject of heated debate at the time of writing.
That is not to say that such topics are somehow not thrilling, valuable, and thought-provoking. They most definitely are, but they are not within the scope of this book. However, the website is not limited in size, so we'll see what we can do.
Also not covered here is the migration and adaptation of Swift 2 code to Swift 3. There will doubtless be any number of articles out there covering this, but for the purposes of this book, we will treat Swift 3 as the only version of interest. And although it's an important topic, moving from Objective C to Swift is beyond the scope of this book.
Finally, we will not cover unit tests and integration testing. This field is a wide one, space here is limited, and the reader is encouraged to find resources that can do justice to both the topic itself, and the wide range of opinions surrounding it.