What was a good naming convention for Classes, Interfaces, and Types?
For further actions, you may consider blocking this person and/or reporting abuse
What was a good naming convention for Classes, Interfaces, and Types?
For further actions, you may consider blocking this person and/or reporting abuse
ATIXAG -
Apache SeaTunnel -
0x2e Tech -
Vladislav Radchenko -
Top comments (5)
Start with “I” (i in uppercase) for interfaces : IEntity, IStore, IFormProps… to distinguish from components name. Just for my eyes.
I completely disagree.
Prefixing with
I
will not improve readability and comes from another age of programming where we did not have integrated tools within our IDE to type check our code while writing it.What is important is to give functionnal meaning to your types.
Here is a more elaborate answer
its pretty objective imo i just like having ISomething so that i can import it across my project and not the variable. since mordern editors and ts has evolved so far, being too concrete just causes confusions in large teams. Just IMO
Definitely depends on your taste. I am just too lazy to find names. 🤣
Here are guideline from typescript team for typescript codebase: github.com/Microsoft/TypeScript/wi...