Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Conventions): naming standards #196

Closed

Conversation

NathanWalker
Copy link
Contributor

closes #185

I'm not saying merge this actually, however this is how the naming conventions would play out here.

I've had mixed feelings about them for awhile but in general, like them.
I've just never been a big fan of long filenames which is why I'm not in love with whatever.component.ts vs. whatever.ts, however it does make things clear.
This becomes more idiomatic when you consider most conventions suggest placing files inside a folder called components such as shown here in this PR.
So when opening files and you see:
app/components/home/home.component.ts
vs.
app/home/home.ts

First, for large projects with more than 2-3 nested hierarchies, you would need a screen or IDE at least wide enough to show the long path and filename when you have multiple tabs open to discern the difference between 2 of the same named files in different folders, ie.:
app/component/home/home.component.ts
vs.
app/component/users/profile/home.component.ts
^ just an example but it can definitely happen ;)

But in the end, I digress. Whatever the community believes is universally great.

If this is the way to go, then by all means, merge 👍

@@ -27,7 +27,7 @@ import {XLarge} from './directives/x-large';
// Every Angular template is first compiled by the browser before Angular runs it's compiler
template: require('./home.html')
})
export class Home {
export class HomeCmp implements OnInit {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though using ngOnInit will work without implementing OnInit, it appears to be recommended to still implement for TypeScript sake:
angular/angular#5814

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't include this on purpose

@PatrickJS
Copy link
Owner

I have my own reasons for the current structure that I will be covering in a blog post in the future that may conflict with the current naming conventions

@@ -70,7 +70,7 @@
"tslint-loader": "^2.1.0",
"typedoc": "^0.3.12",
"typescript": "^1.7.3",
"typings": "^0.3.1",
"typings": "^0.4.1",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make a separate pull-request for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

@NathanWalker
Copy link
Contributor Author

@gdi2290 Absolutely! Don't merge (as mentioned)! However, maybe we can keep the PR open just to see if others have thoughts that may help form the standards or reach consensus?

Idk, I wish I didn't have mixed feelings about the going conventions/standards, but it seems they are amiss on conveniences and simple shorthand.

@PatrickJS
Copy link
Owner

I wish there was a convert to issue button. I'll include this in the FAQ

@PatrickJS PatrickJS closed this Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Naming conventions + style guide and best practices
2 participants