Skip to content

Commit ea169a2

Browse files
authored
Contributing guidelines
1 parent 95bba0b commit ea169a2

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

CONTRIBUTING.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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 all over the globe. Being one of our contributors, you agree and confirm that:
12+
13+
- You did your work - no plagiarism 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 for a problem, different representations for 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 a grammar mistake in a comment to implementing complex algorithms. Please read this section if you are contributing your work.
25+
26+
27+
Please help us keep our issue list small by adding fixes: #{$ISSUE_NO} to the commit message of pull requests that resolve open issues. GitHub will use this tag to auto close the issue when the 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+
* have Javascript type hints for their input parameters and return values
44+
* raise Javascript exceptions (ValueError, etc.) on erroneous input values
45+
46+
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.
47+
48+
#### Coding Style
49+
50+
We want your work to be readable by others; therefore, we encourage you to note the following:
51+
- Use camelCase for identifier names (variables and functions)
52+
- Names start with a letter
53+
- follow code indentation
54+
- Always use 2 spaces for indentation of code blocks
55+
```
56+
function sumOfArray(arrayOfNumbers) {
57+
let sum = 0;
58+
for (let i = 0; i < arrayOfNumbers.length; i++) {
59+
sum += arrayOfNumbers[i];
60+
}
61+
return (sum);
62+
}
63+
```
64+
- Avoid using global variables and avoid '=='
65+
- use 'let' over 'var'
66+
- Better to use ECMAScript 6
67+
- Avoid importing external libraries for basic algorithms. Only use those libraries for complicated algorithms.
68+
69+
70+
71+
- Most importantly,
72+
- **Be consistent in the use of these guidelines when submitting.**
73+
- Happy coding!
74+
75+
Writer [@itsvinayak](https://github.com/itsvinayak), May 2020.

0 commit comments

Comments
 (0)