component/component.github.io

Sorting components

buschtoens opened this issue · 12 comments

Maybe we should sort the components by stars. Would be user-friendlier.

tj commented

ah yeah maybe, we are in component-search. It's slightly unfair since most things that were not designed as components will have more stars (just due to their reach) where as "proper" components will be less useful for other people, but probably beats nothing

I personally really dislike 'Stars' as a means of sorting. It's essentially what got us into this mess in the first place. People choose their repositories largely based on popularity, because that tends to lead them to think it'll be better maintained. This runs completely counter to the unix philosophy of doing one simple thing well. It leads to libraries like Underscore seeming like the best way to sort a list of numbers.

This is why for the wiki & component.jit.su I went for categorization and then completely arbitrary ordering within categories.

Useful metrics to sort on are:

  • stability - something which continues to be used but hasn't changed much in a long time is probably just so good that it doesn't need to change.
  • test coverage - something which is testable and has unit tests is much more likely to work reliably and consistently
  • browser compatibility - I can't use it if it's not compatible with the browsers I need to support
  • appropriate re-use - Uses other components as dependencies when appropriate rather than re-inventing the wheel.

These are difficult to measure, and would need some sort of weighting, but I think they'd give a much better picture of which components should be used.

i think one interesting thing to do would be to rank components by the amount of times they are depended on in other components. it would still favor jquery and things, as people will fallback to them more often than others, but it would get around the "i'll star this because i recognize the name" piece, so it would probably be a bit more fair. or the "star this for later" which doesn't reflect actual usage.

yeah it would also be cool if somehow travis and saucelabs could be hooked up to automatically measure tests/browser compat for the component. but that sounds like a shit ton of work.

there could also be something similar to npm's scripts that would be the place to map your test command:

"commands": {
  "test": "make test"
}

that would give us the ability to rank components by whether they had tests. but it would also be overkill if it's only use case was knowing whether a component had tests, and there isn't that great of a reason to offer component test when make test works just fine.

there might be good cause to add just browser compatibility to component.json so that people have a defined place to document it. that seems like metadata that most people would find useful, because right now it's pretty hard to tell what's supported. it could be:

"browsers": {
  "ie": "8",
  "safari": "5",
  "chrome": "*",
  "firefox": "*"
}

i probably wouldn't want things sorted by browser compatibility, that would need weighting like @ForbesLindesay mentioned that would get arbitrary pretty quickly. instead i'd just want filtering. (could store my preferences in localstorage for next time too)


on a different note, i'm not sure sorting is that high priority. i think we need better a search matching algorithm before that, because in most cases you'd probably search down to < 10 components

I think when you're new to component you probably want to browse before you search. And it's what you see in that initial browsing phase that colours your impression of the repository.

mm yeah for that i think categories are really what you want. i agree that the wiki's categories are really nice. i actually just read through certain categories every now and then to see what's been added recently and if anything in there that i could apply to my current projects

tj commented

yeah we should definitely grab those in the component wiki script for other things

Maybe, instead of categories, we could transform popular keywords (don't know... > 30 components?) into categories, so that popular keywords are listed and exploreable by clicking on them (start page redesign: tag cloud?)

On the second guess, stars really may not be that good, but some clever sorting algorithm (like Google's PageRank) would rock.

I think human picked categories would generally be better as sometimes a category doesn't need to contain many components to be really useful, or could contain hundreds but be pointless.

+1 for any kind of sorting; the current list seems completely unordered

+1 too then

changed to sort by stars right now. now the default view shows backbone/underscore/jade.

+1 for @ianstormtaylor's pagerank-like idea.