Summary
This document introduces "Swiftly Up to Speed: The Power of Swift Types," an eBook designed to improve code quality by focusing on Swift's robust type system, covering topics like enums, classes, and structs. The series is presented as a comprehensive, learning-focused resource for developers of all levels, available in various formats and with an optional package including Swift Playgrounds. Purchase details and a call to action for the eBook are also provided.
Content Scores
Metric |
Min |
Max |
Mean |
Median |
Total |
Humor |
0 |
3 |
1.33 |
1.5 |
8 |
Helpfulness |
1 |
8 |
6.33 |
7.0 |
38 |
Aggression |
0 |
1 |
0.17 |
0.0 |
1 |
Spiciness |
0 |
0 |
0.00 |
0.0 |
0 |
Chunk-by-Chunk Analysis
Chunk Summary
This document introduces the Swift programming language, highlighting its benefits for code quality and outlining a book's structure focusing on Swift's type system.
Chunk Ratings
Metric |
Score |
Reason |
Humor |
2 |
The text uses mild rhetorical questions like "Want to get ahead of them?" which inject a small amount of conversational appeal, but it doesn't aim for overt humor. |
Helpfulness |
7 |
The text clearly introduces Swift's advantages and provides a structured outline for a book, indicating a clear path for learning. However, it doesn't offer specific code examples or in-depth explanations within this excerpt. |
Aggression |
1 |
The tone is generally encouraging and informative, with no negative or aggressive language present. |
Spiciness |
0 |
The content is entirely professional and focused on technical information, with no offensive or inappropriate material. |
Show Original Text
---
bookScript: books.coffee
date: '2023-01-02'
frame: frame-front
published: false
subframe: frame-article
title: Swiftly Up to Speed
---
# Swiftly Up to Speed
<!-- (tldr: [pricing and ordering options](#ebook-eofferings)) -->
## The Power of Swift Types (June 2014)
Swift is a new programming language currently in limited release, but
soon millions of Swift programmers will start popping up all around
the world.
Want to get ahead of them?
Swift can help you write better programs. Swift can help you
create better data structures. Swift can help you think more clearly
about unfortunate code corners we all fall into from time to time.
All these new features and capabilities come with a
slight learning curve. Even if you write code in a dozen programming languages
every day, Swift still has some attention grabbing features.
We're starting out by covering Swift's ability to create custom types.
Swift is an early-binding, strongly-typed language, and Swift takes full advantage of those
strong types by letting you create custom types, with full verification at
compile time, to improve the reliability and readability of your code.
### Chapter Outline
```javascript
1. The Power of Swift Types
1. Background
2. Rationale
3. This Book
2. Introduction to Swift Types
1. Let’s Save Half a Billion Dollars
1. Addendum
3. Containers
1. struct
1. let vs. var
2. Type Declarations
3. Create an Item
4. Update an Item
5. Using in Functions
6. Functions in Structs
7. Revisiting let vs. var
2. enum
1. Create an Enum
Chunk Summary
This text outlines Swift programming topics including enums, classes, structs, container differences, a Stripe data type example, JSON conversion, and provides chapter links.
Chunk Ratings
Metric |
Score |
Reason |
Humor |
0 |
The text is a structured outline and table of contents, containing no attempts at humor. |
Helpfulness |
7 |
The text provides a clear and organized outline of topics related to Swift programming, specifically focusing on types like structs, enums, and classes, along with a real-world example using Stripe API data. It's helpful for understanding the scope and progression of a learning resource. |
Aggression |
0 |
The text is purely informational and neutral in tone, exhibiting no aggression or negativity. |
Spiciness |
0 |
The content is strictly technical and educational, lacking any offensive or "spicy" material. |
Show Original Text
2. Enum Default Raw Values
3. Creating Enum Value at Runtime
4. Reading Enum Values
3. class
1. Swift Class Basics
4. Exercises
1. Structs
2. Enums
3. Classes
5. Container Differences
1. struct vs. enum
2. struct vs. class
3. class vs. enum
4. Common Among Everything
4. Real World Example: Stripe Data Types in Swift
1. The Stripe API
1. The Charge Object
2. Modeling the Charge Object
3. Modeling IDs
4. Refactoring IDs
5. Modeling Booleans
6. Modeling Money
7. Modeling Worldwide Currencies
8. Modeling Embedded Objects
9. Finally Creating the charge Object
10. Extra Types
11. The Remaining 15 Types
5. JSON From Swift Types
1. The Data Model
2. The Scaffolding
3. The Data Type Implementations
4. Creating JSON From Instance Properties
6. Afterword
```
### Full Chapters
1. [The Power of Swift Types](/swiftly-types-01)
2. [Introduction to Swift Types](/swiftly-types-02)
3. [Containers](/swiftly-types-03)
Chunk Summary
This text describes the "Swiftly Up to Speed" series as an instructional resource for developers of all levels, emphasizing its learning-focused approach and providing details on its format, length, and estimated reading time.
Chunk Ratings
Metric |
Score |
Reason |
Humor |
1 |
The text acknowledges that learning inherently involves confusion and frustration, which adds a slight touch of relatable humor. |
Helpfulness |
8 |
The text provides clear information about the target audience, learning methodology, and format/length of the "Swiftly Up to Speed" series, offering actionable insights for potential readers. |
Aggression |
0 |
The text maintains a calm and neutral tone throughout, focusing on instructional content without any negative or aggressive sentiment. |
Spiciness |
0 |
The content is strictly professional and informative, lacking any offensive or provocative material. |
Show Original Text
4. [Real World Example: Stripe Data Types in Swift](/swiftly-types-04)
5. [JSON From Swift Types](/swiftly-types-05)
<!-- 6. [Afterword](/swiftly-types-06) -->
<!--
## Audience Experience Level
The __Swiftly Up to Speed__ series is written for developers of all ages
and all experience levels.
The __Swiftly Up to Speed__ series follows reliable learning patterns
of introducing concepts, expanding on them, then
using your new concepts in examples and exercises throughout the book. Useful repetition of core concepts really
gets salient points across with as little confusion and frustration
as possible. (All learning involves some confusion and frustration. If you already
knew the topic, you wouldn't have to learn it!)
The __Swiftly Up to Speed__ series is a collection of instructional books
meant to be read from beginning
to end, then even read again to really drive the points home.
These books are
tools to help you learn, understand, practice, and expand your
thinking about modern programming challenges while keeping a focus on reliability
and improving productivity.
If you're looking for just a reference book or a printed
copy of online API documentation, you've come to the wrong place. This
is learning country.
## Format, Layout, Length
__Swiftly Up to Speed: The Power of Swift Types__ introduces you
to Swift's ability to define custom compile-time checked
types to help improve the clarity and reliability of your code.
Each section has plenty of examples included directly from Swift Playground REPL
sessions so you can follow along easily even if you aren't in front of Xcode.
The printed PDF version runs a little
over 50 pages. The iBooks formatted version is about 110 pages. The Kindle version
doesn't report page numbers, but it has lots of "offsets" depending on the size
of your reader.
With zero Swift experience and minimal
experience approaching problems by modeling your own custom types, it will
probably take you an hour or two to just skim the book if you don't
pause to think or work examples and exercises.
You should be operating at Learning Speed, not
Chunk Summary
This text promotes an eBook titled "Swiftly Up to Speed: The Power of Swift Types," detailing its content, pricing, available formats, and an accompanying package that includes Swift Playgrounds.
Chunk Ratings
Metric |
Score |
Reason |
Humor |
3 |
The text attempts a lighthearted tone with phrases like "wisdom sold separately" and the implication of a potentially time-consuming learning process. |
Helpfulness |
7 |
The text provides clear information about an eBook, its content ("The Power of Swift Types"), available formats (iBooks, Kindle, PDF), and an additional offering that includes Swift Playgrounds. It also clarifies system requirements and potential usability issues with other platforms. |
Aggression |
0 |
The text is purely informational and promotional, with no elements of negativity, anger, or depression. |
Spiciness |
0 |
The language is professional and neutral, with no offensive or provocative content. |
Show Original Text
Casual Novel Speed when approaching new topics. You're allowed to slow down, think, and re-read sections
until meanings sink in.
If you take time to pause and consider every example and exercise along the way, __The
Power of Types__ can keep you occupied for days.
-->
<!--
## eBook eOfferings
Let's get down to business. You want knowledge? We've got knowledge (wisdom
sold separately).
<img src="//mattsta.b-cdn.net/swiftly-types-smaller.jpg" title="Swifly Up to Speed; Cover Image">
<p class="buyHdr" data-sku="eBook">
<span class="price">$5.00</span> eBook
</p>
Download __Swiftly Up to Speed: The Power of Swift Types__ from our
_Secure Enclave_ in three formats: iBooks (`epub`), Kindle (`mobi`),
and general availability (`PDF`).
<p class="buyHdr" data-sku="eBookPlayground">
<span class="price">$10.00</span> eBook and Swift Playgrounds
</p>
In addition to downloading __Swiftly Up to Speed: The Power of Swift Types__ from
our _Secure Enclave_ in three formats, you
also get the Swift Playgrounds used to implement every code example throughout the book.
Currently Xcode6-Beta is required to use Swift Playgrounds. Even if you don't
have Xcode 6 yet, the Swift Playgrounds will still let you view and edit code.
Swift Playgrounds contain all the code in plain text, so you can still see everything
in one place instead of trying to copy example code from your e-reader back to your desktop for
coding exercises (and good luck trying to copy code samples from your Kindle or iPad into Xcode).
<!-- <p class="buyHdr" data-sku="eBookPlaygroundWarrant">
<span class="price">$100.00</span> eBook, Swift Playgrounds, and Future Material
</p>
In addition to immediately downloading __Swiftly Up to Speed: The Power of Swift Types__
Chunk Summary
This text outlines the purchase details for the "Swiftly Up to Speed" series, including bundled options, user input fields for email and suggestions, and a call to action for buying.
Chunk Ratings
Metric |
Score |
Reason |
Humor |
2 |
The placeholder text "wishes, dreams, beauty in the dark, Objective-C bridges, porcupines riding cantaloupes..." injects a small amount of quirky humor into an otherwise functional form. |
Helpfulness |
8 |
The text provides clear instructions for purchasing a book series, including fields for email, optional suggestions, and subscription preferences, as well as buttons to select different purchase bundles. It also indicates the use of a secure checkout process. |
Aggression |
0 |
The text is neutral and informative, focused on guiding the user through a purchase process without any negative or aggressive language. |
Spiciness |
0 |
The text is entirely professional and functional, with no offensive or inappropriate content. |
Show Original Text
in three formats plus all Swift Playgrounds from our _Secure Enclave_, you also get a _future warrant_ granting
you pre-paid access to all books, source files, and other upcoming material
in the entire __Swiftly Up to Speed__ series.
##### Optional Currency Conversion
<small>Type a new currency below to change the prices above.
You will be charged using the currency listed when you checkout.</small>
<label for="currency">currency: </label>
<input type="text" id="currency" value="usd" maxlength="3" pattern="[a-zA-Z]{3}">
<div id="paymentStatus" class="alert alert-info"></div>
<div id="paymentError" class="alert alert-danger"></div>
## Buy Now
<script src="https://checkout.stripe.com/checkout.js"></script>
<script>
{{{bookScript}}}
</script>
<form role="form" action="/secure" method="post">
<div class="form-group">
<label for="email">email (for receipt and book retrieval)</label>
<input type="email" class="form-control" id="email" placeholder="email address">
</div>
<div class="form-group">
<label for="email">Suggestions welcome: What should future books cover? (optional)</label>
<input required type="text" class="form-control" id="topics" placeholder="wishes, dreams, beauty in the dark, Objective-C bridges, porcupines riding cantaloupes...">
</div>
<div class="checkbox">
<label>
<input id="subscribe" name="updates" type="checkbox"> Send me
__Swiftly Up to Speed__ updates (easy unsubscribe; __strongly__ recommended).
</label>
</div>
### Click a bundle:
<button type="button" class="btn btn-primary btn-lg" id="typesEbook">eBook</button>
<button type="button" class="btn btn-primary btn-lg" id="typesEbookPlayground">eBook + Playgrounds</button>
Chunk Summary
This is an HTML button with the text "eBook + Playgrounds + Future Releases" and an associated ID.
Chunk Ratings
Metric |
Score |
Reason |
Humor |
0 |
The text consists of a single HTML button element with no accompanying descriptive text, therefore there is no basis for humor. |
Helpfulness |
1 |
The text provides a functional HTML button. However, without context or surrounding code, its purpose and usefulness are extremely limited. |
Aggression |
0 |
The text is purely a code snippet and contains no emotional language or expressions of negativity. |
Spiciness |
0 |
The text is a standard HTML element and contains no offensive or inappropriate content. |
Show Original Text
<button type="button" class="btn btn-primary btn-lg" id="typesEbookPlaygroundWarrant">eBook + Playgrounds + Future Releases</button>
</form>
-->