{ } (braces), C# style conventions, 466–469
, (comma), C# style conventions, 475–476
- (hyphens), naming conventions, 53
(/* . */), multiline syntax, comments, 482
(// .), single line syntax, comments, 482
abbreviations, naming conventions, 55–56
abstract classes, type design guidelines, 98–102
abstract members
adding, 539
changing
to virtual members, 553
virtual members to, 553
override members, removing an override of an abstract member, 543–544
abstractions
self-documenting object models, principle of, 34–36
AccessViolationException, 276
acronyms
adding
abstract members, 539
base interfaces to interfaces, 536
members
to interfaces, 541
method parameters, 546
readonly modifier to structs, 535, 550
reference type fields to structs, 540
second declaration to generic interfaces, 536–537
static modifiers, 549
aggregate components
component-oriented design, 331–334
alphanumeric characters, naming conventions, 53
API (Application Programming Interface)
consistency, 34
designing frameworks
low barrier to entry, principle of, 23–29
scenario-driven framework design, 16–23
self-documenting object models, principle of, 29–36
exceptions and API consistency, 250
heavy API design processes, 2
layered architecture, principle of, 36–39
naming new versions of existing API, 58–61
Stopwatch specification, 524–528
well-designed frameworks, qualities of, 3
backward compatibility, 2
borrowing from existing proven designs, 6–7
evolution, 7
integration, 7
OO design, 2
prototyping, 2
trade-offs, 6
ApplicationException, 274
applications
RAD, progressive frameworks, 13
architectures (layered), principle of, 36–39
ArgumentNullException, 275–276
ArgumentOutOfRangeException, 275–276
arguments, validation, 207–210, 480
arrays
ASCII characters
code restrictions, 479
naming conventions, 54
Unicode escape sequences (uXXXX), 479
assemblies
types and assembly metadata, 127–129
assignment-expression-throw, C# style conventions, 480
Async Patterns, 502
Async method return types, 348–351
Async variants of existing synchronous methods, 353–354
Classic Async Patterns, 361, 503–509
deadlock, 358
Event-Based Async Patterns, 361–362, 510–512
exceptions to Async methods, 359–361
IAsyncDisposable interface, 362
IAsyncEnumerable<T> interface, 362–365
implementation guidelines, 355–361
incremental results, 516
Out parameters, 512
Ref parameters, 512
Task-Based Aync Pattern, 341–347
Task.Status consistency, 355–357
ValueTask<TResult> structs, 358–359
attributes, usage guidelines, 291–294
auto-implemented properties, C# style conventions, 479
backward compatibility, well-designed frameworks, qualities of, 2
base classes
moving members to, 541
base interfaces
adding to interfaces, 536
moving members to, 541
base members, masking, 539
BCL type names, C# style conventions, 476
Binary serialization, 493
boolean parameters, choosing, 205–207
borrowing from existing proven designs, well-designed frameworks, 6–7
braces ({ }), C# style conventions, 466–469
breaking changes, 529
classes
changing to structs, 537
moving members to base classes, 541
compilation breaks, 530
finalizers, removing from
sealed types, 542
unsealed types, 542
interfaces
adding a second declaration to interfaces, 536–537
adding base interfaces to interfaces, 536
adding members to, 541
moving members to base interfaces, 541
members
adding abstract members, 539
adding to interfaces, 541
adding to unsealed types, 539–540
changing member signatures, 545–553
masking base members, 539
moving to base classes, 541
moving to base interfaces, 541
moving to derived types, 542
override members, 540
removing an override of a virtual member, 543
removing an override of an abstract member, 543–544
removing non-override members, 543
namespaces, adding namespaces that conflict with existing types, 531–532
private fields
removing from serializable types, 544
renaming on serializable types, 544
recompile breaks, 530
reflection breaks, 530
runtime breaks, 529
structs
adding first reference type field to, 540
adding readonly modifier to structs, 535–536
changing classes to, 537
ref structs, 538
types
changing namespaces, 535
moving members to derived types, 542
names, case sensitivity, 534
removing, 533
removing finalizers from sealed types, 542
removing finalizers from unsealed types, 542
removing private fields on serializable types, 544
renaming private fields on serializable types, 544
sealing unsealed types, 534
unsealing sealed types, 534
brevity, naming conventions, 52
buffer operators
data transformation operations, 445–451
OperationStatus value, 458–463
C#
coding style conventions, 465–466
ASCII characters, code restrictions, 479
assignment-expression-throw, 480
auto-implemented properties, 479
BCL type names, 476
collection initializers, 478
expression-bodied members, 478–479
if.throw, 480
language keywords, 476
nameof (.) syntax, 479
readonly modifiers, 479
this.476
Unicode escape sequences (uXXXX), 479
language-specific names, naming conventions, 57
C++, language-specific names, naming conventions, 57
callbacks, extensibility, 231–237
camelCasing, 43
parameter names, 79
cancellation, Async Patterns, 512–513
capitalization, 42
camelCasing, 43
case sensitivity
type names, 534
change notification events, DP, 371
changing
abstract members to virtual members, 553
classes to structs, 537
constant field values, 552
default values, in optional parameters, 552
member
method
parameters types, 546
non-virtual members to virtual members, 553
notification events in properties, 163–165
optional parameters to required, 551–552
property types, 548
required parameters to optional, 551
runtime error exceptions to usage error exceptions, 553–554
type names
case sensitivity, 534
changing namespaces, 535
usage error exceptions to functioning behavior, 554
values returned type, from a method, 554–555
virtual members to abstract members, 553
choosing
exceptions for throwing, 260–264
member
classes
abstract classes, type design guidelines, 98–102
base classes
moving members to, 541
changing
classes to structs, 537
defined, 84
members, moving to base classes, 541
common types, 71
generic type parameters, 70–71
static classes
defined, 84
type design guidelines, 102–104
type design guidelines, 89–100, 102–104
unsealed classes, extensibility, 228–229
Classic Async Patterns, 361, 503–509
Close() method, Dispose Patterns, 382–383
CLR (Common Language Runtime), language-specific names and naming conventions, 57
collections
initializers, C# style conventions, 478
arrays versus collections, 302–303
collection properties, 298–302
ComException, 278
commas ( , ), C# style conventions, 475–476
comments
“I” usage, 483
multiline syntax (/* . */), 482
passive voice, 483
personification, 483
single-line syntax (// .), 482
“we” usage, 483
common names, naming conventions, 57–58
compatibility (backward), well-designed frameworks, 2
compilation breaks, 530
component-oriented design, 331–334
compound words, capitalization, 48–51
ConfigureAwait modifier, await using, 393–394
consistency
self-documenting object models, principle of, 34
well-designed frameworks, qualities of, 7–8
constant field values, changing, 552
constructors
contravariance, design patterns, 412–417
conversion operators, 198-C05.1827
core namespaces, 66
costs, well-designed frameworks, 4–5
covariance, design patterns, 412–415, 417–423
customizing
event handlers, obsolete guidance, 491–492
exceptions
Data Contract serialization, 493, 495–499
data transformation operations, 445–451
DateTime struct, usage guidelines, 306–308
DateTimeOffset struct, usage guidelines, 306–308
deadlock, Async Patterns, 358
declarations, adding to interfaces, 536–537
default values, changing in optional parameters, 552
derived types, moving members to, 542
design patterns
choosing between Async Patterns, 503–504
Classic Async Patterns, 503–509
Event-Based Async Patterns, 503–504, 510–512
incremental results, 516
Out parameters, 512
Ref parameters, 512
OperationStatus value, 458–463
partial writes to buffers, 458–463
Dispose Patterns, 372–394, 511–517
Template Method Pattern, 423–425
.Design subnamespaces, 489
designing
component-oriented design, 331–334
protected members, 230
backward compatibility, 2
evolution, 7
existing proven designs, borrowing from, 6–7
integration, 7
low barrier to entry, principle of, 23–29
multiframework platforms, 12–13
OO design, 2
prototyping, 2
scenario-driven framework design, 16–23
self-documenting object models, principle of, 29–39
trade-offs, 6
members
conversion operators, 198-C05.1827
explicit implementation of interface members, 148–152
members with variable number of parameters, 214–218
parameter argument validation, 207–210
tuples in member signatures, 220–226
members with variable number of parameters, 214–218
change notification events, 163–165
assembly metadata and types, 127–129
diacritical marks, naming conventions, 55
Dispose (bool) method, Dispose Patterns, 376–380
Dispose (true) method, Dispose Patterns, 377–378
Dispose Patterns
basic Dispose Patterns, 375–383
ConfigureAwait modifier, 393–394
Dispose (bool) method, 376–380
Dispose (true) method, 377–378
finalizable types, 383–387, 511–517
IAsyncDisposable interface, 391–392
SuppressFinalize method, 378
DLL (Dyanmic-Link Libraries), naming conventions, 61–62
DP (Dependency Properties), 365–366
change notification events, 371
validation, 370
enums
defined, 84
flag enums, type design guidelines, 119–123
type design guidelines, 111–118
equality operators
reference types, 328
value types, 327
error exceptions
runtime error exceptions, changing to usage error exceptions, 553–554
throwing new types of, 555
usage error exceptions, changing
to functioning behavior, 554
runtime error exceptions to, 553–554
error handling, exceptions and, 250–252
error messages, designing, 264–265
event handlers (custom), obsolete guidance, 491–492
Event-Based Async Patterns, 361–362, 503–504, 510–512
events
change notification events, DP, 371
custom event handlers, obsolete guidance, 491–492
notification events, changing in properties, 163–165
evolution of well-designed frameworks, qualities of, 7
exceptions
AccessViolationException, 276
API consistency, 250
ApplicationException, 274
ArgumentNullException, 275–276
ArgumentOutOfRangeException, 275–276
ComException, 278
custom exceptions
error exceptions, throwing new types of, 555
ExecutionEngineException, 278
IndexOutOfRangeException, 276
instrumentation and, 254
InvalidOperationException, 274–275
NullReferenceException, 276
object-oriented languages, 249–250
OperationCanceledException, 278
performance and, 281
PlatformNotSupportedException, 279
runtime error exceptions, changing to usage error exceptions, 553–554
SEHException, 278
self-documenting object models, 33
StackOverflowException, 276–277
SystemException, 274
TaskCanceledException, 278
from existing thrown types, 555
new types of error exceptions, 555
unhandled exception handlers, 253
usage error exceptions
changing runtime error exceptions to, 553–554
changing to functioning behavior, 554
ExecutionEngineException, 278
existing proven designs (well-designed frameworks), qualities of, 6–7
expense, well-designed frameworks, 4–5
explicit implementation of interface members, 148–152
exposing layers
in separate namespaces, 38
expression-bodied members, C# style conventions, 478–479
expression-throw, C# style conventions, 480
protected members, 230
factored types, aggregate components, 334–335
factories, design patterns, 394–399
features (optional), design patterns, 408–411
fields
private fields
removing from serializable types, 544
renaming private fields on serializable types, 544
file organization, C# style conventions, 483–485
finalizable types, Dispose Patterns, 383–387, 511–517
Finalize method, Dispose Patterns, 378
finalizers, removing
sealed types, 542
from unsealed types, 542
first reference type field, adding to structs, 540
flag enums, type design guidelines, 119–123
Framework Design Guidelines, naming conventions, 480
frameworks
backward compatibility, 2
borrowing from existing proven designs, 6–7
evolution, 7
integration, 7
low barrier to entry, principle of, 23–29
multiframework platforms, 12–13
naming conventions, 480
OO design, 2
prototyping, 2
scenario-driven framework design, 16–23
self-documenting object models, principle of, 29–36
trade-offs, 6
multiframework platforms, 12–13
usability studies, scenario-driven framework design, 21–23
well-designed frameworks, qualities of, 3
backward compatibility, 2
borrowing from existing proven designs, 6–7
evolution, 7
integration, 7
OO design, 2
prototyping, 2
trade-offs, 6
generic interfaces, adding a second declaration to, 536–537
generic type parameters, naming conventions, 70–71
Async Patterns, 502
choosing between Async Patterns, 503–504
Classic Async Patterns, 503–509
Event-Based Async Patterns, 503–504, 510–512
incremental results, 516
Out parameters, 512
Ref parameters, 512
custom event handlers, 491–492
Dispose Patterns, finalizable types, 511–517
.Interop subnamespaces, 490
.Permissions subnamespaces, 489–490
naming conventions, 488
serialization, 493
.NET serialization technologies, 493
heavy API design processes, 2
Hungarian notation
C# style conventions, 482
hyphens (-), naming conventions, 53
“I” in comments, 483
IAsyncDisposable interface
Async Patterns, 362
IAsyncEnumerable<T> interface, Async Patterns, 362–365
ICloneable struct, usage guidelines, 308–309
IComparable<T> struct, usage guidelines, 309–311
identifiers
camelCasing, 43
naming conventions, 54
type parameters (generic), naming conventions, 70–71
IDisposable method, Dispose Patterns, 377, 382–383
IEnumerable<T> method, LINQ support, 402–403
if.throw, C# style conventions, 480
implementation
auto-implemented properties, 479
expression-bodied members, 478–479
interface members, explicit implementation of, 148–152
incremental results, Async Patterns, 516
indents, C# style conventions, 471–472
indexed properties, designing, 161–163
IndexOutOfRangeException, 276
infrastructure namespaces, 66
initializers, C# style conventions
collection initializers, 478
instrumentation, exceptions and, 254
integration (well-designed frameworks), qualities of, 7
interfaces
abstractions, extensibility, 239–241
adding, members, 541
base interfaces
adding to interfaces, 536
moving members to, 541
defined, 84
generic interfaces, adding a second declaration to, 536–537
members
adding, 541
adding to interfaces, 541
implementing explicitly, 148–152
moving to base interfaces, 541
common types, 71
generic type parameters, 70–71
type design guidelines, 92–100, 104–106
.Interop subnamespaces, 490
keywords (language)
C# style conventions, 476
language keywords, C# style conventions, 476
languages (programming), framework design, 11–12
language-specific names, naming conventions, 56–58
layered architecture, principle of, 36–39
limiting, extensibility, 244–246
LINQ (Language-Integrated Queries)
support
IEnumerable<T> method, 402–403
implementation, 402
masking base members, 539
members
abstract members
adding, 539
changing to virtual members, 553
changing virtual members to, 553
removing an override of an abstract member, 543–544
base members, masking, 539
changing, member signatures, 545–553
constructors
designing
conversion operators, 198-C05.1827
members with variable number of parameters, 214–218
parameter argument validation, 207–210
tuples in member signatures, 220–226
expression-bodied members, 478–479
interface members, implementing explicitly, 148–152
masking base members, 539
modifiers, C# style conventions, 473–475
moving to
base classes, 541
base interfaces, 541
derived types, 542
non-override members, removing, 543
non-virtual members, changing to virtual members, 553
override members, 540
removing an override of a virtual member, 543
removing an override of an abstract member, 543–544
parameters, designing, 202–204
properties
change notification events, 163–165
protected members, extensibility, 230
signatures
unsealed types, adding members to, 539–540
virtual members
changing abstract members to, 553
changing to abstract members, 553
removing an override of a virtual member, 543
metadata, assembly metadata and types, 127–129
methods
Async methods
Dispose (bool) method, 376–380
Dispose (true) method, 377–378
IDisposable method, Dispose Patterns, 377, 382–383
IEnumerable<T> method, LINQ support, 402–403
IQueryable<T> method, IQueryable<T> method, 403–404
member methods, choosing, 152–158
naming conventions, 74–75, 196–197
operators and method names, 196–197
parameters
adding, 546
changing types, 546
removing, 546
renaming, 545
reordering parameters by the same type, 547
reordering parameters of differing types, 547
return types, changing, 547–548
static TryParse methods, 286
struct methods
adding readonly modifiers, 550
removing readonly modifiers, 551
SuppressFinalize method, 378
synchronous methods, Async variants of, 353–354
Try methods, value-producing Try methods, 284–285
values returned type, changing from a method, 554–555
modifiers
member modifiers, C# style conventions, 473–475
readonly modifiers
adding to struct methods, 550
C# style conventions, 479
removing from struct methods, 551
static modifiers, adding/removing, 549
moving
members to
base classes, 541
base interfaces, 541
derived types, 542
types
via [TypeForwardedTo], 532–533
without [TypeForwardedTo], 533
multiframework platforms, 12–13
multiline syntax (/* . */), comments, 482
nameof (.) syntax, C# style conventions, 479
namespaces
adding namespaces that conflict with existing types, 531–532
core namespaces, 66
infrastructure namespaces, 66
subnamespaces
.Design subnamespaces, 489
.Interop subnamespaces, 490
.Permissions subnamespaces, 489–490
technology namespace groups, 66–67
type names, changing, 535
type names, conflicts, 65
core namespaces, 66
infrastructure namespaces, 66
technology namespace groups, 66–67
alphanumeric characters, 53
API, naming new versions of existing API, 58–61
ASCII characters, 54
brevity, 52
capitalization, 42
common types, 71
generic type parameters, 70–71
custom collections, 305
diacritical marks, 55
Framework Design Guidelines, 480
Hungarian notation, 53
hyphens (-), 53
identifiers, 54
type parameters (generic), 70–71
common types, 71
generic type parameters, 70–71
language-specific names, 56–58
obsolete guidance, 488
overload operator parameters, 80
readability, 52
resources, 81
self-documenting object models, 30–32
common types, 71
generic type parameters, 70–71
type members, 74
types (common), 71
nested types, design guidelines, 124–127
.NET serialization technologies, 493
non-override members, removing, 543
non-virtual members, changing to virtual members, 553
notification events, changing in properties, 163–165
Nullable<T> struct, usage guidelines, 311–312
NullReferenceException, 276
object initializers, C# style conventions, 477–478
object models (self-documenting), principle of, 29–30
consistency, 34
exceptions, 33
Object.Equals, usage guidelines, 312–314
reference types, 314
value types, 314
Object.GetHashCode, usage guidelines, 315–316
object-oriented design, 2
object-oriented languages, exceptions and, 249–250
Object-Oriented Programming, 2
objects, usage guidelines, 312
Async Patterns, 502
choosing between Async Patterns, 503–504
Classic Async Patterns, 503–509
Event-Based Async Patterns, 503–504, 510–512
incremental results, 516
Out parameters, 512
Ref parameters, 512
custom event handlers, 491–492
Dispose Patterns, finalizable types, 511–517
.Design subnamespaces, 489
.Interop subnamespaces, 490
.Permissions subnamespaces, 489–490
naming conventions, 488
serialization, 493
usage guidelines, serialization, 493–502
OO (Object-Oriented) design, 2
OOP (Object-Oriented Programming), 2
OperationCanceledException, 278
operations (scoped), Dispose Patterns, 387–391
OperationStatus value, buffer operators, 458–463
operators
conversion operators, 198-C05.1827
equality operators
reference types, 328
value types, 327
optional features, design patterns, 408–411
optional parameters, changing
default values, 552
required parameters to optional, 551
organization (files), C# style conventions, 483–485
Out parameters, 512
overload operator parameters, naming conventions, 80
overloading
override members
adding to unsealed types, 540
removing
removing an override of a virtual member, 543
packages, naming conventions, 61–62
parameters
boolean parameters, choosing, 205–207
collection parameters, 296–297
enum parameters, choosing, 205–207
members with variable number of parameters, 214–218
method parameters
adding, 546
changing types, 546
removing, 546
renaming, 545
reordering parameters by the same type, 547
reordering parameters of differing types, 547
optional parameters, changing
default values, 552
required parameters to optional, 551
Out parameters, 512
overload operator parameters, naming conventions, 80
Ref parameters, 512
reference parameters
Async variants of existing synchronous methods, 352–353
required parameters, changing
optional parameters to, 551–552
to optional, 551
Pareto principle, 10
partial writes to buffers, 458–463
passive voice, comments, 483
performance, exceptions, 281
.Permissions subnamespaces, 489–490
personification, comments, 483
PlatformNotSupportedException, 279
predetermined buffer sizes, 451–452
private fields
removing, on serializable types, 544
renaming, in serializable types, 544
programming
languages, framework design, 11–12
progress reporting, Async Patterns, 513–516
properties
auto-implemented properties, 479
change notification events, 163–165
change notification events, 163–165
indexed properties, designing, 161–163
member properties, choosing, 152–158
types, changing, 548
protected members, extensibility, 230
prototyping, well-designed frameworks, 2
query patterns, LINQ support, 404–408
RAD (Rapid Application Development), progressive frameworks, 13
readability, naming conventions, 52
readonly modifiers
C# style conventions, 479
structs
recompile breaks, 530
Ref parameters, 512
ref structs, 538
reference parameters
Async variants of existing synchronous methods, 352–353
reference types
equality operators, 328
fields, adding to structs, 540
Object.Equals, 314
reflection breaks, 530
rehydration, Dispose Patterns, 381–382
removing
finalizers
from sealed types, 542
from unsealed types, 542
method parameters, 546
non-override members, 543
override members
removing an override of a virtual member, 543
removing an override of an abstract member, 543–544
private fields, on serializable types, 544
readonly modifiers from structs, 535–536, 551
static modifiers, 549
types, 533
renaming
method parameters, 545
private fields in serializable types, 544
reordering method parameters
of differing types, 547
by the same type, 547
reporting (progress), Async Patterns, 513–516
required parameters, changing
to optional, 551
optional parameters to, 551–552
return types
method return types, changing, 547–548
return values in collections, 298–302
runtime breaks, 529
runtime error exceptions, changing to usage error exceptions, 553–554
scenario-driven framework design, 16–23
scoped operations, Dispose Patterns, 387–391
sealed types
removing finalizers from, 542
unsealing, 534
sealing,
unsealed types, 534
SEHException, 278
self-documenting object models, principle of, 29–30
consistency, 34
exceptions, 33
layered architecture, principle of, 36–37
serializable types, private fields, 544
serialization
Binary serialization, 493
Data Contract serialization, 493, 495–499
.NET serialization technologies, 493
runtime serialization, 493, 500–502
SOAP serialization, 493
XML serialization, 493, 499–500
signatures (member)
simplicity, well-designed frameworks, 3–4
single-line syntax (// .), comments, 482
SOAP serialization, 493
source-breaking changes
compilation breaks, 530
recompile breaks, 530
spaces, C# style conventions, 469–470
specifications
Stopwatch specification, 524–528
StackOverflowException, 276–277
static classes
defined, 84
type design guidelines, 102–104
static modifiers, adding/removing, 549
static TryParse methods, 286
Stopwatch specification, 524–528
strings (strongly typed), 129–133
strong typing, self-documenting object models (principle of), 33–34
structs
adding first reference type field to, 540
changing
changing classes to, 537
DateTimeOffset struct, 306–308
defined, 84
IComparable<T> struct, 309–311
common types, 71
generic type parameters, 70–71
readonly modifiers
removing from structs, 535–536, 551
ref structs, 538
type design guidelines, 89–92, 106–111
usage guidelines
DateTimeOffset struct, 306–308
IComparable<T> struct, 309–311
ValueTask structs, Async Patterns, 358–359
ValueTask<TResult> structs, Async Patterns, 358–359
style conventions, C#465–466
ASCII characters, code restrictions, 479
assignment-expression-throw, 480
auto-implemented properties, 479
BCL type names, 476
collection initializers, 478
expression-bodied members, 478–479
if.throw, 480
language keywords, 476
nameof (.) syntax, 479
readonly modifiers, 479
this.476
Unicode escape sequences (uXXXX), 479
subclassing, 13
subnamespaces
.Design subnamespaces, 489
.Interop subnamespaces, 490
.Permissions subnamespaces, 489–490
SuppressFinalize method, Dispose Patterns, 378
synchronous methods, Async variants of, 353–354
SystemException, 274
System.Object, usage guidelines, 312
System.Uri
Task-Based Aync Pattern, 341–347
TaskCanceledException, 278
Task.Status, consistency, 355–357
technology namespace groups, 66–67
Template Method Pattern, 423–425
Tester-Doer Pattern, exceptions and performance, 281–282
this., C# style conventions, 476
from existing thrown types, 555
new types of error exceptions, 555
trade-offs, well-designed frameworks, 6
Try Pattern, exceptions and performance, 282–284
static TryParse methods, 286
value-producing Try methods, 284–285
tuples in member signatures, 220–226
types
abstractions, extensibility, 239–241
assemblies
classes
defined, 84
type design guidelines, 89–104
common types, naming conventions, 71
derived types, moving members to, 542
assembly metadata and types, 127–129
strongly typed strings, 129–133
enums
defined, 84
type design guidelines, 111–124
factored types, aggregate components, 334–335
finalizable types, Dispose Patterns, 383–387, 511–517
interfaces
defined, 84
type design guidelines, 92–100, 104–106
logical groupings, 83
members
moving to derived types, 542
naming conventions, 79
method parameter types
changing, 546
reordering parameters of differing types, 547
moving
via [TypeForwardedTo], 532–533
without [TypeForwardedTo], 533
names
case sensitivity, 534
changing namespaces, 535
namespaces
adding namespaces that conflict with existing types, 531–532
nested types, design guidelines, 124–127
parameters (generic), naming conventions, 70–71
property types, changing, 548
reference types
equality operators, 328
Object.Equals, 314
removing, 533
return types
changing method return types, 547–548
sealed types
removing finalizers from, 542
unsealing, 534
sealing unsealed types, 534
serializable types, private fields
removing, 544
renaming, 544
static classes, defined, 84
strings (strongly typed), 129–133
structs
defined, 84
type design guidelines, 89–92, 106–111
unsealed types
removing finalizers from, 542
value types, 99
equality operators, 327
Object.Equals, 314
underscores (_), naming conventions, 53, 481–482
unhandled exception handlers, 253
Unicode escape sequences (uXXXX), C# style conventions, 479
unsealed classes, extensibility, 228–229
unsealed types
removing finalizers from, 542
sealing, 534
Uri
implementation guidelines, 322–323
usability studies, designing frameworks, scenario-driven framework design, 21–23
usage error exceptions, changing
to functioning behavior, 554
runtime error exceptions to, 553–554
usage guidelines
arrays versus collections, 302–303
DateTimeOffset struct, 306–308
IComparable<T> struct, 309–311
reference types, 314
value types, 314
objects, 312
serialization, 319–321, 493–502
structs
DateTimeOffset struct, 306–308
IComparable<T> struct, 309–311
System.Object, 312
uXXXX (Unicode escape sequences), C# style conventions, 479
validation
assignment-expression-throw, 480
DP, 370
value types, 99
equality operators, 327
Object.Equals, 314
value-producing Try methods, 284–285
values
constant field values, changing, 552
default values, changing in optional parameters, 552
values returned type, changing from a method, 554–555
ValueTask structs, Async Patterns, 358–359
ValueTask<TResult> structs, 358–359
var keyword, C# style conventions, 476–477
vertical whitespace, C# style conventions, 472–473
virtual members
abstract members, changing to virtual members, 553
changing
to abstract members, 553
non-virtual members to, 553
override members, removing an override of a virtual member, 543
visibility of members, changing, 548–549
Visual Basic, language-specific names, 57
“we” in comments, 483
well-designed frameworks, qualities of, 3
backward compatibility, 2
evolution, 7
existing proven designs, borrowing from, 6–7
integration, 7
OO design, 2
prototyping, 2
trade-offs, 6
whitespace (vertical), C# style conventions, 472–473
18.226.169.94