naming conventions

26 views
Skip to first unread message

Jörg Hohwiller

unread,
Sep 30, 2016, 10:05:39 AM9/30/16
to AngularJS
Hi there,
I just want to question your suggested naming conventions:
https://angular.io/docs/ts/latest/guide/style-guide.html#!#02-02
https://angular.io/docs/ts/latest/tutorial/toh-pt3.html#!#naming-conventions

IMHO you should follow the TypeScript conventions from Microsoft - the makers of TypeScript:
https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines

This means a class FooRestService should be located in FooRestService.ts or fooRestService.ts instead of foo-rest.service.ts.
This is how TypeScript is used, how Java is used, how C# is used, how most of all other languages that have classes in files are used.

IMHO this even makes it easier to find things as if I am looking for the Class FooRestService I do not have to do dash-case with magic dot transformations in my mind.

Further TypeScript conventions explicitly states that interfaces should not use artifical prefixes (I) [or suffixes (IF)]. This is a style that has already been discouraged in Java and C# ~10 years ago.

I do not want to blame anyone and I do not want to force anyone to re-factor or change anything.
However, I just want to make a clear suggestion - whatever you will do with it...

Best regards
  Jörg

Jörg Hohwiller

unread,
Sep 30, 2016, 12:55:29 PM9/30/16
to AngularJS
Already Angular Coders themselves do it as suggested and do not follow own angular conventions. See e.g.:
https://github.com/angular-ui/ui-router/tree/master/src/url
Reply all
Reply to author
Forward
0 new messages