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

[Discussion] Verbosity in Attributes. #344

Open
bzmw opened this issue Apr 16, 2015 · 1 comment
Open

[Discussion] Verbosity in Attributes. #344

bzmw opened this issue Apr 16, 2015 · 1 comment

Comments

@bzmw
Copy link

bzmw commented Apr 16, 2015

So I'm looking to switch from a in-house framework to Flight, they're very similar except that Flight is obviously supported by many more developers. I had a question about attributes though.

In our in-house solution we define defaultAttributes as:

{ events: {
    'bob': 'blahblah',
    'bill': 'bloobloo' },
  selectors: {
    'anne': 'meepmeep',
    'ariel': 'moopmoop' },
  ...
}

as opposed to flight which suggest defining the defaultAttributes as:

{ 'bobEvent': 'blahblah',
  'billEvent': 'bloobloo',
  'anneSelector': 'meepmeep',
  'arielSelector': 'moopmoop',
  ...
}

We found that the Flight standard is very verbose. and results in a lot of repetition in our code. Is this really the best practice? We've thought about creating a mixin which will use 'selector.' for .select() but that seems really hacky and I would rather not have to do that.
Also it looks like if I were to create a mixin I would also have to do it for .on as well. :\

Thoughts?

P.S. Posted this same question on Gitter but no replies, sorry for the double post.

@tbrd
Copy link
Contributor

tbrd commented Apr 16, 2015

The naming convention was a decision we made very early on (about 3 years
ago now). There's certainly no expectation that anyone else will follow
Twitter's conventions, nor have we any idea whether they're actually
helpful. We've just never tried anything else.

On 16 April 2015 at 16:34, Brett Willemsen notifications@github.com wrote:

So I'm looking to switch from a in-house framework to Flight, they're very
similar except that Flight is obviously supported by many more developers.
I had a question about attributes though.

In our in-house solution we define defaultAttributes as:

{ events: {
'bob': 'blahblah',
'bill': 'bloobloo' },
selectors: {
'anne': 'meepmeep',
'ariel': 'moopmoop' },
...
}

as opposed to flight which suggest defining the defaultAttributes as:

{ 'bobEvent': 'blahblah',
'billEvent': 'bloobloo',
'anneSelector': 'meepmeep',
'arielSelector': 'moopmoop',
...
}

We found that the Flight standard is very verbose. and results in a lot of
repetition in our code. Is this really the best practice? We've thought
about creating a mixin which will use 'selector.' for .select() but that
seems really hacky and I would rather not have to do that.
Also it looks like if I were to create a mixin I would also have to do it
for .on as well. :\

Thoughts?

P.S. Posted this same question on Gitter but no replies, sorry for the
double post.


Reply to this email directly or view it on GitHub
#344.

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

No branches or pull requests

2 participants