Code should be formatted to optimize readability. Apply these key practices:
// Instead of:
func getMedianExecutionTime(iterationCount: UInt = 10, _ verbose:Bool = false, _ function: () -> ()) -> Double {
// Use:
func getMedianExecutionTime(
iterationCount: UInt = 10, _ verbose:Bool = false, _ function: () -> ()
) -> Double {
// Instead of:
array.sorted(by: { s1, s2 in return s1 > s2 })
// You can write:
array.sorted { s1, s2 in return s1 > s2 }
let quotation = """
This text will have leading whitespace aligned
with the closing triple quotes.
"""
These formatting practices improve code readability, reduce cognitive load, and make the codebase more maintainable.