background preloader

Airbnb/javascript: JavaScript Style Guide

README.md Airbnb JavaScript Style Guide() { A mostly reasonable approach to JavaScript Table of Contents Types Primitives: When you access a primitive type you work directly on its value stringnumberbooleannullundefinedvar foo = 1, bar = foo; bar = 9; console.log(foo, bar); // => 1, 9Complex: When you access a complex type you work on a reference to its value objectarrayfunctionvar foo = [1, 2], bar = foo; bar[0] = 9; console.log(foo[0], bar[0]); // => 9, 9

https://github.com/airbnb/javascript

Related:  programmingGuides de Style JavaScript

Solving Coding Problems With PEDAC This article outlines how to solve programming problems by using Launch School’s PEDAC process. There are many ways to solve coding problems, and PEDAC is but one. The purpose of this article isn’t to proclaim PEDAC as the best or only approach but provide it as one of the tools you can turn to when you begin working on a problem. Google JavaScript Style Guide 1 Introduction This document serves as the complete definition of Google’s coding standards for source code in the JavaScript programming language. A JavaScript source file is described as being in Google Style if and only if it adheres to the rules herein. Like other programming style guides, the issues covered span not only aesthetic issues of formatting, but other types of conventions or coding standards as well.

Paper.js - Paper.js Standing on the shoulders of Scriptographer and making use of HTML5 standards, Paper.js is a comprehensive open source vector graphics scripting framework. Document Object Model Paper.js provides a Document Object Model (also called a Scene Graph) that is very easy to work with. Create a project and populate it with layers, groups, paths, rasters etc. Groups and layers can contain other items and even other groups. Read JavaScript Allongé A Pull of the Lever: Prefaces “Café Allongé, also called Espresso Lungo, is a drink midway between an Espresso and Americano in strength. There are two different ways to make it. The first, and the one I prefer, is to add a small amount of hot water to a double or quadruple Espresso Ristretto. Like adding a splash of water to whiskey, the small dilution releases more of the complex flavours in the mouth. “The second way is to pull an extra long double shot of Espresso.

How I went from student to drop-out to software engineer Introduction I spent three years as a wellness and medicine major in college. Through a long and complicated series of events and realizations, I grew interested in computer science and, subsequently, software engineering. So, I decided to transfer schools and enter a Software Engineering undergraduate program. I spent less than two months in that program. Udacity Nanodegree Style Guide General Meta Rules Encoding Use UTF-8 (no BOM). Make sure your editor uses UTF-8 as character encoding, without a byte order mark. Comments Use comments to explain code: What does it cover, what purpose does it serve, and why is the respective solution used or preferred?

Learning JavaScript Design Patterns Design patterns are reusable solutions to commonly occurring problems in software design. They are both exciting and a fascinating topic to explore in any programming language. One reason for this is that they help us build upon the combined experience of many developers that came before us and ensure we structure our code in an optimized way, meeting the needs of problems we're attempting to solve. Understanding RequireJS for Effective JavaScript Module Loading Modular programming is used to break large applications into smaller blocks of manageable code. Module based coding eases the effort for maintenance and increases reusability. However, managing dependencies between modules is a major concern developers face throughout the application development process. RequireJS is one of the most popular frameworks around for managing dependencies between modules.

Paul Ford: What Is Code? A computer is a clock with benefits. They all work the same, doing second-grade math, one step at a time: Tick, take a number and put it in box one. Tick, take another number, put it in box two. JavaScript Best Practices Writing a best practice article is quite a tricky business. To a number of you, what you are about to read will appear to be very obvious and just the sensible thing to do. However, looking around the web and getting code handed over to me from other developers for years has taught me that common sense is actually quite a rarity in live code on the web, and the “sensible and logical thing to do” gets pushed far down the priority list once you are in the middle of a project, and the deadline is looming. So I’ve decided to make it easier for you by creating this article, which is a compilation of best practices and good advice I’ve amassed over the years, much of it learnt the hard way (experimentation and suchlike). Take the advice below to heart and keep it in a part of your brain that has a quick access route so you can apply it without thinking about it.

Related: