Skip to content

Commit 9857b0d

Browse files
authored
[benchmark] Replace OCB with Bridging
Removed the controversial mention of C-style name prefixes.
1 parent e828adc commit 9857b0d

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

benchmark/Naming.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ optional chaining etc.
4343
````
4444
✅ Array.append.Array.Int?
4545
✅ Flatten.Array.Tuple4.for-in.reserved
46-
OCB.NSArray.as!.Array.NSString
46+
Bridging.NSArray.as!.Array.NSString
4747
````
4848

4949
Note: Special characters that could be interpreted by the shell require escaping
@@ -97,16 +97,15 @@ Use periods to separate the name components in variants derived from specialised
9797
generic types or significant method chains.
9898

9999
````
100-
⛔️ InsertCharacterStartIndex
101100
⛔️ InsertCharacterTowardsEndIndexNonASCII
102101
````
103102

104103
There's no need to be literal with type names. **Be descriptive**:
105104

106105
````
107-
✅ Flatten.Array.Tuple4.lazy.flatMap
108-
✅ String.insert.ASCIIChar.StartIndex
109106
✅ String.insert.EmojiChar.NearEnd
107+
✅ String.insert.ASCIIChar.StartIndex
108+
✅ Flatten.Array.Tuple4.lazy.flatMap
110109
````
111110

112111
</details><p><!-- spacer --></p></li>
@@ -129,18 +128,16 @@ Use **`Val`** and **`Ref`** as short descriptors for variants that compare value
129128
types (`struct`, `Int`) with reference types (often named with `Class` in the
130129
legacy-style).
131130
Prefer **`Char`** to `Character`, which can be combined with codepage or
132-
language prefix/suffix when necessary (`ASCIIChar`). For benchmarks that measure
133-
`String`'s Unicode performance for various languages, use
131+
language prefix/suffix when necessary (`EmojiChar`, `ASCIIChar`). For benchmarks
132+
that measure `String`'s Unicode performance for various languages, use
134133
[two letter codes](https://en.wikipedia.org/wiki/ISO_639-1) instead of spelling
135134
out the whole language names.
136135

137-
*In a pinch*, it's OK to use short C-style naming prefixes like `OCB` (for
138-
Objective-C Bridging) or consistent abbreviations in the benchmark family like
139-
`Str` and `Arr`, but *only if* it helps to fit a system with descriptive
140-
names into 40 characters:
136+
When necessary, use *consistent* abbreviations like `Str` and `Arr` within the
137+
benchmark family, to fit a system with descriptive names into 40 characters:
141138

142139
````
143-
OCB.NSDict.as!.Dictionary.NSString.NSNum
140+
Bridging.NSDict.as!.Dict.NSString.NSNum
144141
✅ Seq.prefixWhile.AnySeq.UnfoldSeq.lazy
145142
````
146143

0 commit comments

Comments
 (0)