Giter Site home page Giter Site logo

worststyleguideever.js's Introduction

worstStyleGuideEver.js

  1. Always indent with 2 full tabs.

  2. Actually ... use 16 spaces so tricksters cannot get around it with fancy tabstop settings (attempt to make your documents as wide as possible).

  3. Always start curly braces on their own line, especially after 'return'.

  4. Never use semicolons, JavaScript inserts them for you.

  5. Alternate between }()) and })() with IIFE's.

  6. Use 2 spaces between every character.

  7. Leave several spaces at the end of most lines.

  8. Always use == and !=, and never the 3 character versions, because type-coercion is your friend.

  9. Divide all arithmetical operations by 10 until they occur at the decimal level.

  10. Favor for loops over .forEach() and .map().

  11. Favor .innerHTML over .textContent.

  12. Query the dom as much as possible, it's fast.

  13. Never use var, just repeat any reusable code.

  14. Put all function declarations at the bottom of the file and rely on hoisting.

  15. If you absolutely must use var, make sure all your variables are global.

  16. Never throw errors, this keeps other JavaScripters from learning how to fix code.

  17. Put all functions within a loop.

  18. Declare all var's inside of for loops whose outer scope is global.

  19. Use intentional fall throughs in all switch statements.

  20. Use eval whenever possible.

  21. Repeat yourself often.

  22. Sometimes forget to indent, other times indent twice for no apparent reason.

  23. Write no comments, they clutter the code.

  24. If you do use comments, open with /* but never close it.

  25. Never use alphabetical characters, instead rely on ASCII codes and charCodeAt.

  26. Never set this equal to a var.

  27. Never version your code. If you do, make breaking changes often, but increment the version number the least amount possible.

worststyleguideever.js's People

Watchers

Farrukh Subhani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.