Typescript style guide for interfaces

前端 未结 4 669
臣服心动
臣服心动 2020-12-30 11:02

this is a question that may not have a single correct answer, as I do realise coding styles are quite varied, especially between different languages, eg camel case function

4条回答
  •  心在旅途
    2020-12-30 11:17

    Similar question is asked here Confused about the Interface and Class coding guidelines for TypeScript

    My answer on it: https://stackoverflow.com/a/41967120/586609

    Reasons:

    1. The times of the Hungarian notation have passed
    2. I-prefix violates encapsulation principle
    3. Protection from bad naming
    4. Properly chosen names vaccinate you against API Design Myth: Interface as Contract.

提交回复
热议问题