Code Monkey home page Code Monkey logo

code-guidelines's Introduction

#Sencha's Guide to JavaScript Style and Best Practices

The following document contains a series of best practices and recommendations for building enterprise web applications with JavaScript and HTML5.

Much of this advice is used internally at Sencha and certainly applies to building applications with the Sencha frameworks -- but this JavaScript style guide can also help teams building applications with any framework, or even just vanilla JavaScript.

##Mission Statement

Sencha firmly believes that high quality JavaScript is above all else consistent, and addresses four main pillars:

  • Readability: JavaScript code should be clear and easy to understand at first glance
  • Maintainability: JavaScript code should be consistent and cohesive
  • Error Prevention: JavaScript code should strategically avoid common problems
  • Performance: JavaScript code should always consider faster implementations

This style guide will attempt to provide some ground rules for building enterprise web applications with JavaScript and HTML5, and as such is intended primarily for medium-to-large development teams.

These recommendations are based on our own experiences, as well as direct interaction with our enterprise customers.

##Dogma vs Doctrine

Avoid obsessing about code style -- this document is merely a guide, not infallible dogma. It is not intended to be a comprehensive list of all "best practices", but rather a list of the most common areas on which people ask our opinions. Many others have created similar documents and clearly not everyone agrees on every point.

The overall goal for this document is to help you evaluate what we consider to be the important aspects of "quality" code, and ultimately create your own readable, maintainable and scalable JavaScript projects. Our suggestions stand as a baseline from which your teams should implement your own strategy for building a high quality JavaScript codebase.

#Outline

To best articulate Sencha's experience building both frameworks and enterprise applications, we will divide this discussion into four parts:

  1. Readability
  2. Maintainability
  3. Preventing Errors
  4. Performance

It is worth noting that many of the points we will cover might fit into more than one of these pillars.

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.