swiftlang / swift-book

The Swift Programming Language book
Apache License 2.0
1.75k stars 159 forks source link

Remove comparisons to C and Objective-C #226

Open stzn opened 10 months ago

stzn commented 10 months ago

Location

https://github.com/apple/swift-book/blob/main/TSPL.docc/LanguageGuide/TheBasics.md#comments

https://github.com/apple/swift-book/blob/main/TSPL.docc/LanguageGuide/TheBasics.md#integers

https://github.com/apple/swift-book/blob/main/TSPL.docc/LanguageGuide/TheBasics.md#type-safety-and-type-inference

Description

According to the PR, it seems we want to remove comparisons to C and Objective-C. So, do we also need to fix such sentences like the below? (There could be more places doing that.)

In Comments section:

"Comments in Swift are very similar to comments in C." "Unlike multiline comments in C, multiline comments in Swift..."

In Integer Section:

"These integers follow a naming convention similar to C"

In Type Safety and Type Inference section:

"Because of type inference, Swift requires far fewer type declarations than languages such as C or Objective-C. "

Correction

We should remove comparisons to C and Objective-C.

amartini51 commented 10 months ago

We should review each of these and revise as appropriate, based on context. It's not exactly the case that we want to remove all reference to C. It's an explicit design goal of Swift that it should feel familiar to developers coming from a language whose syntax is C-like (Objective-C, C++, C#, Java, JavaScript, and so on). The main change from the Swift 1 version of TSPL is that the audience is no longer primarily Objective-C developers, so it's important to not assume the reader knows a C-like language, and it's less relevant to compare Swift to Objective-C or C.