Comments (12)
I agree that naming conventions need to be established and we need to review all snippet names retroactively, as well as new snippets that are being added. The tagging system was put into place to help solve the issue, but we need to establish guidelines on what snippets fall under each category.
from 30-seconds-of-code.
@skatcat31 Multiple categories are a soft no in my opinion. I think we should keep functions simple enough to apply to one main situation. Yes, there are exceptions, but overall it would be better to keep everything categorized under only one category, so we don't have to deal with 90% of our functions being array-specific, string-specific and utilities at the same time.
@fejes713 I arbitrarily put those under utilities, but they might be better as math.
from 30-seconds-of-code.
@skatcat31 Adding the category in the filename will cause all sorts of problems, as contributors will have to figure out the best category for each snippet and we will have to constantly nag them about what goes where. I honestly prefer the tag database, as we can untag snippets that are incomplete or whose functionality and usefulness is debatable, so that they do not compile in the build process and we can then take the time to figure it out among ourselves.
This will also aid the testing process, when implemented, as we can just untag files that do not pass all test cases to figure out what to do with them. If we have the tag in filename, we will have to manually add an exception list to the builder for snippets that are not yet ready.
I also considered splitting the snippets into folders, but that would make things even worse. The best case scenario for categorization in my opinion is to open another issue, dedicated to discussion of categorization (or open a second channel on gitter just for naming and categorization), where we keep track of all snippets and figure out what needs to be done.
As it currently stands, I suggest the following:
- Open an issue where we list all existing snippets alphabetically and start figuring out which ones are complete and sealed (as in we are not gonna alter them any further as they work perfectly fine).
- Start renaming what needs to be renamed and tagging things after we discuss them (I tagged everything semi-arbitrarily yesterday), so we can agree what goes where.
- Keep track of snippets that are not yet complete, need modifications and should be categorized differently.
In general, I want new contributors to sit down for 20 minutes, find something they want implemented, format a short snippet appropriately and submit a PR. We can then review the code and description, debate the usefulness and put the final touches there, such as changing the name, categorizing and setting up the tests when the time comes. This keeps the barrier of entry low and allows us to maintain the project fairly consistently without forcing new contributors to figure out our whole procedure. What do you guys say?
@darrenscerri @elderhsouza @kingdavidmartins @atomiks @skatcat31 I want your opinions!
from 30-seconds-of-code.
This begs a question though... Multiple categories for a function. Should such a thing be allowed?
from 30-seconds-of-code.
@Chalarangelo Yea I agree, Although the tagging helps with snippets/methods. We also have to make sure the snippets that are tagged are tagged in the appropriate category. Yea as far as guidelines for naming I have a few ideas to date.
1. categorySnippetName.md
Note
- camelCase convention with snippet starting with category
- Snippet name & Fn name follow the same convention and guidelines
2. category-snippet-name.md
Note
- kebab-case convention with snippet starting with category
- Snippet name & Fn name follow the same convention and guidelines
from 30-seconds-of-code.
I do think a naming convention is needed, however I think the category might not be needed as part of the method name, but more as part of the file name as category${serperator}title.md
so that the method name in the md can be whatever makes more sense, and the file name could be used to infer grouping instead of a DB that would need constant upkeep. Now each file decides where it goes in categorization, and each method can be whatever makes sense.
from 30-seconds-of-code.
@skatcat31 It definitely could be. While going through all the functions I also realized that some of them can fit into multiple categories. It's personal preference though, each of us categorizes things differently in our head.
For example, I would put both Random integer in range
and Random number in range
into Math category since they are operating with numbers and use Math
built-in object. However, I also think that should stay at utility
also.
from 30-seconds-of-code.
@Chalarangelo You're right. Then we just need to focus on what category is best for every function. The ones I mentioned are not the only ones that might need category change. However, there's a separate issue for that I think.
from 30-seconds-of-code.
Yes, we need to list the debatable ones in #159 and start organizing everything as we should.
from 30-seconds-of-code.
As far as naming is concerned, I think we should switch our model to name files based on the contained function and then improve our descriptions to include the what and how of each function, so that users can see what the snippet is supposed to achieve along with how it does so. As it currently stands, it's really difficult to figure out what a few of the snippets do. Do you guys agree?
from 30-seconds-of-code.
I'm closing this, let's discuss under #206 where there's a new proposal abut naming. Move categorization concerns under #159 so we can discuss that further, too.
from 30-seconds-of-code.
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)
- Merge two arrays and remove duplicate elements HOT 2
- CSVToArray will return an empty item for documents ending with \n HOT 2
- addDaysToDate fails with non-UTC timezone HOT 1
- A snippet folder dedicated to Angular
- Js
- Broken links HOT 4
- New snippet ideas HOT 1
- passive-scroll-listener-performance has obsolete/incorrect advice HOT 2
- Regarding the throttle function's question. HOT 7
- style: Centering the footer section ⏡ HOT 2
- Website Navigation Bar
- cookie parsing containing a `=` in value HOT 5
- [ BUG ] Missing space in footer section HOT 12
- Typo in the event-loop-explained.md snippet HOT 2
- fix: Unnecessary parameter in Queue class methods HOT 2
- Terminology issue in blog HOT 4
- :bug: Fix Footer settingsPath (GithHub,CC ,30-sec-of-code Link)
- Kindly add hacktoberfest label to your repo. HOT 1
- [Feature Request] : The border of search bar is not clearly visible .
- Typo on the website
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 30-seconds-of-code.