Skip to content

Commit f74a3ae

Browse files
authored
Merge branch 'master' into master
2 parents a202d1d + 8c2aa0f commit f74a3ae

File tree

5 files changed

+483
-381
lines changed

5 files changed

+483
-381
lines changed

CONTRIBUTING.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Contributing guidelines
2+
3+
## Before contributing
4+
5+
Welcome to [TheAlgorithms/Javascript](https://github.com/TheAlgorithms/Javascript)! Before sending your pull requests, make sure that you **read the whole guidelines**. If you have any doubt on the contributing guide, please feel free to [state it clearly in an issue](https://github.com/TheAlgorithms/Javascript/issues/new)
6+
7+
## Contributing
8+
9+
### Contributor
10+
11+
We are very happy that you consider implementing algorithms and data structure for others! This repository is referenced and used by learners from around the globe. Being one of our contributors, you agree and confirm that:
12+
13+
- You did your work - plagiarism is not allowed.
14+
- Any plagiarized work will not be merged.
15+
- Your work will be distributed under [GNU License](License) once your pull request is merged
16+
- You submitted work fulfils or mostly fulfils our styles and standards
17+
18+
**New implementation** is welcome! For example, new solutions to a problem, different representations of a graph data structure or algorithm designs with different complexity.
19+
20+
**Improving comments** and **writing proper tests** are also highly welcome.
21+
22+
### Contribution
23+
24+
We appreciate any contribution, from fixing grammar mistakes to implementing complex algorithms. Please read this section if you are contributing your work.
25+
26+
27+
If you submit a pull request that resolves an open issue, please help us to keep our issue list small by adding `fixes: #{$ISSUE_NO}` to your commit message. GitHub will use this tag to auto close the issue if your PR is merged.
28+
29+
#### What is an Algorithm?
30+
31+
An Algorithm is one or more functions (or classes) that:
32+
* take one or more inputs,
33+
* perform some internal calculations or data manipulations,
34+
* return one or more outputs,
35+
* have minimal side effects.
36+
37+
Algorithms should be packaged in a way that would make it easy for readers to put them into larger programs.
38+
39+
Algorithms should:
40+
* have intuitive class and function names that make their purpose clear to readers
41+
* use JavaScript naming conventions and intuitive variable names to ease comprehension
42+
* be flexible to take different input values
43+
* raise JavaScript exceptions (RangeError, etc.) on erroneous input values
44+
45+
Algorithms in this repo should not be how-to examples for existing JavaScript packages. Instead, they should perform internal calculations or manipulations to convert input values into different output values. Those calculations or manipulations can use data types, classes, or functions of existing JavaScript packages but each algorithm in this repo should add unique value.
46+
47+
#### Coding Style
48+
49+
To maximize the readability and correctness of our code, we require that new submissions follow [JavaScript Standard Style](https://standardjs.com/)
50+
- Command to install JavaScript Standard Style
51+
```
52+
$ npm install standard --save-dev
53+
```
54+
- Usage
55+
```
56+
$ standard MyFile.js // if that fails, try: npx standard MyFile.js
57+
```
58+
59+
- Use camelCase for with leading character lowercase for identifier names (variables and functions)
60+
- Names start with a letter
61+
- follow code indentation
62+
- Always use 2 spaces for indentation of code blocks
63+
```
64+
function sumOfArray (arrayOfNumbers) {
65+
let sum = 0
66+
for (let i = 0; i < arrayOfNumbers.length; i++) {
67+
sum += arrayOfNumbers[i]
68+
}
69+
return (sum)
70+
}
71+
72+
```
73+
- Avoid using global variables and avoid '=='
74+
- Please use 'let' over 'var'
75+
- We strongly recommend the use of ECMAScript 6
76+
- Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms.
77+
78+
79+
80+
- Most importantly,
81+
- **Be consistent in the use of these guidelines when submitting.**
82+
- Happy coding!
83+
84+
Writer [@itsvinayak](https://github.com/itsvinayak), May 2020.

0 commit comments

Comments
 (0)