johnpapa / angular-styleguide

Angular Style Guide: A starting point for Angular development teams to provide consistency through good practices.
http://johnpapa.net
MIT License
23.87k stars 4.15k forks source link

Style 03-03: Add one more "why" #810

Open stasberkov opened 7 years ago

stasberkov commented 7 years ago

Is is hard to persuade developers with C# background to name interfaces without I prefix. The following "Why" could be helpful: Naming interfaced without I forces developers to give proper name to abstraction and concrete implementation, emphasizing their differences e.g. SportsCar->Car, SuvCar->Car vs just Car->ICar. Please add it to ng2 style guide.

iuliuvisovan commented 7 years ago

Mfw I've been writing C# for ages and then a guy tells me "List" in java is an interface.

pringshia commented 7 years ago

The Angular 2 interfaces don't follow this style, e.g. CanActivate, OnInit

dietergeerts commented 7 years ago

I dissagree on not naming interfaces with an I, because when you just see the code files, you can't tell if it's an interface or not...... The I is very helpful here! It has nothing to do with not being able to name the actual abstraction, @stasberkov, it's all about code readability.....