Swift Style: An Opinionated Guide to an Opinionated Language

Erica Sadun

  • 出版商: Pragmatic Bookshelf
  • 出版日期: 2017-05-09
  • 定價: $1,020
  • 售價: 9.5$969
  • 語言: 英文
  • 頁數: 226
  • 裝訂: Paperback
  • ISBN: 1680502352
  • ISBN-13: 9781680502350
  • 相關分類: Apple Developer
  • 立即出貨 (庫存=1)

買這商品的人也買了...

相關主題

商品描述

Discover the do's and don'ts involved in crafting readable Swift code as you explore common Swift coding challenges and the best practices that address them. From spacing, bracing, and semicolons to proper API style, discover the whys behind each recommendation, and add to or establish your own house style guidelines. This practical, powerful, and opinionated guide offers the best practices you need to know to work successfully in this equally opinionated programming language.

Apple's Swift programming language has finally reached stability, and developers are demanding to know how to program the language properly. Swift Style guides you through the ins and outs of Swift programming best practices. This is the first best practices book for serious, professional Swift programmers and for programmers who want to shine their skills to be hired in this demanding market.

A style guide offers a consistent experience of well-crafted code that lets you focus on the code's underlying meaning, intent, and implementation. This book doesn't offer canonical answers on Swift coding style. It explores the areas of Swift where structure comes into play. Whether you're developing a personal style or a house style, there are always ways to enhance your code choices. You'll find here the ideas and principles to establish or enhance your own best style practices.

Begin with simple syntactical styling. Strengthen code bracing for easy readability. Style your closures for safety and resilience. Perfect spacing and layout. Master literal initialization and typing. Optimize control flow layout and improve conditional style choices. Transition from Objective-C and move code into Swift the right way. Boost API design using proper naming and labeling. Elevate defaulted arguments and variadics to their right places. Finally, Erica offers her own broad recommendations on good coding practice.

What You Need:

Recent version of the Swift programming language

商品描述(中文翻譯)

探索常見的 Swift 編碼挑戰和解決方案的最佳實踐,從間距、括號和分號到適當的 API 風格,了解每個建議背後的原因,並添加或建立自己的程式碼風格指南。這本實用、強大且具有主觀意見的指南提供了您在這個同樣具有主觀意見的程式語言中成功工作所需的最佳實踐。

蘋果的 Swift 程式語言終於達到穩定性,開發人員迫切想知道如何正確地使用這個語言進行編程。《Swift Style》將引導您了解 Swift 編程的最佳實踐。這是第一本針對嚴肅、專業的 Swift 程式設計師以及希望在這個要求嚴格的市場上展現技能的程式設計師的最佳實踐書籍。

風格指南提供了一致的、精心製作的程式碼體驗,讓您專注於程式碼的基本含義、意圖和實現。本書不提供關於 Swift 編碼風格的標準答案,而是探討了 Swift 中結構發揮作用的領域。無論您是開發個人風格還是統一風格,總有方法可以提升您的程式碼選擇。在這裡,您將找到建立或提升自己最佳風格實踐的思想和原則。

從簡單的語法風格開始。加強程式碼的括號以實現易讀性。為閉包設計安全和彈性。完美的間距和佈局。掌握文字初始化和類型。優化控制流程佈局,改進條件式風格選擇。從 Objective-C 過渡並以正確的方式將程式碼轉換為 Swift。通過適當的命名和標籤提升 API 設計。將預設引數和可變引數放在適當的位置。最後,Erica 提供了她自己關於良好編碼實踐的廣泛建議。

所需材料:
- 最新版本的 Swift 程式語言。