GithubHelp home page GithubHelp logo

Categorization about 30-seconds-of-code HOT 22 CLOSED

30-seconds avatar 30-seconds commented on April 28, 2024
Categorization

from 30-seconds-of-code.

Comments (22)

Chalarangelo avatar Chalarangelo commented on April 28, 2024 2

Categorization needs to have rules. For example, today I tagged a snippet that converts an array into a list of <li> elements and appends them to a list. That could be both an array snippet and a browser snippet. But, seeing as browser is more specific, I tagged as a browser snippet. I think we should check existing snippets and retag based on some ruleset and specificity, then update the guidelines to make sure there's a consistent set of rules for tagging.

from 30-seconds-of-code.

fejes713 avatar fejes713 commented on April 28, 2024 1
  1. JSON to date should be added to Date category since it's working with dates and returning a date in the format of a string.
  2. Random integer in range and Random number in range could go to Math category since they're both using Math built-in object and they also return a number.

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 1

I think we should keep utility, but better categorize most of its snippets elsewhere. Utility should be anything that cannot be categorized anywhere else in my opinion.

from 30-seconds-of-code.

kirilloid avatar kirilloid commented on April 28, 2024 1

Maybe, create tags (instead of non-intersecting categories) so a function could be found by different keywords?

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 1

I like the idea of categories and tags working at the same time. It's a very neat way to organize everything. I'll see if I can modify the tagger script or someone else could do it.

from 30-seconds-of-code.

fejes713 avatar fejes713 commented on April 28, 2024 1

Mostly, at least I think so, we categorized them by our inner feeling on where they should go. For me, that whole input/output thing is nonsense. For example we have: isDivisible which takes an number but returns boolean. Category of this function is Math, on the other hand, in the same category we have arraySum which takes array but returns number ...

I would put that function in both 😆 (idea of multiple tags is amazing)

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024 1

The great multitagging update

As it currently stands, we need multitagging implemented as soon as possible. I'm assigning this to myself (feel free to pm me/comment here if you want to help or have a good idea). The outline is as follows:

functionX: string, utility, advanced
  • Keep tag_database and add multiple values for each snippet, instead of having just one.
  • Retroactive update of tags so that all snippets have proper tagging applied.
  • Update to the tagger, webber, builder scripts to handle these changes:
    • The tagger will keep multiple tags for each snippet, although categorize each snippet under its first tag (in the example above functionX would be listed under string).
    • The webber will add a special attribute to all snippet links with their added tags, so that it is easier to browse them when searching (so that functionX could be found using string or utility or advanced).
    • The builder will keep categorization as-is, with the exception of the advanced tag, which will add an icon or a little badge next to the snippet name in the README. This will help developers identify snippets that might require more time to understand.
    • The webber will also add a simple textual tag next to the name of snippets that are advanced, similar to the builder.
  • Add new secondary cetegories with more specific contexts inside top-level categories (e.g. we can have some specific subset in math for fibonacci which we have a few snippets for (not the best example, but I hope you get the idea)).

I will start working on these changes, which should not be too hard to implement and push within the next few days. If anyone disagrees or has a proposal to improve this suggestion, now would be the time.

from 30-seconds-of-code.

skatcat31 avatar skatcat31 commented on April 28, 2024 1

Sounds simple enough. If you have any problems with the search implementation on the web let us know

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

I am not very objective, as I did the categorization myself yesterday. Suggest away guys!

from 30-seconds-of-code.

meetzaveri avatar meetzaveri commented on April 28, 2024

I think there should also be a hybrid category like array and object where both are used. Same way for strings and arrays. Also there is utility category, but there are more snippets that also fall into that category and maybe whole repo is kind of utility. So can we break remove utility category and its category should be transferred into other respective category?

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

@fejes713 Your suggestions make a lot more sense than what I have done with these snippets, I'm moving them right away.

from 30-seconds-of-code.

fejes713 avatar fejes713 commented on April 28, 2024

@Chalarangelo This sounds like a good idea, what do you think about it? Could be useful in future?

I think we should keep the categories and add tags. They could definitely bring a lot to project since we're having more and more snippets every day.

from 30-seconds-of-code.

skatcat31 avatar skatcat31 commented on April 28, 2024

... Wait categories weren't tags? Guess I misunderstood it earlier then. Lesson to be learned:

Don't glance, read

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

@skatcat31 Well, what we have right now is a reasonably simplistic categorization system I set up in like an hour, but in theory it should allow for multiple tags with a little bit of modification.

from 30-seconds-of-code.

meetzaveri avatar meetzaveri commented on April 28, 2024

@Chalarangelo Yes though categorisation is there, but multiple tags idea is better to suggest particular snippets also belong to that respective area !!

from 30-seconds-of-code.

skatcat31 avatar skatcat31 commented on April 28, 2024

The question is then what are the rules for tagging? What it takes? What it gives? Does that mean

const spread = (f, a) => f(...a)

is under function, utility, or array?

from 30-seconds-of-code.

skatcat31 avatar skatcat31 commented on April 28, 2024

Was that snippet ever marked as mutating?

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

The tagger has been updated to now mark all new snippets as uncategorized, so you can help out by tagging existing snippets in the database that are listed as uncategorized and sending a PR. Travis runs the tagger automatically during each build, so the database should always be up to date with the latest commit.

@skatcat31 no and it probably should be added as a note to make sure people know what they are dealing with.

from 30-seconds-of-code.

fejes713 avatar fejes713 commented on April 28, 2024

@Chalarangelo I will try doing that now!

from 30-seconds-of-code.

Chalarangelo avatar Chalarangelo commented on April 28, 2024

Right now multitagging is priority number 3 on our list, right after the restructure of #233 and adding tests as discussed in #78. Multitagging will most likely only work on the website, but we might be able to make it usable in the README as well.

from 30-seconds-of-code.

fejes713 avatar fejes713 commented on April 28, 2024

@Chalarangelo 👏

from 30-seconds-of-code.

lock avatar lock commented on April 28, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.

from 30-seconds-of-code.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.