Skip to content

Avoid defining a value's type if it can be inferredΒ #13

@mokagio

Description

@mokagio

Here and there in the codebase we have some code doing:

let foo: String = "string"

let fontSize: CGFloat = CGFloat(42.0)

In such cases the type information is redundant, the compiler can infer it, an so can the reader.

A point has been made that this style provide more clarity, I can see that point, although I personally disagree.

I have a 3 suggestions which I'll list as single comments so that they can be πŸ‘ ed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions