-
Notifications
You must be signed in to change notification settings - Fork 0
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
Changing array type from generic to [] #9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote in favour of Array
due to the slightly more readable nature personally :)
Personally I prefer |
I prefer I think it reads more naturally, too: "an array of |
There's a fairly comprehensive style guide from Basarat here which I'd be inclined to follow, purely because MSFT don't go into enough detail in their Style/Contribution Guidelines. However, it seems to be their way:
FWIW, I've always written |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please get consensus and/or approval from a grown-up (e.g. Phil/Frans). After the commit is okay if this is blocking you, otherwise before ideally.
I'm not entirely happy with this, actually. It would cause some readability issues in EBC. Now, we have:
Whereas this change would give us
|
My preference would be to use Array for similar reasons to before, i find it more readable and its just what i use generally. |
I don't care which we choose, only that we're consistent. That's why I looked for guidance on the web. If you guys (Experian) have already established a precedent then unless there's a very good reason to change we should continue with what you've done. I can't think of any justification to change from |
I don't think we do have a precedent in Experian because we don't have any linting. |
Is the code reasonably consistent? The linter should match the code. |
Sorry yes i meant |
Being internally consistent is more important than moving to msft/"Basarat" standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer the Array
generic type as that's what we're using in EBC due to the similarity with KnockoutObservableArray
.
Experian is not consistent so I still believe this is still open for debate |
Good to know. For comparison (with those 42 occurrences) how many Array<> would you find please? |
I think |
I agree with that, even so it's 108 to 42. A way greater majority than something trivial like exiting Europe, but not particularly consistent either. |
I think consistency is what is important here. However, I personally prefer |
In terms of usages, Finygo has |
I personally follow the pattern already set out on the project, but my preference is to type as little as possible so generally would do |
Folks, Thanks for the discussion, stats, and summary. Please use |
Can we merge this then if we have decided. |
Please go ahead.
…---
Pete van Blerk | Principal Developer | 020 3757 9050
pvanblerk@neworbit.co.uk<mailto:pvanblerk@neworbit.co.uk>
From: Henry Ing-Simmons [mailto:notifications@github.com]
Sent: 04 October 2017 13:37
To: NewOrbit/tslint-config <tslint-config@noreply.github.com>
Cc: Pete van Blerk <pvanblerk@neworbit.co.uk>; Review requested <review_requested@noreply.github.com>
Subject: Re: [NewOrbit/tslint-config] Changing array type from generic to [] (#9)
Can we merge this then if we have decided.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub<#9 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFTjxm038xKNUMmWSCFZWtXCxKHp7f8lks5so3v9gaJpZM4PUQds>.
|
I'll merge this and publish later. |
Just come across a use case for
That means that arrays are going to be declared differently to other types.
|
Changing array type from generic to []
I wanted to start a discussion on this.
My preference for array types is
T[]
as opposed to the generic formArray<T>
It is more concise, less typing (2 chars as opposed to 7) and puts the more important information up front (what is this an array of).
But this is quite a significant change so I would be interested to see what the consensus of the company is.