You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flot has had many contributions, and the code has become a mish-mash of different styles. Maintaining and contributing to the library would be easier if we adopted a unified code style. The proposed style is described in the contribution guidelines.
The text was updated successfully, but these errors were encountered:
Good idea to have a coding style, but flot's core and many of the packaged plug-ins don't use the expansive horizontal spacing of the jQuery style. I would propose we stick with the compact horizontal spacing that most files have, just so we don't make it a goal to change huge swathes of existing code.
In other words, I argue that we should continue to do
if (foo(x, y) > z) {
instead of
if ( foo( x, y ) > z ) {
Similarly I would argue against extra vertical spacing, continuing to prefer
function foo() {
// do some stuff
// do some more stuff
}
to
function foo() {
// do some stuff
// do some more stuff
}
although I see that you have already started modifying some code in that direction... in general I would like to stick with the prevalent style, even if it's not the jQuery standard, just to minimize the number of lines changed merely for stylistic reasons.
Right now it's mostly theoretical; I ran a test against the fillbetween plugin, but wasn't planning to do any others until after 0.8 is released. The codebase already has a lot of 'bad practice' issues - missing braces, use of == rather than === for cases other than null, etc. - that I'd really like to fix, so cleaning up style at the same time isn't such a big deal.
I do think that a common style is very valuable, and choosing the jQuery style had less to do with the actual rules than the fact that it's the most widely-adopted and familiar one. The simpler we make it - the less exceptions to the base document - the easier it is for contributors to do the right thing.
You raise a good point about the 80-character width, though, and personally I prefer the narrower horizontal spacing. So I'll add that as an exception - no extra space before or after parens and square brackets. Unless you feel strongly about it, I'd like to keep the vertical spacing, though; I've always found that a little easier to read.
Yup I agree with everything you said. I'll deal with the extra vertical spacing. :) My main concern was that changing horizontal spacing would touch many, many lines, thus confusing commit history. Vertical spacing doesn't suffer from this problem. So sounds good!
Flot has had many contributions, and the code has become a mish-mash of different styles. Maintaining and contributing to the library would be easier if we adopted a unified code style. The proposed style is described in the contribution guidelines.
The text was updated successfully, but these errors were encountered: