Using “m” prefix for variables in Kotlin

后端 未结 3 1367
日久生厌
日久生厌 2021-02-07 14:05

Using \"m\" prefix for variable names became usual in programming, mainly in Android, but since Kotlin arrived, this minor thing bothers me a bit.

Setting and getting va

3条回答
  •  遥遥无期
    2021-02-07 14:34

    Per the Android Kotlin Style Guide:

    Special prefixes or suffixes, like those seen in the examples name_, mName, s_name, and kName, are not used except in the case of backing properties (see “Backing properties”).

    Therefore you should not use the "m" prefix for variables in Kotlin.

提交回复
热议问题