- If it works, Don't touch it.
- Never code at daytime, Always code at night
- Don't fight over an IDE, Just use notepad++
- Stick to maximum 3 programming languages
- Don't minify or obfuscate your code, It absolutely sucks
- Use a beautifier or a code prettier, To make it look better
- Always write documentation
- Write summary comments, Or just normal comments to make everyone's life easier
- It is recommended to license your code if you don't want others to modify it without your permission
- Always and always use source control. My personal favorite is GitHub
- Organize your program's features using a todo list, Or a project board
Last active
October 2, 2021 04:56
-
-
Save MinecraftPublisher/e52c240652db49c54434fe39a58fdad6 to your computer and use it in GitHub Desktop.
List of all the rules of programming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * A library to fetch all the programming rules | |
| * That obeys all of them | |
| */ | |
| // The URL to fetch the rules from | |
| const url = "https://gist.githubusercontent.com/MinecraftPublisher/e52c240652db49c54434fe39a58fdad6/raw/README.md" | |
| // Store the rules in a variable and update it if needed | |
| let rules = "" | |
| // A function to fetch the data uring HTTP GET | |
| function httpGetAsync(theUrl, callback) | |
| { | |
| var xmlHttp = new XMLHttpRequest(); | |
| xmlHttp.onreadystatechange = function() { | |
| if (xmlHttp.readyState == 4 && xmlHttp.status == 200) | |
| callback(xmlHttp.responseText); | |
| } | |
| xmlHttp.open("GET", theUrl, true); | |
| xmlHttp.send(null); | |
| } | |
| // Fetch the data, Parse it and update the link if needed. | |
| function fetch() { | |
| httpGetAsync(url, function (data) { | |
| // Parse the received data | |
| let list = data.split('\n') | |
| // Remove the start and the end | |
| list.splice(0, 3) | |
| list.splice(list.length - 3, 3) | |
| // Map the list to remove the numbers, The dot and the spacing | |
| list.map((item) => { | |
| item = item.split('.')[1] | |
| item.splice(0, 1) | |
| }) | |
| // Put back the list together | |
| list = list.join('\n') | |
| // Set the rules to the list | |
| rules = list | |
| }) | |
| } | |
| // Export the module elements | |
| module.exports = { | |
| fetch, | |
| rules, | |
| url | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment