Skip to content

Instantly share code, notes, and snippets.

@MinecraftPublisher
Last active October 2, 2021 04:56
Show Gist options
  • Select an option

  • Save MinecraftPublisher/e52c240652db49c54434fe39a58fdad6 to your computer and use it in GitHub Desktop.

Select an option

Save MinecraftPublisher/e52c240652db49c54434fe39a58fdad6 to your computer and use it in GitHub Desktop.
List of all the rules of programming

List of all the programming rules

  1. If it works, Don't touch it.
  2. Never code at daytime, Always code at night
  3. Don't fight over an IDE, Just use notepad++
  4. Stick to maximum 3 programming languages
  5. Don't minify or obfuscate your code, It absolutely sucks
  6. Use a beautifier or a code prettier, To make it look better
  7. Always write documentation
  8. Write summary comments, Or just normal comments to make everyone's life easier
  9. It is recommended to license your code if you don't want others to modify it without your permission
  10. Always and always use source control. My personal favorite is GitHub
  11. Organize your program's features using a todo list, Or a project board

This list is in progress and gets updated over time.

/*
* 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